Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js

Issue 2851913002: [DevTools] Do not expose agents on Target
Patch Set: storage and tests.js Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 this.baseURL = payload.baseURL || ''; 1047 this.baseURL = payload.baseURL || '';
1048 } 1048 }
1049 }; 1049 };
1050 1050
1051 /** 1051 /**
1052 * @unrestricted 1052 * @unrestricted
1053 */ 1053 */
1054 SDK.DOMModel = class extends SDK.SDKModel { 1054 SDK.DOMModel = class extends SDK.SDKModel {
1055 /** 1055 /**
1056 * @param {!SDK.Target} target 1056 * @param {!SDK.Target} target
1057 * @param {!Protocol.Dispatcher} dispatcher
1057 */ 1058 */
1058 constructor(target) { 1059 constructor(target, dispatcher) {
1059 super(target); 1060 super(target, dispatcher);
1060 1061
1061 this._agent = target.domAgent(); 1062 this._agent = dispatcher.domAgent();
1062 1063
1063 /** @type {!Object.<number, !SDK.DOMNode>} */ 1064 /** @type {!Object.<number, !SDK.DOMNode>} */
1064 this._idToDOMNode = {}; 1065 this._idToDOMNode = {};
1065 /** @type {?SDK.DOMDocument} */ 1066 /** @type {?SDK.DOMDocument} */
1066 this._document = null; 1067 this._document = null;
1067 /** @type {!Object.<number, boolean>} */ 1068 /** @type {!Object.<number, boolean>} */
1068 this._attributeLoadNodeIds = {}; 1069 this._attributeLoadNodeIds = {};
1069 target.registerDOMDispatcher(new SDK.DOMDispatcher(this)); 1070 dispatcher.registerDOMDispatcher(new SDK.DOMDispatcher(this));
1070 1071
1071 this._runtimeModel = /** @type {!SDK.RuntimeModel} */ (target.model(SDK.Runt imeModel)); 1072 this._runtimeModel = /** @type {!SDK.RuntimeModel} */ (target.model(SDK.Runt imeModel));
1072 1073
1073 this._agent.enable(); 1074 this._agent.enable();
1074 } 1075 }
1075 1076
1076 /** 1077 /**
1077 * @return {!SDK.RuntimeModel} 1078 * @return {!SDK.RuntimeModel}
1078 */ 1079 */
1079 runtimeModel() { 1080 runtimeModel() {
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
1911 1912
1912 /** 1913 /**
1913 * @override 1914 * @override
1914 * @param {!Protocol.DOM.NodeId} insertionPointId 1915 * @param {!Protocol.DOM.NodeId} insertionPointId
1915 * @param {!Array.<!Protocol.DOM.BackendNode>} distributedNodes 1916 * @param {!Array.<!Protocol.DOM.BackendNode>} distributedNodes
1916 */ 1917 */
1917 distributedNodesUpdated(insertionPointId, distributedNodes) { 1918 distributedNodesUpdated(insertionPointId, distributedNodes) {
1918 this._domModel._distributedNodesUpdated(insertionPointId, distributedNodes); 1919 this._domModel._distributedNodesUpdated(insertionPointId, distributedNodes);
1919 } 1920 }
1920 }; 1921 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698