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 #include "content/renderer/mojo_context_state.h" | 5 #include "content/renderer/mojo_context_state.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 {mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS}, | 68 {mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS}, |
69 {mojo::kControlMessageHandlerModuleName, | 69 {mojo::kControlMessageHandlerModuleName, |
70 IDR_MOJO_CONTROL_MESSAGE_HANDLER_JS}, | 70 IDR_MOJO_CONTROL_MESSAGE_HANDLER_JS}, |
71 {mojo::kControlMessageProxyModuleName, IDR_MOJO_CONTROL_MESSAGE_PROXY_JS}, | 71 {mojo::kControlMessageProxyModuleName, IDR_MOJO_CONTROL_MESSAGE_PROXY_JS}, |
72 {mojo::kInterfaceControlMessagesMojom, | 72 {mojo::kInterfaceControlMessagesMojom, |
73 IDR_MOJO_INTERFACE_CONTROL_MESSAGES_MOJOM_JS}, | 73 IDR_MOJO_INTERFACE_CONTROL_MESSAGES_MOJOM_JS}, |
74 {mojo::kInterfaceTypesModuleName, IDR_MOJO_INTERFACE_TYPES_JS}, | 74 {mojo::kInterfaceTypesModuleName, IDR_MOJO_INTERFACE_TYPES_JS}, |
75 {mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS}, | 75 {mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS}, |
76 {mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS}, | 76 {mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS}, |
77 {mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS}, | 77 {mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS}, |
| 78 {mojo::kPipeControlMessagesMojom, IDR_MOJO_PIPE_CONTROL_MESSAGES_MOJOM_JS}
, |
| 79 {mojo::kInterfaceEndpointClientModuleName, IDR_MOJO_INTERFACE_ENDPOINT_CLI
ENT_JS}, |
| 80 {mojo::kInterfaceEndpointHandleModuleName, IDR_MOJO_INTERFACE_ENDPOINT_HAN
DLE_JS}, |
| 81 {mojo::kPipeControlMessageHandlerModuleName, IDR_MOJO_PIPE_CONTROL_MESSAGE
_HANDLER_JS}, |
| 82 {mojo::kPipeControlMessageProxyModuleName, IDR_MOJO_PIPE_CONTROL_MESSAGE_P
ROXY_JS}, |
78 }; | 83 }; |
79 | 84 |
80 std::unique_ptr<ModuleSourceMap>& module_sources = g_module_sources.Get(); | 85 std::unique_ptr<ModuleSourceMap>& module_sources = g_module_sources.Get(); |
81 if (!module_sources) { | 86 if (!module_sources) { |
82 // Initialize the module source map on first access. | 87 // Initialize the module source map on first access. |
83 module_sources.reset(new ModuleSourceMap); | 88 module_sources.reset(new ModuleSourceMap); |
84 for (size_t i = 0; i < arraysize(kBuiltinModuleResources); ++i) { | 89 for (size_t i = 0; i < arraysize(kBuiltinModuleResources); ++i) { |
85 const auto& resource = kBuiltinModuleResources[i]; | 90 const auto& resource = kBuiltinModuleResources[i]; |
86 scoped_refptr<base::RefCountedMemory> data = | 91 scoped_refptr<base::RefCountedMemory> data = |
87 GetContentClient()->GetDataResourceBytes(resource.id); | 92 GetContentClient()->GetDataResourceBytes(resource.id); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 const std::vector<std::string>& dependencies) { | 228 const std::vector<std::string>& dependencies) { |
224 FetchModules(dependencies); | 229 FetchModules(dependencies); |
225 | 230 |
226 gin::ContextHolder* context_holder = runner_->GetContextHolder(); | 231 gin::ContextHolder* context_holder = runner_->GetContextHolder(); |
227 gin::ModuleRegistry* registry = gin::ModuleRegistry::From( | 232 gin::ModuleRegistry* registry = gin::ModuleRegistry::From( |
228 context_holder->context()); | 233 context_holder->context()); |
229 registry->AttemptToLoadMoreModules(context_holder->isolate()); | 234 registry->AttemptToLoadMoreModules(context_holder->isolate()); |
230 } | 235 } |
231 | 236 |
232 } // namespace content | 237 } // namespace content |
OLD | NEW |