| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 std::map<std::string, scoped_refptr<base::RefCountedMemory>>; | 55 std::map<std::string, scoped_refptr<base::RefCountedMemory>>; |
| 56 | 56 |
| 57 base::LazyInstance<std::unique_ptr<ModuleSourceMap>>::Leaky g_module_sources; | 57 base::LazyInstance<std::unique_ptr<ModuleSourceMap>>::Leaky g_module_sources; |
| 58 | 58 |
| 59 scoped_refptr<base::RefCountedMemory> GetBuiltinModuleData( | 59 scoped_refptr<base::RefCountedMemory> GetBuiltinModuleData( |
| 60 const std::string& path) { | 60 const std::string& path) { |
| 61 static const struct { | 61 static const struct { |
| 62 const char* path; | 62 const char* path; |
| 63 const int id; | 63 const int id; |
| 64 } kBuiltinModuleResources[] = { | 64 } kBuiltinModuleResources[] = { |
| 65 {mojo::kAssociatedBindingsModuleName, IDR_MOJO_ASSOCIATED_BINDINGS_JS}, |
| 65 {mojo::kBindingsModuleName, IDR_MOJO_BINDINGS_JS}, | 66 {mojo::kBindingsModuleName, IDR_MOJO_BINDINGS_JS}, |
| 66 {mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS}, | 67 {mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS}, |
| 67 {mojo::kCodecModuleName, IDR_MOJO_CODEC_JS}, | 68 {mojo::kCodecModuleName, IDR_MOJO_CODEC_JS}, |
| 68 {mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS}, | 69 {mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS}, |
| 69 {mojo::kControlMessageHandlerModuleName, | 70 {mojo::kControlMessageHandlerModuleName, |
| 70 IDR_MOJO_CONTROL_MESSAGE_HANDLER_JS}, | 71 IDR_MOJO_CONTROL_MESSAGE_HANDLER_JS}, |
| 71 {mojo::kControlMessageProxyModuleName, IDR_MOJO_CONTROL_MESSAGE_PROXY_JS}, | 72 {mojo::kControlMessageProxyModuleName, IDR_MOJO_CONTROL_MESSAGE_PROXY_JS}, |
| 72 {mojo::kInterfaceControlMessagesMojom, | 73 {mojo::kInterfaceControlMessagesMojom, |
| 73 IDR_MOJO_INTERFACE_CONTROL_MESSAGES_MOJOM_JS}, | 74 IDR_MOJO_INTERFACE_CONTROL_MESSAGES_MOJOM_JS}, |
| 74 {mojo::kInterfaceEndpointClientModuleName, | 75 {mojo::kInterfaceEndpointClientModuleName, |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 const std::vector<std::string>& dependencies) { | 233 const std::vector<std::string>& dependencies) { |
| 233 FetchModules(dependencies); | 234 FetchModules(dependencies); |
| 234 | 235 |
| 235 gin::ContextHolder* context_holder = runner_->GetContextHolder(); | 236 gin::ContextHolder* context_holder = runner_->GetContextHolder(); |
| 236 gin::ModuleRegistry* registry = gin::ModuleRegistry::From( | 237 gin::ModuleRegistry* registry = gin::ModuleRegistry::From( |
| 237 context_holder->context()); | 238 context_holder->context()); |
| 238 registry->AttemptToLoadMoreModules(context_holder->isolate()); | 239 registry->AttemptToLoadMoreModules(context_holder->isolate()); |
| 239 } | 240 } |
| 240 | 241 |
| 241 } // namespace content | 242 } // namespace content |
| OLD | NEW |