OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /** | 7 /** |
8 * @constructor | 8 * @constructor |
9 * @extends {Protocol.Agents} | 9 * @extends {Protocol.Agents} |
10 * @param {!InspectorBackendClass.Connection} connection | 10 * @param {!InspectorBackendClass.Connection} connection |
(...skipping 19 matching lines...) Expand all Loading... |
30 callback(); | 30 callback(); |
31 }, | 31 }, |
32 | 32 |
33 /** | 33 /** |
34 * @param {function(!WebInspector.Target)=} callback | 34 * @param {function(!WebInspector.Target)=} callback |
35 */ | 35 */ |
36 _loadedWithCapabilities: function(callback) | 36 _loadedWithCapabilities: function(callback) |
37 { | 37 { |
38 this.consoleModel = new WebInspector.ConsoleModel(this); | 38 this.consoleModel = new WebInspector.ConsoleModel(this); |
39 //This and similar lines are needed for compatibility | 39 //This and similar lines are needed for compatibility |
40 WebInspector.console = this.consoleModel; | 40 if (!WebInspector.console) |
| 41 WebInspector.console = this.consoleModel; |
| 42 |
41 this.networkManager = new WebInspector.NetworkManager(this); | 43 this.networkManager = new WebInspector.NetworkManager(this); |
42 WebInspector.networkManager = this.networkManager; | 44 if (!WebInspector.networkManager) |
| 45 WebInspector.networkManager = this.networkManager; |
| 46 |
43 this.resourceTreeModel = new WebInspector.ResourceTreeModel(this); | 47 this.resourceTreeModel = new WebInspector.ResourceTreeModel(this); |
44 WebInspector.resourceTreeModel = this.resourceTreeModel; | 48 if (!WebInspector.resourceTreeModel) |
| 49 WebInspector.resourceTreeModel = this.resourceTreeModel; |
| 50 |
45 this.debuggerModel = new WebInspector.DebuggerModel(this); | 51 this.debuggerModel = new WebInspector.DebuggerModel(this); |
46 WebInspector.debuggerModel = this.debuggerModel; | 52 if (!WebInspector.debuggerModel) |
| 53 WebInspector.debuggerModel = this.debuggerModel; |
| 54 |
47 this.runtimeModel = new WebInspector.RuntimeModel(this); | 55 this.runtimeModel = new WebInspector.RuntimeModel(this); |
48 WebInspector.runtimeModel = this.runtimeModel; | 56 if (!WebInspector.runtimeModel) |
| 57 WebInspector.runtimeModel = this.runtimeModel; |
49 | 58 |
50 //we can't name it domAgent, because it clashes with function, WebInspec
tor.DOMAgent should be renamed to DOMModel | 59 //we can't name it domAgent, because it clashes with function, WebInspec
tor.DOMAgent should be renamed to DOMModel |
51 this.domModel = new WebInspector.DOMAgent(); | 60 this.domModel = new WebInspector.DOMAgent(); |
52 WebInspector.domAgent = this.domModel; | 61 if (!WebInspector.domAgent) |
| 62 WebInspector.domAgent = this.domModel; |
| 63 |
53 this.workerManager = new WebInspector.WorkerManager(this.isMainFrontend)
; | 64 this.workerManager = new WebInspector.WorkerManager(this.isMainFrontend)
; |
54 WebInspector.workerManager = this.workerManager; | 65 if (!WebInspector.workerManager) |
| 66 WebInspector.workerManager = this.workerManager; |
55 | 67 |
56 if (callback) | 68 if (callback) |
57 callback(this); | 69 callback(this); |
58 }, | 70 }, |
59 | 71 |
60 /** | 72 /** |
61 * @override | 73 * @override |
62 * @param {string} domain | 74 * @param {string} domain |
63 * @param {!Object} dispatcher | 75 * @param {!Object} dispatcher |
64 */ | 76 */ |
(...skipping 28 matching lines...) Expand all Loading... |
93 * @param {!InspectorBackendClass.Connection} connection | 105 * @param {!InspectorBackendClass.Connection} connection |
94 * @param {function(!WebInspector.Target)=} callback | 106 * @param {function(!WebInspector.Target)=} callback |
95 */ | 107 */ |
96 createTarget: function(connection, callback) | 108 createTarget: function(connection, callback) |
97 { | 109 { |
98 var newTarget = new WebInspector.Target(connection, callback); | 110 var newTarget = new WebInspector.Target(connection, callback); |
99 this._targets.push(newTarget); | 111 this._targets.push(newTarget); |
100 } | 112 } |
101 | 113 |
102 } | 114 } |
OLD | NEW |