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

Unified Diff: third_party/WebKit/Source/devtools/front_end/host/ResourceLoader.js

Issue 2493373002: DevTools: rename WebInspector into modules. (Closed)
Patch Set: for bots Created 4 years, 1 month 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
Index: third_party/WebKit/Source/devtools/front_end/host/ResourceLoader.js
diff --git a/third_party/WebKit/Source/devtools/front_end/host/ResourceLoader.js b/third_party/WebKit/Source/devtools/front_end/host/ResourceLoader.js
index 309263f92e7d91c73dfaf1ca405de16288b88e8f..0cb90e6504d2e0a6a775ce050615e4bfeeb8c011 100644
--- a/third_party/WebKit/Source/devtools/front_end/host/ResourceLoader.js
+++ b/third_party/WebKit/Source/devtools/front_end/host/ResourceLoader.js
@@ -1,35 +1,35 @@
// Copyright (c) 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-WebInspector.ResourceLoader = {};
+Host.ResourceLoader = {};
-WebInspector.ResourceLoader._lastStreamId = 0;
-/** @type {!Object.<number, !WebInspector.OutputStream>} */
-WebInspector.ResourceLoader._boundStreams = {};
+Host.ResourceLoader._lastStreamId = 0;
+/** @type {!Object.<number, !Common.OutputStream>} */
+Host.ResourceLoader._boundStreams = {};
/**
- * @param {!WebInspector.OutputStream} stream
+ * @param {!Common.OutputStream} stream
* @return {number}
*/
-WebInspector.ResourceLoader._bindOutputStream = function(stream) {
- WebInspector.ResourceLoader._boundStreams[++WebInspector.ResourceLoader._lastStreamId] = stream;
- return WebInspector.ResourceLoader._lastStreamId;
+Host.ResourceLoader._bindOutputStream = function(stream) {
+ Host.ResourceLoader._boundStreams[++Host.ResourceLoader._lastStreamId] = stream;
+ return Host.ResourceLoader._lastStreamId;
};
/**
* @param {number} id
*/
-WebInspector.ResourceLoader._discardOutputStream = function(id) {
- WebInspector.ResourceLoader._boundStreams[id].close();
- delete WebInspector.ResourceLoader._boundStreams[id];
+Host.ResourceLoader._discardOutputStream = function(id) {
+ Host.ResourceLoader._boundStreams[id].close();
+ delete Host.ResourceLoader._boundStreams[id];
};
/**
* @param {number} id
* @param {string} chunk
*/
-WebInspector.ResourceLoader.streamWrite = function(id, chunk) {
- WebInspector.ResourceLoader._boundStreams[id].write(chunk);
+Host.ResourceLoader.streamWrite = function(id, chunk) {
+ Host.ResourceLoader._boundStreams[id].write(chunk);
};
/**
@@ -37,9 +37,9 @@ WebInspector.ResourceLoader.streamWrite = function(id, chunk) {
* @param {?Object.<string, string>} headers
* @param {function(number, !Object.<string, string>, string)} callback
*/
-WebInspector.ResourceLoader.load = function(url, headers, callback) {
- var stream = new WebInspector.StringOutputStream();
- WebInspector.ResourceLoader.loadAsStream(url, headers, stream, mycallback);
+Host.ResourceLoader.load = function(url, headers, callback) {
+ var stream = new Common.StringOutputStream();
+ Host.ResourceLoader.loadAsStream(url, headers, stream, mycallback);
/**
* @param {number} statusCode
@@ -53,12 +53,12 @@ WebInspector.ResourceLoader.load = function(url, headers, callback) {
/**
* @param {string} url
* @param {?Object.<string, string>} headers
- * @param {!WebInspector.OutputStream} stream
+ * @param {!Common.OutputStream} stream
* @param {function(number, !Object.<string, string>)=} callback
*/
-WebInspector.ResourceLoader.loadAsStream = function(url, headers, stream, callback) {
- var streamId = WebInspector.ResourceLoader._bindOutputStream(stream);
- var parsedURL = new WebInspector.ParsedURL(url);
+Host.ResourceLoader.loadAsStream = function(url, headers, stream, callback) {
+ var streamId = Host.ResourceLoader._bindOutputStream(stream);
+ var parsedURL = new Common.ParsedURL(url);
if (parsedURL.isDataURL()) {
loadXHR(url).then(dataURLDecodeSuccessful).catch(dataURLDecodeFailed);
return;
@@ -77,14 +77,14 @@ WebInspector.ResourceLoader.loadAsStream = function(url, headers, stream, callba
function finishedCallback(response) {
if (callback)
callback(response.statusCode, response.headers || {});
- WebInspector.ResourceLoader._discardOutputStream(streamId);
+ Host.ResourceLoader._discardOutputStream(streamId);
}
/**
* @param {string} text
*/
function dataURLDecodeSuccessful(text) {
- WebInspector.ResourceLoader.streamWrite(streamId, text);
+ Host.ResourceLoader.streamWrite(streamId, text);
finishedCallback(/** @type {!InspectorFrontendHostAPI.LoadNetworkResourceResult} */ ({statusCode: 200}));
}

Powered by Google App Engine
This is Rietveld 408576698