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

Unified Diff: chrome/browser/resources/chromeos/chromevox/chromevox/background/injected_script_loader.js

Issue 924083004: Shorten Closure template notation from Array.<*> to Array<*> in cvox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: chrome/browser/resources/chromeos/chromevox/chromevox/background/injected_script_loader.js
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/injected_script_loader.js b/chrome/browser/resources/chromeos/chromevox/chromevox/background/injected_script_loader.js
index f36f9907693ba3e0a33714ee1449142d262f7bae..1cb54c8760cbb22bbad631daa9ff0aaacc018069 100644
--- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/injected_script_loader.js
+++ b/chrome/browser/resources/chromeos/chromevox/chromevox/background/injected_script_loader.js
@@ -17,8 +17,8 @@ cvox.InjectedScriptLoader = function() { };
/**
* Loads a dictionary of file contents for Javascript files.
- * @param {Array.<string>} files A list of file names.
- * @param {function(Object.<string,string>)} done A function called when all
+ * @param {Array<string>} files A list of file names.
+ * @param {function(Object<string,string>)} done A function called when all
* the files have been loaded. Called with the code map as the first
* parameter.
*/
@@ -27,32 +27,32 @@ cvox.InjectedScriptLoader.fetchCode = function(files, done) {
var waiting = files.length;
var startTime = new Date();
var loadScriptAsCode = function(src) {
- // Load the script by fetching its source and running 'eval' on it
- // directly, with a magic comment that makes Chrome treat it like it
- // loaded normally. Wait until it's fetched before loading the
- // next script.
- var xhr = new XMLHttpRequest();
- var url = chrome.extension.getURL(src) + '?' + new Date().getTime();
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- var scriptText = xhr.responseText;
- // Add a magic comment to the bottom of the file so that
- // Chrome knows the name of the script in the JavaScript debugger.
- var debugSrc = src.replace('closure/../', '');
- // The 'chromevox' id is only used in the DevTools instead of a long
- // extension id.
- scriptText += '\n//# sourceURL= chrome-extension://chromevox/' +
- debugSrc + '\n';
- code[src] = scriptText;
- waiting--;
- if (waiting == 0) {
- done(code);
- }
+ // Load the script by fetching its source and running 'eval' on it
+ // directly, with a magic comment that makes Chrome treat it like it
+ // loaded normally. Wait until it's fetched before loading the
+ // next script.
+ var xhr = new XMLHttpRequest();
+ var url = chrome.extension.getURL(src) + '?' + new Date().getTime();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4) {
+ var scriptText = xhr.responseText;
+ // Add a magic comment to the bottom of the file so that
+ // Chrome knows the name of the script in the JavaScript debugger.
+ var debugSrc = src.replace('closure/../', '');
+ // The 'chromevox' id is only used in the DevTools instead of a long
+ // extension id.
+ scriptText += '\n//# sourceURL= chrome-extension://chromevox/' +
+ debugSrc + '\n';
+ code[src] = scriptText;
+ waiting--;
+ if (waiting == 0) {
+ done(code);
}
- };
- xhr.open('GET', url);
- xhr.send(null);
- }
+ }
+ };
+ xhr.open('GET', url);
+ xhr.send(null);
+ };
files.forEach(function(f) { loadScriptAsCode(f); });
};

Powered by Google App Engine
This is Rietveld 408576698