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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 1687693002: Rename ConnectToService to ConnectToInterface() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sp2
Patch Set: . Created 4 years, 10 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/renderer/render_frame_impl.h ('k') | device/devices_app/devices_apptest.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/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 5979 matching lines...) Expand 10 before | Expand all | Expand 10 after
5990 if (!media_session_manager_) 5990 if (!media_session_manager_)
5991 media_session_manager_ = new RendererMediaSessionManager(this); 5991 media_session_manager_ = new RendererMediaSessionManager(this);
5992 return media_session_manager_; 5992 return media_session_manager_;
5993 } 5993 }
5994 5994
5995 #endif // defined(OS_ANDROID) 5995 #endif // defined(OS_ANDROID)
5996 5996
5997 media::MediaPermission* RenderFrameImpl::GetMediaPermission() { 5997 media::MediaPermission* RenderFrameImpl::GetMediaPermission() {
5998 if (!media_permission_dispatcher_) { 5998 if (!media_permission_dispatcher_) {
5999 media_permission_dispatcher_.reset(new MediaPermissionDispatcher( 5999 media_permission_dispatcher_.reset(new MediaPermissionDispatcher(
6000 base::Bind(&RenderFrameImpl::ConnectToService<PermissionService>, 6000 base::Bind(&RenderFrameImpl::GetInterface<PermissionService>,
6001 base::Unretained(this)))); 6001 base::Unretained(this))));
6002 } 6002 }
6003 return media_permission_dispatcher_.get(); 6003 return media_permission_dispatcher_.get();
6004 } 6004 }
6005 6005
6006 #if defined(ENABLE_MOJO_MEDIA) 6006 #if defined(ENABLE_MOJO_MEDIA)
6007 media::interfaces::ServiceFactory* RenderFrameImpl::GetMediaServiceFactory() { 6007 media::interfaces::ServiceFactory* RenderFrameImpl::GetMediaServiceFactory() {
6008 if (!media_service_factory_) { 6008 if (!media_service_factory_) {
6009 mojo::InterfaceProviderPtr service_provider = 6009 mojo::InterfaceProviderPtr service_provider =
6010 ConnectToApplication(GURL("mojo:media")); 6010 ConnectToApplication(GURL("mojo:media"));
6011 mojo::ConnectToService(service_provider.get(), &media_service_factory_); 6011 mojo::GetInterface(service_provider.get(), &media_service_factory_);
6012 media_service_factory_.set_connection_error_handler( 6012 media_service_factory_.set_connection_error_handler(
6013 base::Bind(&RenderFrameImpl::OnMediaServiceFactoryConnectionError, 6013 base::Bind(&RenderFrameImpl::OnMediaServiceFactoryConnectionError,
6014 base::Unretained(this))); 6014 base::Unretained(this)));
6015 } 6015 }
6016 6016
6017 return media_service_factory_.get(); 6017 return media_service_factory_.get();
6018 } 6018 }
6019 6019
6020 void RenderFrameImpl::OnMediaServiceFactoryConnectionError() { 6020 void RenderFrameImpl::OnMediaServiceFactoryConnectionError() {
6021 // TODO(xhwang): Resetting |media_service_factory_| could cause access 6021 // TODO(xhwang): Resetting |media_service_factory_| could cause access
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
6064 void RenderFrameImpl::RegisterMojoServices() { 6064 void RenderFrameImpl::RegisterMojoServices() {
6065 // Only main frame have ImageDownloader service. 6065 // Only main frame have ImageDownloader service.
6066 if (!frame_->parent()) { 6066 if (!frame_->parent()) {
6067 GetServiceRegistry()->AddService<image_downloader::ImageDownloader>( 6067 GetServiceRegistry()->AddService<image_downloader::ImageDownloader>(
6068 base::Bind(&ImageDownloaderImpl::CreateMojoService, 6068 base::Bind(&ImageDownloaderImpl::CreateMojoService,
6069 base::Unretained(this))); 6069 base::Unretained(this)));
6070 } 6070 }
6071 } 6071 }
6072 6072
6073 template <typename Interface> 6073 template <typename Interface>
6074 void RenderFrameImpl::ConnectToService( 6074 void RenderFrameImpl::GetInterface(mojo::InterfaceRequest<Interface> request) {
6075 mojo::InterfaceRequest<Interface> request) {
6076 GetServiceRegistry()->ConnectToRemoteService(std::move(request)); 6075 GetServiceRegistry()->ConnectToRemoteService(std::move(request));
6077 } 6076 }
6078 6077
6079 mojo::InterfaceProviderPtr RenderFrameImpl::ConnectToApplication( 6078 mojo::InterfaceProviderPtr RenderFrameImpl::ConnectToApplication(
6080 const GURL& url) { 6079 const GURL& url) {
6081 if (!mojo_shell_) 6080 if (!mojo_shell_)
6082 GetServiceRegistry()->ConnectToRemoteService(mojo::GetProxy(&mojo_shell_)); 6081 GetServiceRegistry()->ConnectToRemoteService(mojo::GetProxy(&mojo_shell_));
6083 mojo::InterfaceProviderPtr service_provider; 6082 mojo::InterfaceProviderPtr service_provider;
6084 mojo::URLRequestPtr request(mojo::URLRequest::New()); 6083 mojo::URLRequestPtr request(mojo::URLRequest::New());
6085 request->url = mojo::String::From(url); 6084 request->url = mojo::String::From(url);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
6134 int match_count, 6133 int match_count,
6135 int ordinal, 6134 int ordinal,
6136 const WebRect& selection_rect, 6135 const WebRect& selection_rect,
6137 bool final_status_update) { 6136 bool final_status_update) {
6138 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, 6137 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count,
6139 selection_rect, ordinal, 6138 selection_rect, ordinal,
6140 final_status_update)); 6139 final_status_update));
6141 } 6140 }
6142 6141
6143 } // namespace content 6142 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | device/devices_app/devices_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698