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

Unified Diff: third_party/WebKit/Source/devtools/front_end/Runtime.js

Issue 2124203002: DevTools: copy protocol files to front-end to fix hosted mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/inspector.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/Runtime.js
diff --git a/third_party/WebKit/Source/devtools/front_end/Runtime.js b/third_party/WebKit/Source/devtools/front_end/Runtime.js
index 2f0b1ee9713e90beb692924aa62af7a8b27d0b35..a1e681fb335bb6848dcae97e927f64116c6244a3 100644
--- a/third_party/WebKit/Source/devtools/front_end/Runtime.js
+++ b/third_party/WebKit/Source/devtools/front_end/Runtime.js
@@ -214,6 +214,30 @@ Runtime._queryParamsObject = { __proto__: null };
Runtime.cachedResources = { __proto__: null };
/**
+ * @param {string} url
+ * @param {boolean} appendSourceURL
+ * @return {!Promise<undefined>}
+ */
+Runtime.loadResourceIntoCache = function(url, appendSourceURL)
+{
+ return loadResourcePromise(url).then(cacheResource.bind(this, url), cacheResource.bind(this, url, undefined));
+
+ /**
+ * @param {string} path
+ * @param {string=} content
+ */
+ function cacheResource(path, content)
+ {
+ if (!content) {
+ console.error("Failed to load resource: " + path);
+ return;
+ }
+ var sourceURL = appendSourceURL ? Runtime.resolveSourceURL(path) : "";
+ Runtime.cachedResources[path] = content + sourceURL;
+ }
+}
+
+/**
* @return {boolean}
*/
Runtime.isReleaseMode = function()
@@ -773,22 +797,9 @@ Runtime.Module.prototype = {
var promises = [];
for (var i = 0; i < resources.length; ++i) {
var url = this._modularizeURL(resources[i]);
- promises.push(loadResourcePromise(url).then(cacheResource.bind(this, url), cacheResource.bind(this, url, undefined)));
+ promises.push(Runtime.loadResourceIntoCache(url, true));
}
return Promise.all(promises).then(undefined);
-
- /**
- * @param {string} path
- * @param {string=} content
- */
- function cacheResource(path, content)
- {
- if (!content) {
- console.error("Failed to load resource: " + path);
- return;
- }
- Runtime.cachedResources[path] = content + Runtime.resolveSourceURL(path);
- }
},
/**
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/inspector.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698