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

Side by Side Diff: chrome/renderer/resource_bundle_source_map.h

Issue 234413005: Move most of ChromeV8Context to a base ScriptContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: factor feature_channel out of module_system Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/extensions/v8_schema_registry.cc ('k') | chrome/test/base/module_system_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_RENDERER_RESOURCE_BUNDLE_SOURCE_MAP_H_ 5 #ifndef CHROME_RENDERER_RESOURCE_BUNDLE_SOURCE_MAP_H_
6 #define CHROME_RENDERER_RESOURCE_BUNDLE_SOURCE_MAP_H_ 6 #define CHROME_RENDERER_RESOURCE_BUNDLE_SOURCE_MAP_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/linked_ptr.h" 9 #include "base/memory/linked_ptr.h"
10 #include "base/strings/string_piece.h" 10 #include "base/strings/string_piece.h"
11 #include "chrome/renderer/extensions/module_system.h"
12 #include "chrome/renderer/static_v8_external_string_resource.h" 11 #include "chrome/renderer/static_v8_external_string_resource.h"
12 #include "extensions/renderer/module_system.h"
13 #include "v8/include/v8.h" 13 #include "v8/include/v8.h"
14 14
15 #include <map> 15 #include <map>
16 #include <string> 16 #include <string>
17 17
18 namespace ui { 18 namespace ui {
19 class ResourceBundle; 19 class ResourceBundle;
20 } 20 }
21 21
22 class ResourceBundleSourceMap : public extensions::ModuleSystem::SourceMap { 22 class ResourceBundleSourceMap : public extensions::ModuleSystem::SourceMap {
23 public: 23 public:
24 explicit ResourceBundleSourceMap(const ui::ResourceBundle* resource_bundle); 24 explicit ResourceBundleSourceMap(const ui::ResourceBundle* resource_bundle);
25 virtual ~ResourceBundleSourceMap(); 25 virtual ~ResourceBundleSourceMap();
26 26
27 virtual v8::Handle<v8::Value> GetSource(v8::Isolate* isolate, 27 virtual v8::Handle<v8::Value> GetSource(v8::Isolate* isolate,
28 const std::string& name) OVERRIDE; 28 const std::string& name) OVERRIDE;
29 virtual bool Contains(const std::string& name) OVERRIDE; 29 virtual bool Contains(const std::string& name) OVERRIDE;
30 30
31 void RegisterSource(const std::string& name, int resource_id); 31 void RegisterSource(const std::string& name, int resource_id);
32 32
33 private: 33 private:
34 v8::Handle<v8::String> ConvertString(v8::Isolate* isolate, 34 v8::Handle<v8::String> ConvertString(v8::Isolate* isolate,
35 const base::StringPiece& string); 35 const base::StringPiece& string);
36 36
37 const ui::ResourceBundle* resource_bundle_; 37 const ui::ResourceBundle* resource_bundle_;
38 std::map<std::string, int> resource_id_map_; 38 std::map<std::string, int> resource_id_map_;
39 }; 39 };
40 40
41 #endif // CHROME_RENDERER_RESOURCE_BUNDLE_SOURCE_MAP_H_ 41 #endif // CHROME_RENDERER_RESOURCE_BUNDLE_SOURCE_MAP_H_
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/v8_schema_registry.cc ('k') | chrome/test/base/module_system_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698