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

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

Issue 1219313002: DevTools: support targets that don't have Resource agent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 return result; 100 return result;
101 } 101 }
102 return null; 102 return null;
103 } 103 }
104 104
105 WebInspector.ResourceTreeModel.prototype = { 105 WebInspector.ResourceTreeModel.prototype = {
106 _fetchResourceTree: function() 106 _fetchResourceTree: function()
107 { 107 {
108 /** @type {!Object.<string, !WebInspector.ResourceTreeFrame>} */ 108 /** @type {!Object.<string, !WebInspector.ResourceTreeFrame>} */
109 this._frames = {}; 109 this._frames = {};
110 110 this._cachedResourcesProcessed = false;
111 if (this.target().isDedicatedWorker()) {
112 this._cachedResourcesProcessed = true;
113 return;
114 }
115
116 delete this._cachedResourcesProcessed;
117 this._agent.getResourceTree(this._processCachedResources.bind(this)); 111 this._agent.getResourceTree(this._processCachedResources.bind(this));
118 }, 112 },
119 113
120 _processCachedResources: function(error, mainFramePayload) 114 _processCachedResources: function(error, mainFramePayload)
121 { 115 {
122 if (error) { 116 if (error) {
123 console.error(JSON.stringify(error)); 117 // FIXME: support targets that don't have resourceTreeModel.
pfeldman 2015/07/02 17:28:07 This clearly breaks something :)
yurys 2015/07/02 21:21:26 All the tests are passing and it works fine on usu
118 if (this.target().isPage() || this.target().isServiceWorker())
119 console.error(JSON.stringify(error));
120 this._cachedResourcesProcessed = true;
124 return; 121 return;
125 } 122 }
126 123
127 this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes. WillLoadCachedResources); 124 this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes. WillLoadCachedResources);
128 this._inspectedPageURL = mainFramePayload.frame.url; 125 this._inspectedPageURL = mainFramePayload.frame.url;
129 126
130 // Do not process SW resources. 127 // Do not process SW resources.
131 if (this.target().isPage()) 128 if (this.target().isPage())
132 this._addFramesRecursively(null, mainFramePayload); 129 this._addFramesRecursively(null, mainFramePayload);
133 else 130 else
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 }, 915 },
919 916
920 /** 917 /**
921 * @override 918 * @override
922 */ 919 */
923 interstitialHidden: function() 920 interstitialHidden: function()
924 { 921 {
925 // Frontend is not interested in interstitials. 922 // Frontend is not interested in interstitials.
926 } 923 }
927 } 924 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698