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

Unified Diff: chrome/renderer/module_system.h

Issue 9835039: Make app_custom_bindings.js lazily evaluated so it doesn't execute on every page load. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lazy load webstore bindings as well Created 8 years, 9 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/module_system.h
diff --git a/chrome/renderer/module_system.h b/chrome/renderer/module_system.h
index 4a50938650894c068e835bf915288ef6c0127b15..618ce16567139b078d9ff1990ce825572ba3a12e 100644
--- a/chrome/renderer/module_system.h
+++ b/chrome/renderer/module_system.h
@@ -39,6 +39,16 @@ class ModuleSystem : public NativeHandler {
virtual bool Contains(const std::string& name) = 0;
};
+ // Enables native bindings for the duration of its lifetime.
+ class NativesEnabledScope {
+ public:
+ explicit NativesEnabledScope(ModuleSystem* module_system);
+ ~NativesEnabledScope();
+
+ private:
+ ModuleSystem* module_system_;
+ };
+
// |source_map| is a weak pointer.
explicit ModuleSystem(SourceMap* source_map);
virtual ~ModuleSystem();

Powered by Google App Engine
This is Rietveld 408576698