Chromium Code Reviews| 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..a1b5df99850f4d32b143d55322dc9e0eacb0aaa1 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 caps = WebInspector.Target.Capabilities.BROWSER_DOMAINS | WebInspector.Target.Capabilities.JS_DOMAINS | WebInspector.Target.Capabilities.NETWORK_DOMAINS | WebInspector.Target.Capabilities.WORKER_DOMAINS; |
|
dgozman
2016/07/12 00:34:11
No abbreviations.
eostroukhov-old
2016/07/12 21:46:15
Done.
|
| if (Runtime.queryParam("isSharedWorker")) |
| - targetType = WebInspector.Target.Type.ServiceWorker; |
| + caps = WebInspector.Target.Capabilities.NETWORK_DOMAINS | WebInspector.Target.Capabilities.WORKER_DOMAINS; |
| else if (Runtime.queryParam("v8only")) |
| - targetType = WebInspector.Target.Type.JSInspector; |
| + caps = WebInspector.Target.Capabilities.JS_DOMAINS; |
| - this._mainTarget = WebInspector.targetManager.createTarget(WebInspector.UIString("Main"), targetType, connection, null); |
| + this._mainTarget = WebInspector.targetManager.createTarget(WebInspector.UIString("Main"), caps, 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().hasBrowserDomains()) |
| + 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 caps = WebInspector.Target.Capabilities.BROWSER_DOMAINS | WebInspector.Target.Capabilities.JS_DOMAINS | WebInspector.Target.Capabilities.NETWORK_DOMAINS | WebInspector.Target.Capabilities.WORKER_DOMAINS; |
| + WebInspector.targetManager.createTarget(ws, caps, 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.Capabilities.BROWSER_DOMAINS); |
| } |
| 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.Capabilities.BROWSER_DOMAINS).forEach(this._updateTarget, this); |
| }, |
| /** |