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

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

Issue 2610963005: [DevTools] Pass the frame payload (Closed)
Patch Set: [DevTools] Pass the frame payload Created 3 years, 11 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 isInterstitialShowing() { 122 isInterstitialShowing() {
123 return this._isInterstitialShowing; 123 return this._isInterstitialShowing;
124 } 124 }
125 125
126 /** 126 /**
127 * @param {!SDK.ResourceTreeFrame} frame 127 * @param {!SDK.ResourceTreeFrame} frame
128 * @param {boolean=} aboutToNavigate 128 * @param {boolean=} aboutToNavigate
129 */ 129 */
130 _addFrame(frame, aboutToNavigate) { 130 _addFrame(frame, aboutToNavigate) {
131 this._frames.set(frame.id, frame); 131 this._frames.set(frame.id, frame);
132 if (frame.isMainFrame()) { 132 if (frame.isMainFrame())
133 this.mainFrame = frame; 133 this.mainFrame = frame;
134 this._securityOriginManager.setMainSecurityOrigin(frame.url);
135 }
136 this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameAdded, frame ); 134 this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameAdded, frame );
137 if (!aboutToNavigate) 135 if (!aboutToNavigate && frame.securityOrigin)
138 this._securityOriginManager.addSecurityOrigin(frame.securityOrigin); 136 this._securityOriginManager.addSecurityOrigin(frame.securityOrigin, frame. isMainFrame());
139 } 137 }
140 138
141 /** 139 /**
142 * @param {!SDK.ResourceTreeFrame} mainFrame 140 * @param {!SDK.ResourceTreeFrame} mainFrame
143 */ 141 */
144 _handleMainFrameDetached(mainFrame) { 142 _handleMainFrameDetached(mainFrame) {
145 /** 143 /**
146 * @param {!SDK.ResourceTreeFrame} frame 144 * @param {!SDK.ResourceTreeFrame} frame
147 * @this {SDK.ResourceTreeModel} 145 * @this {SDK.ResourceTreeModel}
148 */ 146 */
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 frame._navigate(framePayload); 197 frame._navigate(framePayload);
200 var addedOrigin = frame.securityOrigin; 198 var addedOrigin = frame.securityOrigin;
201 199
202 this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameNavigated, f rame); 200 this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameNavigated, f rame);
203 if (frame.isMainFrame()) { 201 if (frame.isMainFrame()) {
204 this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.MainFrameNaviga ted, frame); 202 this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.MainFrameNaviga ted, frame);
205 if (Common.moduleSetting('preserveConsoleLog').get()) 203 if (Common.moduleSetting('preserveConsoleLog').get())
206 Common.console.log(Common.UIString('Navigated to %s', frame.url)); 204 Common.console.log(Common.UIString('Navigated to %s', frame.url));
207 } 205 }
208 if (addedOrigin) 206 if (addedOrigin)
209 this._securityOriginManager.addSecurityOrigin(addedOrigin); 207 this._securityOriginManager.addSecurityOrigin(addedOrigin, frame.isMainFra me());
210 208
211 // Fill frame with retained resources (the ones loaded using new loader). 209 // Fill frame with retained resources (the ones loaded using new loader).
212 var resources = frame.resources(); 210 var resources = frame.resources();
213 for (var i = 0; i < resources.length; ++i) 211 for (var i = 0; i < resources.length; ++i)
214 this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.ResourceAdded, resources[i]); 212 this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.ResourceAdded, resources[i]);
215 213
216 if (frame.isMainFrame()) 214 if (frame.isMainFrame())
217 this.target().setInspectedURL(frame.url); 215 this.target().setInspectedURL(frame.url);
218 } 216 }
219 217
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event s.InterstitialHidden); 891 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event s.InterstitialHidden);
894 } 892 }
895 893
896 /** 894 /**
897 * @override 895 * @override
898 */ 896 */
899 navigationRequested() { 897 navigationRequested() {
900 // Frontend is not interested in when navigations are requested. 898 // Frontend is not interested in when navigations are requested.
901 } 899 }
902 }; 900 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698