| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 const std::string& path) { | 59 const std::string& path) { |
| 60 static const struct { | 60 static const struct { |
| 61 const char* path; | 61 const char* path; |
| 62 const int id; | 62 const int id; |
| 63 } kBuiltinModuleResources[] = { | 63 } kBuiltinModuleResources[] = { |
| 64 { mojo::kBindingsModuleName, IDR_MOJO_BINDINGS_JS }, | 64 { mojo::kBindingsModuleName, IDR_MOJO_BINDINGS_JS }, |
| 65 { mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS }, | 65 { mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS }, |
| 66 { mojo::kCodecModuleName, IDR_MOJO_CODEC_JS }, | 66 { mojo::kCodecModuleName, IDR_MOJO_CODEC_JS }, |
| 67 { mojo::kConnectionModuleName, IDR_MOJO_CONNECTION_JS }, | 67 { mojo::kConnectionModuleName, IDR_MOJO_CONNECTION_JS }, |
| 68 { mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS }, | 68 { mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS }, |
| 69 { mojo::kInterfaceTypesModuleName, IDR_MOJO_INTERFACE_TYPES_JS }, |
| 69 { mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS }, | 70 { mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS }, |
| 70 { mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS }, | 71 { mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS }, |
| 71 { mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS }, | 72 { mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS }, |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 std::unique_ptr<ModuleSourceMap>& module_sources = g_module_sources.Get(); | 75 std::unique_ptr<ModuleSourceMap>& module_sources = g_module_sources.Get(); |
| 75 if (!module_sources) { | 76 if (!module_sources) { |
| 76 // Initialize the module source map on first access. | 77 // Initialize the module source map on first access. |
| 77 module_sources.reset(new ModuleSourceMap); | 78 module_sources.reset(new ModuleSourceMap); |
| 78 for (size_t i = 0; i < arraysize(kBuiltinModuleResources); ++i) { | 79 for (size_t i = 0; i < arraysize(kBuiltinModuleResources); ++i) { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 const std::vector<std::string>& dependencies) { | 214 const std::vector<std::string>& dependencies) { |
| 214 FetchModules(dependencies); | 215 FetchModules(dependencies); |
| 215 | 216 |
| 216 gin::ContextHolder* context_holder = runner_->GetContextHolder(); | 217 gin::ContextHolder* context_holder = runner_->GetContextHolder(); |
| 217 gin::ModuleRegistry* registry = gin::ModuleRegistry::From( | 218 gin::ModuleRegistry* registry = gin::ModuleRegistry::From( |
| 218 context_holder->context()); | 219 context_holder->context()); |
| 219 registry->AttemptToLoadMoreModules(context_holder->isolate()); | 220 registry->AttemptToLoadMoreModules(context_holder->isolate()); |
| 220 } | 221 } |
| 221 | 222 |
| 222 } // namespace content | 223 } // namespace content |
| OLD | NEW |