| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 scoped_refptr<base::RefCountedMemory> GetBuiltinModuleData( | 58 scoped_refptr<base::RefCountedMemory> GetBuiltinModuleData( |
| 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 }, | |
| 68 { mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS }, | 67 { mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS }, |
| 69 { mojo::kInterfaceTypesModuleName, IDR_MOJO_INTERFACE_TYPES_JS }, | 68 { mojo::kInterfaceTypesModuleName, IDR_MOJO_INTERFACE_TYPES_JS }, |
| 70 { mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS }, | 69 { mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS }, |
| 71 { mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS }, | 70 { mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS }, |
| 72 { mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS }, | 71 { mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS }, |
| 73 }; | 72 }; |
| 74 | 73 |
| 75 std::unique_ptr<ModuleSourceMap>& module_sources = g_module_sources.Get(); | 74 std::unique_ptr<ModuleSourceMap>& module_sources = g_module_sources.Get(); |
| 76 if (!module_sources) { | 75 if (!module_sources) { |
| 77 // Initialize the module source map on first access. | 76 // Initialize the module source map on first access. |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 const std::vector<std::string>& dependencies) { | 213 const std::vector<std::string>& dependencies) { |
| 215 FetchModules(dependencies); | 214 FetchModules(dependencies); |
| 216 | 215 |
| 217 gin::ContextHolder* context_holder = runner_->GetContextHolder(); | 216 gin::ContextHolder* context_holder = runner_->GetContextHolder(); |
| 218 gin::ModuleRegistry* registry = gin::ModuleRegistry::From( | 217 gin::ModuleRegistry* registry = gin::ModuleRegistry::From( |
| 219 context_holder->context()); | 218 context_holder->context()); |
| 220 registry->AttemptToLoadMoreModules(context_holder->isolate()); | 219 registry->AttemptToLoadMoreModules(context_holder->isolate()); |
| 221 } | 220 } |
| 222 | 221 |
| 223 } // namespace content | 222 } // namespace content |
| OLD | NEW |