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://"; | |
120 } | 118 } |
121 NOTREACHED(); | 119 NOTREACHED(); |
122 return ""; | 120 return ""; |
123 } | 121 } |
124 | 122 |
125 } // namespace | 123 } // namespace |
126 | 124 |
127 MojoContextState::MojoContextState(blink::WebLocalFrame* frame, | 125 MojoContextState::MojoContextState(blink::WebLocalFrame* frame, |
128 v8::Local<v8::Context> context, | 126 v8::Local<v8::Context> context, |
129 MojoBindingsType bindings_type) | 127 MojoBindingsType bindings_type) |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 const std::vector<std::string>& dependencies) { | 231 const std::vector<std::string>& dependencies) { |
234 FetchModules(dependencies); | 232 FetchModules(dependencies); |
235 | 233 |
236 gin::ContextHolder* context_holder = runner_->GetContextHolder(); | 234 gin::ContextHolder* context_holder = runner_->GetContextHolder(); |
237 gin::ModuleRegistry* registry = gin::ModuleRegistry::From( | 235 gin::ModuleRegistry* registry = gin::ModuleRegistry::From( |
238 context_holder->context()); | 236 context_holder->context()); |
239 registry->AttemptToLoadMoreModules(context_holder->isolate()); | 237 registry->AttemptToLoadMoreModules(context_holder->isolate()); |
240 } | 238 } |
241 | 239 |
242 } // namespace content | 240 } // namespace content |
OLD | NEW |