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

Unified Diff: extensions/renderer/module_system.h

Issue 1880473003: Make ModuleSystem have a const view of ResourceBundleSourceMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove double lookups Created 4 years, 8 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 | extensions/renderer/module_system.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/module_system.h
diff --git a/extensions/renderer/module_system.h b/extensions/renderer/module_system.h
index 134d2baa05f2fb3d6da8fd1c079aae56c5c029a2..657118e66823cb4b95824a417d9b8a090b957cac 100644
--- a/extensions/renderer/module_system.h
+++ b/extensions/renderer/module_system.h
@@ -46,8 +46,8 @@ class ModuleSystem : public ObjectBackedNativeHandler,
public:
virtual ~SourceMap() {}
virtual v8::Local<v8::Value> GetSource(v8::Isolate* isolate,
- const std::string& name) = 0;
- virtual bool Contains(const std::string& name) = 0;
+ const std::string& name) const = 0;
+ virtual bool Contains(const std::string& name) const = 0;
};
class ExceptionHandler {
@@ -76,7 +76,7 @@ class ModuleSystem : public ObjectBackedNativeHandler,
};
// |source_map| is a weak pointer.
- ModuleSystem(ScriptContext* context, SourceMap* source_map);
+ ModuleSystem(ScriptContext* context, const SourceMap* source_map);
~ModuleSystem() override;
// Require the specified module. This is the equivalent of calling
@@ -220,7 +220,7 @@ class ModuleSystem : public ObjectBackedNativeHandler,
// A map from module names to the JS source for that module. GetSource()
// performs a lookup on this map.
- SourceMap* source_map_;
+ const SourceMap* const source_map_;
// A map from native handler names to native handlers.
NativeHandlerMap native_handler_map_;
« no previous file with comments | « no previous file | extensions/renderer/module_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698