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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 } kBuiltinModuleResources[] = { | 64 } kBuiltinModuleResources[] = { |
65 {mojo::kBindingsModuleName, IDR_MOJO_BINDINGS_JS}, | 65 {mojo::kBindingsModuleName, IDR_MOJO_BINDINGS_JS}, |
66 {mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS}, | 66 {mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS}, |
67 {mojo::kCodecModuleName, IDR_MOJO_CODEC_JS}, | 67 {mojo::kCodecModuleName, IDR_MOJO_CODEC_JS}, |
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::kInterfaceEndpointClientModuleName, | |
75 IDR_MOJO_INTERFACE_ENDPOINT_CLIENT_JS}, | |
76 {mojo::kInterfaceEndpointHandleModuleName, | |
77 IDR_MOJO_INTERFACE_ENDPOINT_HANDLE_JS}, | |
78 {mojo::kInterfaceTypesModuleName, IDR_MOJO_INTERFACE_TYPES_JS}, | 74 {mojo::kInterfaceTypesModuleName, IDR_MOJO_INTERFACE_TYPES_JS}, |
79 {mojo::kPipeControlMessageHandlerModuleName, | |
80 IDR_MOJO_PIPE_CONTROL_MESSAGE_HANDLER_JS}, | |
81 {mojo::kPipeControlMessageProxyModuleName, | |
82 IDR_MOJO_PIPE_CONTROL_MESSAGE_PROXY_JS}, | |
83 {mojo::kPipeControlMessagesMojom, | |
84 IDR_MOJO_PIPE_CONTROL_MESSAGES_MOJOM_JS}, | |
85 {mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS}, | 75 {mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS}, |
86 {mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS}, | 76 {mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS}, |
87 {mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS}, | 77 {mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS}, |
88 }; | 78 }; |
89 | 79 |
90 std::unique_ptr<ModuleSourceMap>& module_sources = g_module_sources.Get(); | 80 std::unique_ptr<ModuleSourceMap>& module_sources = g_module_sources.Get(); |
91 if (!module_sources) { | 81 if (!module_sources) { |
92 // Initialize the module source map on first access. | 82 // Initialize the module source map on first access. |
93 module_sources.reset(new ModuleSourceMap); | 83 module_sources.reset(new ModuleSourceMap); |
94 for (size_t i = 0; i < arraysize(kBuiltinModuleResources); ++i) { | 84 for (size_t i = 0; i < arraysize(kBuiltinModuleResources); ++i) { |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 const std::vector<std::string>& dependencies) { | 223 const std::vector<std::string>& dependencies) { |
234 FetchModules(dependencies); | 224 FetchModules(dependencies); |
235 | 225 |
236 gin::ContextHolder* context_holder = runner_->GetContextHolder(); | 226 gin::ContextHolder* context_holder = runner_->GetContextHolder(); |
237 gin::ModuleRegistry* registry = gin::ModuleRegistry::From( | 227 gin::ModuleRegistry* registry = gin::ModuleRegistry::From( |
238 context_holder->context()); | 228 context_holder->context()); |
239 registry->AttemptToLoadMoreModules(context_holder->isolate()); | 229 registry->AttemptToLoadMoreModules(context_holder->isolate()); |
240 } | 230 } |
241 | 231 |
242 } // namespace content | 232 } // namespace content |
OLD | NEW |