| OLD | NEW |
| 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 return; | 224 return; |
| 225 | 225 |
| 226 if (frame.parentFrame) | 226 if (frame.parentFrame) |
| 227 frame.parentFrame._removeChildFrame(frame); | 227 frame.parentFrame._removeChildFrame(frame); |
| 228 else | 228 else |
| 229 frame._remove(); | 229 frame._remove(); |
| 230 this._updateSecurityOrigins(); | 230 this._updateSecurityOrigins(); |
| 231 } | 231 } |
| 232 | 232 |
| 233 /** | 233 /** |
| 234 * @param {!Protocol.Page.FrameId} frameId | |
| 235 */ | |
| 236 _frameStartedLoading(frameId) { | |
| 237 // Do nothing unless cached resource tree is processed - it will overwrite e
verything. | |
| 238 if (!this._cachedResourcesProcessed) | |
| 239 return; | |
| 240 | |
| 241 var frame = this._frames.get(frameId); | |
| 242 if (!frame || frame.isMainFrame()) | |
| 243 this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.MainFrameStarte
dLoading); | |
| 244 } | |
| 245 | |
| 246 /** | |
| 247 * @param {!Common.Event} event | 234 * @param {!Common.Event} event |
| 248 */ | 235 */ |
| 249 _onRequestFinished(event) { | 236 _onRequestFinished(event) { |
| 250 if (!this._cachedResourcesProcessed) | 237 if (!this._cachedResourcesProcessed) |
| 251 return; | 238 return; |
| 252 | 239 |
| 253 var request = /** @type {!SDK.NetworkRequest} */ (event.data); | 240 var request = /** @type {!SDK.NetworkRequest} */ (event.data); |
| 254 if (request.failed || request.resourceType() === Common.resourceTypes.XHR) | 241 if (request.failed || request.resourceType() === Common.resourceTypes.XHR) |
| 255 return; | 242 return; |
| 256 | 243 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 SDK.SDKModel.register(SDK.ResourceTreeModel, SDK.Target.Capability.DOM, true); | 471 SDK.SDKModel.register(SDK.ResourceTreeModel, SDK.Target.Capability.DOM, true); |
| 485 | 472 |
| 486 /** @enum {symbol} */ | 473 /** @enum {symbol} */ |
| 487 SDK.ResourceTreeModel.Events = { | 474 SDK.ResourceTreeModel.Events = { |
| 488 FrameAdded: Symbol('FrameAdded'), | 475 FrameAdded: Symbol('FrameAdded'), |
| 489 FrameNavigated: Symbol('FrameNavigated'), | 476 FrameNavigated: Symbol('FrameNavigated'), |
| 490 FrameDetached: Symbol('FrameDetached'), | 477 FrameDetached: Symbol('FrameDetached'), |
| 491 FrameResized: Symbol('FrameResized'), | 478 FrameResized: Symbol('FrameResized'), |
| 492 FrameWillNavigate: Symbol('FrameWillNavigate'), | 479 FrameWillNavigate: Symbol('FrameWillNavigate'), |
| 493 MainFrameNavigated: Symbol('MainFrameNavigated'), | 480 MainFrameNavigated: Symbol('MainFrameNavigated'), |
| 494 MainFrameStartedLoading: Symbol('MainFrameStartedLoading'), | |
| 495 ResourceAdded: Symbol('ResourceAdded'), | 481 ResourceAdded: Symbol('ResourceAdded'), |
| 496 WillLoadCachedResources: Symbol('WillLoadCachedResources'), | 482 WillLoadCachedResources: Symbol('WillLoadCachedResources'), |
| 497 CachedResourcesLoaded: Symbol('CachedResourcesLoaded'), | 483 CachedResourcesLoaded: Symbol('CachedResourcesLoaded'), |
| 498 DOMContentLoaded: Symbol('DOMContentLoaded'), | 484 DOMContentLoaded: Symbol('DOMContentLoaded'), |
| 499 Load: Symbol('Load'), | 485 Load: Symbol('Load'), |
| 500 PageReloadRequested: Symbol('PageReloadRequested'), | 486 PageReloadRequested: Symbol('PageReloadRequested'), |
| 501 WillReloadPage: Symbol('WillReloadPage'), | 487 WillReloadPage: Symbol('WillReloadPage'), |
| 502 InterstitialShown: Symbol('InterstitialShown'), | 488 InterstitialShown: Symbol('InterstitialShown'), |
| 503 InterstitialHidden: Symbol('InterstitialHidden') | 489 InterstitialHidden: Symbol('InterstitialHidden') |
| 504 }; | 490 }; |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 */ | 792 */ |
| 807 frameDetached(frameId) { | 793 frameDetached(frameId) { |
| 808 this._resourceTreeModel._frameDetached(frameId); | 794 this._resourceTreeModel._frameDetached(frameId); |
| 809 } | 795 } |
| 810 | 796 |
| 811 /** | 797 /** |
| 812 * @override | 798 * @override |
| 813 * @param {!Protocol.Page.FrameId} frameId | 799 * @param {!Protocol.Page.FrameId} frameId |
| 814 */ | 800 */ |
| 815 frameStartedLoading(frameId) { | 801 frameStartedLoading(frameId) { |
| 816 this._resourceTreeModel._frameStartedLoading(frameId); | |
| 817 } | 802 } |
| 818 | 803 |
| 819 /** | 804 /** |
| 820 * @override | 805 * @override |
| 821 * @param {!Protocol.Page.FrameId} frameId | 806 * @param {!Protocol.Page.FrameId} frameId |
| 822 */ | 807 */ |
| 823 frameStoppedLoading(frameId) { | 808 frameStoppedLoading(frameId) { |
| 824 } | 809 } |
| 825 | 810 |
| 826 /** | 811 /** |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event
s.InterstitialHidden); | 877 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event
s.InterstitialHidden); |
| 893 } | 878 } |
| 894 | 879 |
| 895 /** | 880 /** |
| 896 * @override | 881 * @override |
| 897 */ | 882 */ |
| 898 navigationRequested() { | 883 navigationRequested() { |
| 899 // Frontend is not interested in when navigations are requested. | 884 // Frontend is not interested in when navigations are requested. |
| 900 } | 885 } |
| 901 }; | 886 }; |
| OLD | NEW |