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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 return source_iter->second; | 108 return source_iter->second; |
109 } | 109 } |
110 | 110 |
111 std::string GetModulePrefixForBindingsType(MojoBindingsType bindings_type, | 111 std::string GetModulePrefixForBindingsType(MojoBindingsType bindings_type, |
112 blink::WebLocalFrame* frame) { | 112 blink::WebLocalFrame* frame) { |
113 switch (bindings_type) { | 113 switch (bindings_type) { |
114 case MojoBindingsType::FOR_WEB_UI: | 114 case MojoBindingsType::FOR_WEB_UI: |
115 return frame->GetSecurityOrigin().ToString().Utf8() + "/"; | 115 return frame->GetSecurityOrigin().ToString().Utf8() + "/"; |
116 case MojoBindingsType::FOR_LAYOUT_TESTS: | 116 case MojoBindingsType::FOR_LAYOUT_TESTS: |
117 return "layout-test-mojom://"; | 117 return "layout-test-mojom://"; |
| 118 case MojoBindingsType::FOR_HEADLESS: |
| 119 return "headless-mojom://"; |
118 } | 120 } |
119 NOTREACHED(); | 121 NOTREACHED(); |
120 return ""; | 122 return ""; |
121 } | 123 } |
122 | 124 |
123 } // namespace | 125 } // namespace |
124 | 126 |
125 MojoContextState::MojoContextState(blink::WebLocalFrame* frame, | 127 MojoContextState::MojoContextState(blink::WebLocalFrame* frame, |
126 v8::Local<v8::Context> context, | 128 v8::Local<v8::Context> context, |
127 MojoBindingsType bindings_type) | 129 MojoBindingsType bindings_type) |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 const std::vector<std::string>& dependencies) { | 233 const std::vector<std::string>& dependencies) { |
232 FetchModules(dependencies); | 234 FetchModules(dependencies); |
233 | 235 |
234 gin::ContextHolder* context_holder = runner_->GetContextHolder(); | 236 gin::ContextHolder* context_holder = runner_->GetContextHolder(); |
235 gin::ModuleRegistry* registry = gin::ModuleRegistry::From( | 237 gin::ModuleRegistry* registry = gin::ModuleRegistry::From( |
236 context_holder->context()); | 238 context_holder->context()); |
237 registry->AttemptToLoadMoreModules(context_holder->isolate()); | 239 registry->AttemptToLoadMoreModules(context_holder->isolate()); |
238 } | 240 } |
239 | 241 |
240 } // namespace content | 242 } // namespace content |
OLD | NEW |