OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_RENDERER_MOJO_CONTEXT_STATE_H_ | 5 #ifndef CONTENT_RENDERER_MOJO_CONTEXT_STATE_H_ |
6 #define CONTENT_RENDERER_MOJO_CONTEXT_STATE_H_ | 6 #define CONTENT_RENDERER_MOJO_CONTEXT_STATE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 namespace gin { | 22 namespace gin { |
23 class ContextHolder; | 23 class ContextHolder; |
24 struct PendingModule; | 24 struct PendingModule; |
25 } | 25 } |
26 | 26 |
27 namespace content { | 27 namespace content { |
28 | 28 |
29 class ResourceFetcher; | 29 class ResourceFetcher; |
30 class MojoMainRunner; | 30 class MojoMainRunner; |
| 31 enum class MojoBindingsType; |
31 | 32 |
32 // MojoContextState manages the modules needed for mojo bindings. It does this | 33 // MojoContextState manages the modules needed for mojo bindings. It does this |
33 // by way of gin. Non-builtin modules are downloaded by way of ResourceFetchers. | 34 // by way of gin. Non-builtin modules are downloaded by way of ResourceFetchers. |
34 class MojoContextState : public gin::ModuleRegistryObserver { | 35 class MojoContextState : public gin::ModuleRegistryObserver { |
35 public: | 36 public: |
36 MojoContextState(blink::WebFrame* frame, | 37 MojoContextState(blink::WebFrame* frame, |
37 v8::Local<v8::Context> context, | 38 v8::Local<v8::Context> context, |
38 bool for_layout_tests); | 39 MojoBindingsType bindings_type); |
39 ~MojoContextState() override; | 40 ~MojoContextState() override; |
40 | 41 |
41 void Run(); | 42 void Run(); |
42 | 43 |
43 // Returns true if at least one module was added. | 44 // Returns true if at least one module was added. |
44 bool module_added() const { return module_added_; } | 45 bool module_added() const { return module_added_; } |
45 | 46 |
46 private: | 47 private: |
47 class Loader; | 48 class Loader; |
48 | 49 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 82 |
82 // The prefix to use for all module requests. | 83 // The prefix to use for all module requests. |
83 const std::string module_prefix_; | 84 const std::string module_prefix_; |
84 | 85 |
85 DISALLOW_COPY_AND_ASSIGN(MojoContextState); | 86 DISALLOW_COPY_AND_ASSIGN(MojoContextState); |
86 }; | 87 }; |
87 | 88 |
88 } // namespace content | 89 } // namespace content |
89 | 90 |
90 #endif // CONTENT_RENDERER_MOJO_CONTEXT_STATE_H_ | 91 #endif // CONTENT_RENDERER_MOJO_CONTEXT_STATE_H_ |
OLD | NEW |