Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(647)

Side by Side Diff: content/shell/renderer/layout_test/interface_registry_js_wrapper.cc

Issue 2405093003: [WIP] Mojo native bindings interface.
Patch Set: fixes webui tests Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/shell/BUILD.gn ('k') | extensions/renderer/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/shell/renderer/layout_test/interface_registry_js_wrapper.h" 5 #include "content/shell/renderer/layout_test/interface_registry_js_wrapper.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "mojo/edk/js/handle.h"
11 #include "services/service_manager/public/cpp/interface_registry.h" 10 #include "services/service_manager/public/cpp/interface_registry.h"
11 #include "third_party/WebKit/public/web/WebMojoBindings.h"
12
13 namespace gin {
14 template <>
15 struct Converter<mojo::Handle> {
16 static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, mojo::Handle val) {
17 return blink::WebMojoBindings::wrap(isolate->GetCurrentContext(),
18 mojo::MakeScopedHandle(val));
19 }
20 };
21 } // namespace gin
12 22
13 namespace content { 23 namespace content {
14 24
15 gin::WrapperInfo InterfaceRegistryJsWrapper::kWrapperInfo = { 25 gin::WrapperInfo InterfaceRegistryJsWrapper::kWrapperInfo = {
16 gin::kEmbedderNativeGin}; 26 gin::kEmbedderNativeGin};
17 const char InterfaceRegistryJsWrapper::kPerFrameModuleName[] = 27 const char InterfaceRegistryJsWrapper::kPerFrameModuleName[] =
18 "content/shell/renderer/layout_test/frame_interface_registry"; 28 "content/shell/renderer/layout_test/frame_interface_registry";
19 const char InterfaceRegistryJsWrapper::kPerProcessModuleName[] = 29 const char InterfaceRegistryJsWrapper::kPerProcessModuleName[] =
20 "content/shell/renderer/layout_test/interface_registry"; 30 "content/shell/renderer/layout_test/interface_registry";
21 31
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 73 }
64 74
65 // static 75 // static
66 void InterfaceRegistryJsWrapper::ClearContext( 76 void InterfaceRegistryJsWrapper::ClearContext(
67 const v8::WeakCallbackInfo<InterfaceRegistryJsWrapper>& data) { 77 const v8::WeakCallbackInfo<InterfaceRegistryJsWrapper>& data) {
68 InterfaceRegistryJsWrapper* registry = data.GetParameter(); 78 InterfaceRegistryJsWrapper* registry = data.GetParameter();
69 registry->context_.Reset(); 79 registry->context_.Reset();
70 } 80 }
71 81
72 } // namespace content 82 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/BUILD.gn ('k') | extensions/renderer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698