| Index: third_party/WebKit/Source/devtools/front_end/main/Main.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/main/Main.js b/third_party/WebKit/Source/devtools/front_end/main/Main.js
|
| index 8c8748bfb858a998fbaaa0c822000a21fe0a9695..d924eb8e734d36e999adecce193609f6080707e1 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/main/Main.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/main/Main.js
|
| @@ -308,13 +308,13 @@ WebInspector.Main.prototype = {
|
| WebInspector.RemoteDebuggingTerminatedScreen.show(event.data.reason);
|
| }
|
|
|
| - var targetType = WebInspector.Target.Type.Page;
|
| + var capabilities = WebInspector.Target.Capability.Browser | WebInspector.Target.Capability.JS | WebInspector.Target.Capability.Network | WebInspector.Target.Capability.Worker;
|
| if (Runtime.queryParam("isSharedWorker"))
|
| - targetType = WebInspector.Target.Type.ServiceWorker;
|
| + capabilities = WebInspector.Target.Capability.Network | WebInspector.Target.Capability.Worker;
|
| else if (Runtime.queryParam("v8only"))
|
| - targetType = WebInspector.Target.Type.JSInspector;
|
| + capabilities = WebInspector.Target.Capability.JS;
|
|
|
| - this._mainTarget = WebInspector.targetManager.createTarget(WebInspector.UIString("Main"), targetType, connection, null);
|
| + this._mainTarget = WebInspector.targetManager.createTarget(WebInspector.UIString("Main"), capabilities, connection, null);
|
| console.timeStamp("Main._mainTargetCreated");
|
| this._registerShortcuts();
|
|
|
| @@ -322,8 +322,7 @@ WebInspector.Main.prototype = {
|
| InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.ReloadInspectedPage, this._reloadInspectedPage, this);
|
| InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.EvaluateForTestInFrontend, this._evaluateForTestInFrontend, this);
|
|
|
| - if (this._mainTarget.isServiceWorker() || this._mainTarget.isPage() || this._mainTarget.isJSInspector())
|
| - this._mainTarget.runtimeAgent().run();
|
| + this._mainTarget.runtimeAgent().run();
|
|
|
| this._mainTarget.inspectorAgent().enable();
|
| InspectorFrontendHost.readyForTest();
|
| @@ -711,9 +710,8 @@ WebInspector.Main._reloadPage = function(hard)
|
| {
|
| if (!WebInspector.targetManager.hasTargets())
|
| return;
|
| - if (WebInspector.targetManager.mainTarget().isServiceWorker())
|
| - return;
|
| - WebInspector.targetManager.reloadPage(hard);
|
| + if (WebInspector.targetManager.mainTarget().hasBrowserCapability())
|
| + WebInspector.targetManager.reloadPage(hard);
|
| }
|
|
|
| /**
|
| @@ -726,7 +724,8 @@ WebInspector.Main._addWebSocketTarget = function(ws)
|
| */
|
| function callback(connection)
|
| {
|
| - WebInspector.targetManager.createTarget(ws, WebInspector.Target.Type.Page, connection, null);
|
| + var capabilities = WebInspector.Target.Capability.Browser | WebInspector.Target.Capability.JS | WebInspector.Target.Capability.Network | WebInspector.Target.Capability.Worker;
|
| + WebInspector.targetManager.createTarget(ws, capabilities, connection, null);
|
| }
|
| new WebInspector.WebSocketConnection(ws, callback);
|
| }
|
| @@ -1064,7 +1063,7 @@ WebInspector.BackendSettingsSync = function()
|
| this._disableJavascriptSetting.addChangeListener(this._update, this);
|
| this._blockedEventsWarningSetting = WebInspector.settings.moduleSetting("blockedEventsWarningEnabled");
|
| this._blockedEventsWarningSetting.addChangeListener(this._update, this);
|
| - WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Page);
|
| + WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.Browser);
|
| }
|
|
|
| WebInspector.BackendSettingsSync.prototype = {
|
| @@ -1081,7 +1080,7 @@ WebInspector.BackendSettingsSync.prototype = {
|
|
|
| _update: function()
|
| {
|
| - WebInspector.targetManager.targets(WebInspector.Target.Type.Page).forEach(this._updateTarget, this);
|
| + WebInspector.targetManager.targets(WebInspector.Target.Capability.Browser).forEach(this._updateTarget, this);
|
| },
|
|
|
| /**
|
|
|