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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2879843002: Reland 1: Enable overriding interface binders for any services running in current process. (Closed)
Patch Set: Identical with original CL Created 3 years, 7 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 | « no previous file | content/browser/vibration_browsertest.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 3913 matching lines...) Expand 10 before | Expand all | Expand 10 after
3924 return; 3924 return;
3925 3925
3926 SimulateBeforeUnloadAck(); 3926 SimulateBeforeUnloadAck();
3927 } 3927 }
3928 3928
3929 #if defined(OS_ANDROID) 3929 #if defined(OS_ANDROID)
3930 3930
3931 class RenderFrameHostImpl::JavaInterfaceProvider 3931 class RenderFrameHostImpl::JavaInterfaceProvider
3932 : public service_manager::mojom::InterfaceProvider { 3932 : public service_manager::mojom::InterfaceProvider {
3933 public: 3933 public:
3934 using BindCallback =
3935 base::Callback<void(const std::string&, mojo::ScopedMessagePipeHandle)>;
3936
3934 JavaInterfaceProvider( 3937 JavaInterfaceProvider(
3935 const service_manager::BinderRegistry::Binder& bind_callback, 3938 const BindCallback& bind_callback,
3936 service_manager::mojom::InterfaceProviderRequest request) 3939 service_manager::mojom::InterfaceProviderRequest request)
3937 : bind_callback_(bind_callback), binding_(this, std::move(request)) {} 3940 : bind_callback_(bind_callback), binding_(this, std::move(request)) {}
3938 ~JavaInterfaceProvider() override = default; 3941 ~JavaInterfaceProvider() override = default;
3939 3942
3940 private: 3943 private:
3941 // service_manager::mojom::INterfaceProvider: 3944 // service_manager::mojom::InterfaceProvider:
3942 void GetInterface(const std::string& interface_name, 3945 void GetInterface(const std::string& interface_name,
3943 mojo::ScopedMessagePipeHandle handle) override { 3946 mojo::ScopedMessagePipeHandle handle) override {
3944 bind_callback_.Run(interface_name, std::move(handle)); 3947 bind_callback_.Run(interface_name, std::move(handle));
3945 } 3948 }
3946 3949
3947 service_manager::BinderRegistry::Binder bind_callback_; 3950 const BindCallback bind_callback_;
3948 mojo::Binding<service_manager::mojom::InterfaceProvider> binding_; 3951 mojo::Binding<service_manager::mojom::InterfaceProvider> binding_;
3949 3952
3950 DISALLOW_COPY_AND_ASSIGN(JavaInterfaceProvider); 3953 DISALLOW_COPY_AND_ASSIGN(JavaInterfaceProvider);
3951 }; 3954 };
3952 3955
3953 base::android::ScopedJavaLocalRef<jobject> 3956 base::android::ScopedJavaLocalRef<jobject>
3954 RenderFrameHostImpl::GetJavaRenderFrameHost() { 3957 RenderFrameHostImpl::GetJavaRenderFrameHost() {
3955 RenderFrameHostAndroid* render_frame_host_android = 3958 RenderFrameHostAndroid* render_frame_host_android =
3956 static_cast<RenderFrameHostAndroid*>( 3959 static_cast<RenderFrameHostAndroid*>(
3957 GetUserData(kRenderFrameHostAndroidKey)); 3960 GetUserData(kRenderFrameHostAndroidKey));
(...skipping 22 matching lines...) Expand all
3980 } 3983 }
3981 3984
3982 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( 3985 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame(
3983 const std::string& interface_name, 3986 const std::string& interface_name,
3984 mojo::ScopedMessagePipeHandle pipe) { 3987 mojo::ScopedMessagePipeHandle pipe) {
3985 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); 3988 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe));
3986 } 3989 }
3987 #endif 3990 #endif
3988 3991
3989 } // namespace content 3992 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/vibration_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698