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

Unified Diff: Source/devtools/front_end/Resource.js

Issue 144283012: DevTools: Move the fallback for not loaded resources to NetworkUISourceCodeProvider.js (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix console.assert Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/NetworkUISourceCodeProvider.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/Resource.js
diff --git a/Source/devtools/front_end/Resource.js b/Source/devtools/front_end/Resource.js
index 1d012b7281783013a84e612fc537277bd023147d..01188ed270713b5aed8cd12d7e341f180a11c671 100644
--- a/Source/devtools/front_end/Resource.js
+++ b/Source/devtools/front_end/Resource.js
@@ -267,24 +267,10 @@ WebInspector.Resource.prototype = {
}
if (this.type === WebInspector.resourceTypes.Document) {
- this.requestContent(documentContentLoaded);
+ callback([]);
return;
}
- /**
- * @param {?string} content
- */
- function documentContentLoaded(content)
- {
- if (content === null) {
- callback([]);
- return;
- }
-
- var result = WebInspector.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex);
- callback(result);
- }
-
if (this.frameId)
PageAgent.searchInResource(this.frameId, this.url, query, caseSensitive, isRegex, callbackWrapper);
else
@@ -334,7 +320,7 @@ WebInspector.Resource.prototype = {
function contentLoaded(error, content, contentEncoded)
{
if (error || content === null) {
- loadFallbackContent.call(this, error);
+ replyWithContent.call(this, null, false);
return;
}
replyWithContent.call(this, content, contentEncoded);
@@ -366,43 +352,6 @@ WebInspector.Resource.prototype = {
{
contentLoaded.call(this, error, content, contentEncoded);
}
-
- /**
- * @param {?Protocol.Error} error
- * @this {WebInspector.Resource}
- */
- function loadFallbackContent(error)
- {
- var scripts = WebInspector.debuggerModel.scriptsForSourceURL(this.url);
- if (!scripts.length) {
- console.error("Resource content request failed: " + error);
- replyWithContent.call(this, null, false);
- return;
- }
-
- var contentProvider;
- if (this.type === WebInspector.resourceTypes.Document)
- contentProvider = new WebInspector.ConcatenatedScriptsContentProvider(scripts);
- else if (this.type === WebInspector.resourceTypes.Script)
- contentProvider = scripts[0];
-
- if (!contentProvider) {
- console.error("Resource content request failed: " + error);
- replyWithContent.call(this, null, false);
- return;
- }
-
- contentProvider.requestContent(fallbackContentLoaded.bind(this));
- }
-
- /**
- * @param {?string} content
- * @this {WebInspector.Resource}
- */
- function fallbackContentLoaded(content)
- {
- replyWithContent.call(this, content, false);
- }
if (this.request) {
this.request.requestContent(requestContentLoaded.bind(this));
« no previous file with comments | « Source/devtools/front_end/NetworkUISourceCodeProvider.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698