[global] Remaps self.SDK.targetManager

This CL changes references to self.SDK.targetManager (the global
instance of SDK.SDKModel.TargetManager) over to
SDK.SDKModel.TargetManager.instance(). To keep both TypeScript and
Closure happy we must make a method on the TargetManager class itself,
since it only allows private constructors to be accessed by static
methods on the class.

Bug: 1058320
Change-Id: I6ca35024c21cf24254fd6273138a1ab3e163ee00
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2088092
Commit-Queue: Paul Lewis <[email protected]>
Reviewed-by: Tim van der Lippe <[email protected]>
diff --git a/front_end/profiler/LiveHeapProfileView.js b/front_end/profiler/LiveHeapProfileView.js
index 646a318..035a385 100644
--- a/front_end/profiler/LiveHeapProfileView.js
+++ b/front_end/profiler/LiveHeapProfileView.js
@@ -28,7 +28,7 @@
     this._toggleRecordButton.setToggled(this._setting.get());
     toolbar.appendToolbarItem(this._toggleRecordButton);
 
-    const mainTarget = self.SDK.targetManager.mainTarget();
+    const mainTarget = SDK.SDKModel.TargetManager.instance().mainTarget();
     if (mainTarget && mainTarget.model(SDK.ResourceTreeModel.ResourceTreeModel)) {
       const startWithReloadAction =
           /** @type {!UI.Action.Action }*/ (self.UI.actionRegistry.action('live-heap-profile.start-with-reload'));
@@ -252,7 +252,7 @@
     if (!reload) {
       return;
     }
-    const mainTarget = self.SDK.targetManager.mainTarget();
+    const mainTarget = SDK.SDKModel.TargetManager.instance().mainTarget();
     if (!mainTarget) {
       return;
     }