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

Unified Diff: chrome/renderer/resources/extensions/utils.js

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more progress Created 7 years, 11 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/renderer/resources/extensions/utils.js
diff --git a/chrome/renderer/resources/extensions/utils.js b/chrome/renderer/resources/extensions/utils.js
index 47d827745128bb7e40b2af5baa633957ee25dc21..c9fbb7834819f21a976a2ece1406e725762677f8 100644
--- a/chrome/renderer/resources/extensions/utils.js
+++ b/chrome/renderer/resources/extensions/utils.js
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+var chrome = requireNative('chrome').GetChrome();
not at google - send to devlin 2013/01/24 21:10:12 Just curious: is there a particular reason why you
cduvall 2013/01/24 22:15:15 I think since they are being loaded differently th
+
function forEach(dict, f) {
for (key in dict) {
if (dict.hasOwnProperty(key))
@@ -25,5 +27,11 @@ function lookup(array_of_dictionaries, field, value) {
}
}
+function loadRefDependency(ref) {
+ var parts = ref.split(".");
+ return chrome[parts.slice(0, parts.length - 1).join(".")];
not at google - send to devlin 2013/01/24 21:10:12 So this forces the object to be loaded? What if |r
cduvall 2013/01/24 22:15:15 This will just do nothing if its called for a ref
+}
+
exports.forEach = forEach;
+exports.loadRefDependency = loadRefDependency;
exports.lookup = lookup;

Powered by Google App Engine
This is Rietveld 408576698