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

Side by Side Diff: extensions/renderer/string_source_map.h

Issue 2586303002: [Extensions Bindings] Pull out test resources (Closed)
Patch Set: comment Created 3 years, 12 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
« no previous file with comments | « extensions/renderer/module_system_test.cc ('k') | extensions/renderer/string_source_map.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef EXTENSIONS_RENDERER_STRING_SOURCE_MAP_H_
6 #define EXTENSIONS_RENDERER_STRING_SOURCE_MAP_H_
7
8 #include <map>
9 #include <string>
10
11 #include "base/macros.h"
12 #include "extensions/renderer/source_map.h"
13
14 namespace extensions {
15
16 // A testing implementation of the source map that takes strings for source
17 // contents.
18 class StringSourceMap : public SourceMap {
19 public:
20 StringSourceMap();
21 ~StringSourceMap() override;
22
23 // Adds a new string to be used in the source map.
24 void RegisterModule(const std::string& name, const std::string& source);
25
26 // SourceMap:
27 v8::Local<v8::String> GetSource(v8::Isolate* isolate,
28 const std::string& name) const override;
29 bool Contains(const std::string& name) const override;
30
31 private:
32 std::map<std::string, std::string> sources_;
33
34 DISALLOW_COPY_AND_ASSIGN(StringSourceMap);
35 };
36
37 } // namespace extensions
38
39 #endif // EXTENSIONS_RENDERER_STRING_SOURCE_MAP_H_
OLDNEW
« no previous file with comments | « extensions/renderer/module_system_test.cc ('k') | extensions/renderer/string_source_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698