Make use of CreateInterfacePtrAndBind() where appropriate
BUG=579645 TEST=none Review URL: https://codereview.chromium.org/1635603002 Cr-Commit-Position: refs/heads/master@{#371598}
This commit is contained in:
chrome/browser
components
content
extensions/renderer/api/display_source/wifi_display
mandoline/ui/desktop_ui
mash/wm
media/mojo/services
mojo
services
network
shell
net/proxy
sql/mojo
ui/arc/notification
@ -18,9 +18,8 @@ ArcAuthService::~ArcAuthService() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ArcAuthService::OnAuthInstanceReady() {
|
void ArcAuthService::OnAuthInstanceReady() {
|
||||||
arc::AuthHostPtr host;
|
arc_bridge_service()->auth_instance()->Init(
|
||||||
binding_.Bind(GetProxy(&host));
|
binding_.CreateInterfacePtrAndBind());
|
||||||
arc_bridge_service()->auth_instance()->Init(std::move(host));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArcAuthService::GetAuthCode(const GetAuthCodeCallback& callback) {
|
void ArcAuthService::GetAuthCode(const GetAuthCodeCallback& callback) {
|
||||||
|
@ -25,9 +25,8 @@ ArcIntentHelperBridge::~ArcIntentHelperBridge() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ArcIntentHelperBridge::OnIntentHelperInstanceReady() {
|
void ArcIntentHelperBridge::OnIntentHelperInstanceReady() {
|
||||||
IntentHelperHostPtr host;
|
arc_bridge_service()->intent_helper_instance()->Init(
|
||||||
binding_.Bind(mojo::GetProxy(&host));
|
binding_.CreateInterfacePtrAndBind());
|
||||||
arc_bridge_service()->intent_helper_instance()->Init(std::move(host));
|
|
||||||
settings_bridge_.reset(new SettingsBridge(this));
|
settings_bridge_.reset(new SettingsBridge(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,9 +281,7 @@ void ArcAppListPrefs::OnAppInstanceReady() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
arc::AppHostPtr host;
|
app_instance->Init(binding_.CreateInterfacePtrAndBind());
|
||||||
binding_.Bind(mojo::GetProxy(&host));
|
|
||||||
app_instance->Init(std::move(host));
|
|
||||||
app_instance->RefreshAppList();
|
app_instance->RefreshAppList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,9 +101,7 @@ void ArcBridgeServiceImpl::OnConnectionEstablished(
|
|||||||
instance_ptr_.set_connection_error_handler(base::Bind(
|
instance_ptr_.set_connection_error_handler(base::Bind(
|
||||||
&ArcBridgeServiceImpl::OnChannelClosed, weak_factory_.GetWeakPtr()));
|
&ArcBridgeServiceImpl::OnChannelClosed, weak_factory_.GetWeakPtr()));
|
||||||
|
|
||||||
ArcBridgeHostPtr host;
|
instance_ptr_->Init(binding_.CreateInterfacePtrAndBind());
|
||||||
binding_.Bind(GetProxy(&host));
|
|
||||||
instance_ptr_->Init(std::move(host));
|
|
||||||
|
|
||||||
SetState(State::READY);
|
SetState(State::READY);
|
||||||
}
|
}
|
||||||
|
@ -46,9 +46,7 @@ void ArcClipboardBridge::OnClipboardInstanceReady() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClipboardHostPtr host;
|
clipboard_instance->Init(binding_.CreateInterfacePtrAndBind());
|
||||||
binding_.Bind(mojo::GetProxy(&host));
|
|
||||||
clipboard_instance->Init(std::move(host));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArcClipboardBridge::SetTextContent(const mojo::String& text) {
|
void ArcClipboardBridge::SetTextContent(const mojo::String& text) {
|
||||||
|
@ -80,9 +80,7 @@ ArcImeIpcHostImpl::~ArcImeIpcHostImpl() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ArcImeIpcHostImpl::OnImeInstanceReady() {
|
void ArcImeIpcHostImpl::OnImeInstanceReady() {
|
||||||
arc::ImeHostPtr host;
|
bridge_service_->ime_instance()->Init(binding_.CreateInterfacePtrAndBind());
|
||||||
binding_.Bind(mojo::GetProxy(&host));
|
|
||||||
bridge_service_->ime_instance()->Init(std::move(host));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArcImeIpcHostImpl::SendSetCompositionText(
|
void ArcImeIpcHostImpl::SendSetCompositionText(
|
||||||
|
@ -35,9 +35,7 @@ void ArcPowerBridge::OnPowerInstanceReady() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PowerHostPtr host;
|
power_instance->Init(binding_.CreateInterfacePtrAndBind());
|
||||||
binding_.Bind(mojo::GetProxy(&host));
|
|
||||||
power_instance->Init(std::move(host));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArcPowerBridge::OnAcquireDisplayWakeLock(
|
void ArcPowerBridge::OnAcquireDisplayWakeLock(
|
||||||
|
@ -32,9 +32,8 @@ void ArcVideoBridge::OnStateChanged(arc::ArcBridgeService::State state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ArcVideoBridge::OnVideoInstanceReady() {
|
void ArcVideoBridge::OnVideoInstanceReady() {
|
||||||
arc::VideoHostPtr host;
|
arc_bridge_service()->video_instance()->Init(
|
||||||
binding_.Bind(mojo::GetProxy(&host));
|
binding_.CreateInterfacePtrAndBind());
|
||||||
arc_bridge_service()->video_instance()->Init(std::move(host));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace arc
|
} // namespace arc
|
||||||
|
@ -23,9 +23,7 @@ void DevToolsAgentHost::SetDelegate(Delegate* delegate) {
|
|||||||
if (binding_.is_bound())
|
if (binding_.is_bound())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DevToolsAgentClientPtr client;
|
agent_->SetClient(binding_.CreateInterfacePtrAndBind());
|
||||||
binding_.Bind(&client);
|
|
||||||
agent_->SetClient(std::move(client));
|
|
||||||
} else {
|
} else {
|
||||||
if (!binding_.is_bound())
|
if (!binding_.is_bound())
|
||||||
return;
|
return;
|
||||||
|
@ -28,11 +28,9 @@ void FilesTestBase::OnFileSystemShutdown() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FilesTestBase::GetTemporaryRoot(DirectoryPtr* directory) {
|
void FilesTestBase::GetTemporaryRoot(DirectoryPtr* directory) {
|
||||||
filesystem::FileSystemClientPtr client;
|
|
||||||
binding_.Bind(GetProxy(&client));
|
|
||||||
|
|
||||||
FileError error = FileError::FAILED;
|
FileError error = FileError::FAILED;
|
||||||
files()->OpenFileSystem("temp", GetProxy(directory), std::move(client),
|
files()->OpenFileSystem("temp", GetProxy(directory),
|
||||||
|
binding_.CreateInterfacePtrAndBind(),
|
||||||
mojo::Capture(&error));
|
mojo::Capture(&error));
|
||||||
ASSERT_TRUE(files().WaitForIncomingResponse());
|
ASSERT_TRUE(files().WaitForIncomingResponse());
|
||||||
ASSERT_EQ(FileError::OK, error);
|
ASSERT_EQ(FileError::OK, error);
|
||||||
|
@ -327,11 +327,8 @@ void FilesystemJsonPrefStore::PerformWrite() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FilesystemJsonPrefStore::OpenFilesystem(base::Closure callback) {
|
void FilesystemJsonPrefStore::OpenFilesystem(base::Closure callback) {
|
||||||
filesystem::FileSystemClientPtr client;
|
|
||||||
binding_.Bind(GetProxy(&client));
|
|
||||||
|
|
||||||
filesystem_->OpenFileSystem(
|
filesystem_->OpenFileSystem(
|
||||||
"origin", GetProxy(&directory_), std::move(client),
|
"origin", GetProxy(&directory_), binding_.CreateInterfacePtrAndBind(),
|
||||||
base::Bind(&FilesystemJsonPrefStore::OnOpenFilesystem, AsWeakPtr(),
|
base::Bind(&FilesystemJsonPrefStore::OnOpenFilesystem, AsWeakPtr(),
|
||||||
callback));
|
callback));
|
||||||
}
|
}
|
||||||
|
@ -251,9 +251,7 @@ class WindowAndFrame : public mus::WindowTreeDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mojom::FrameClientPtr GetFrameClientPtr() {
|
mojom::FrameClientPtr GetFrameClientPtr() {
|
||||||
mojom::FrameClientPtr client_ptr;
|
return frame_client_binding_.CreateInterfacePtrAndBind();
|
||||||
frame_client_binding_.Bind(GetProxy(&client_ptr));
|
|
||||||
return client_ptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bind(mojo::InterfaceRequest<mojom::FrameClient> request) {
|
void Bind(mojo::InterfaceRequest<mojom::FrameClient> request) {
|
||||||
|
@ -61,9 +61,7 @@ class FrameDevToolsAgent::FrameDevToolsAgentClient
|
|||||||
if (binding_.is_bound())
|
if (binding_.is_bound())
|
||||||
binding_.Close();
|
binding_.Close();
|
||||||
|
|
||||||
DevToolsAgentClientPtr client;
|
owner_->forward_agent_->SetClient(binding_.CreateInterfacePtrAndBind());
|
||||||
binding_.Bind(&client);
|
|
||||||
owner_->forward_agent_->SetClient(std::move(client));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -126,9 +124,7 @@ void FrameDevToolsAgent::RegisterAgentIfNecessary() {
|
|||||||
DevToolsRegistryPtr devtools_registry;
|
DevToolsRegistryPtr devtools_registry;
|
||||||
app_->ConnectToService("mojo:devtools_service", &devtools_registry);
|
app_->ConnectToService("mojo:devtools_service", &devtools_registry);
|
||||||
|
|
||||||
DevToolsAgentPtr agent;
|
devtools_registry->RegisterAgent(id_, binding_.CreateInterfacePtrAndBind());
|
||||||
binding_.Bind(&agent);
|
|
||||||
devtools_registry->RegisterAgent(id_, std::move(agent));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FrameDevToolsAgent::HandlePageNavigateRequest(
|
void FrameDevToolsAgent::HandlePageNavigateRequest(
|
||||||
|
@ -24,14 +24,10 @@ WebView::WebView(mojom::WebViewClient* client) : binding_(client) {}
|
|||||||
WebView::~WebView() {}
|
WebView::~WebView() {}
|
||||||
|
|
||||||
void WebView::Init(mojo::ApplicationImpl* app, mus::Window* window) {
|
void WebView::Init(mojo::ApplicationImpl* app, mus::Window* window) {
|
||||||
mojom::WebViewClientPtr client;
|
|
||||||
mojo::InterfaceRequest<mojom::WebViewClient> client_request =
|
|
||||||
GetProxy(&client);
|
|
||||||
binding_.Bind(std::move(client_request));
|
|
||||||
|
|
||||||
mojom::WebViewFactoryPtr factory;
|
mojom::WebViewFactoryPtr factory;
|
||||||
app->ConnectToService("mojo:web_view", &factory);
|
app->ConnectToService("mojo:web_view", &factory);
|
||||||
factory->CreateWebView(std::move(client), GetProxy(&web_view_));
|
factory->CreateWebView(binding_.CreateInterfacePtrAndBind(),
|
||||||
|
GetProxy(&web_view_));
|
||||||
|
|
||||||
mus::mojom::WindowTreeClientPtr window_tree_client;
|
mus::mojom::WindowTreeClientPtr window_tree_client;
|
||||||
web_view_->GetWindowTreeClient(GetProxy(&window_tree_client));
|
web_view_->GetWindowTreeClient(GetProxy(&window_tree_client));
|
||||||
|
@ -124,9 +124,7 @@ ServicePortServicePtr& ServicePortProvider::GetServicePortServicePtr() {
|
|||||||
base::Passed(&request)));
|
base::Passed(&request)));
|
||||||
|
|
||||||
// Setup channel for browser to post events back to this class.
|
// Setup channel for browser to post events back to this class.
|
||||||
ServicePortServiceClientPtr client_ptr;
|
service_port_service_->SetClient(binding_.CreateInterfacePtrAndBind());
|
||||||
binding_.Bind(GetProxy(&client_ptr));
|
|
||||||
service_port_service_->SetClient(std::move(client_ptr));
|
|
||||||
}
|
}
|
||||||
return service_port_service_;
|
return service_port_service_;
|
||||||
}
|
}
|
||||||
|
@ -421,9 +421,7 @@ void PresentationDispatcher::ConnectToPresentationServiceIfNeeded() {
|
|||||||
|
|
||||||
render_frame()->GetServiceRegistry()->ConnectToRemoteService(
|
render_frame()->GetServiceRegistry()->ConnectToRemoteService(
|
||||||
mojo::GetProxy(&presentation_service_));
|
mojo::GetProxy(&presentation_service_));
|
||||||
presentation::PresentationServiceClientPtr client_ptr;
|
presentation_service_->SetClient(binding_.CreateInterfacePtrAndBind());
|
||||||
binding_.Bind(GetProxy(&client_ptr));
|
|
||||||
presentation_service_->SetClient(std::move(client_ptr));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PresentationDispatcher::UpdateListeningState(AvailabilityStatus* status) {
|
void PresentationDispatcher::UpdateListeningState(AvailabilityStatus* status) {
|
||||||
|
@ -29,13 +29,10 @@ WiFiDisplaySession::WiFiDisplaySession(
|
|||||||
&WiFiDisplaySession::OnConnectionError,
|
&WiFiDisplaySession::OnConnectionError,
|
||||||
weak_factory_.GetWeakPtr()));
|
weak_factory_.GetWeakPtr()));
|
||||||
|
|
||||||
WiFiDisplaySessionServiceClientPtr client_ptr;
|
service_->SetClient(binding_.CreateInterfacePtrAndBind());
|
||||||
binding_.Bind(GetProxy(&client_ptr));
|
|
||||||
binding_.set_connection_error_handler(base::Bind(
|
binding_.set_connection_error_handler(base::Bind(
|
||||||
&WiFiDisplaySession::OnConnectionError,
|
&WiFiDisplaySession::OnConnectionError,
|
||||||
weak_factory_.GetWeakPtr()));
|
weak_factory_.GetWeakPtr()));
|
||||||
DCHECK(client_ptr);
|
|
||||||
service_->SetClient(std::move(client_ptr));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WiFiDisplaySession::~WiFiDisplaySession() {
|
WiFiDisplaySession::~WiFiDisplaySession() {
|
||||||
|
@ -112,10 +112,9 @@ BrowserWindow::BrowserWindow(mojo::ApplicationImpl* app,
|
|||||||
find_active_(0),
|
find_active_(0),
|
||||||
find_count_(0),
|
find_count_(0),
|
||||||
web_view_(this) {
|
web_view_(this) {
|
||||||
mus::mojom::WindowTreeHostClientPtr host_client;
|
mus::CreateWindowTreeHost(host_factory,
|
||||||
host_client_binding_.Bind(GetProxy(&host_client));
|
host_client_binding_.CreateInterfacePtrAndBind(),
|
||||||
mus::CreateWindowTreeHost(host_factory, std::move(host_client), this, &host_,
|
this, &host_, nullptr, nullptr);
|
||||||
nullptr, nullptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserWindow::LoadURL(const GURL& url) {
|
void BrowserWindow::LoadURL(const GURL& url) {
|
||||||
|
@ -84,11 +84,9 @@ void WindowManagerApplication::Initialize(mojo::ApplicationImpl* app) {
|
|||||||
make_scoped_ptr(new mojo::InterfaceRequest<mus::mojom::WindowManager>(
|
make_scoped_ptr(new mojo::InterfaceRequest<mus::mojom::WindowManager>(
|
||||||
mojo::GetProxy(&window_manager))));
|
mojo::GetProxy(&window_manager))));
|
||||||
user_window_controller_.reset(new UserWindowControllerImpl());
|
user_window_controller_.reset(new UserWindowControllerImpl());
|
||||||
mus::mojom::WindowTreeHostClientPtr host_client;
|
mus::CreateSingleWindowTreeHost(
|
||||||
host_client_binding_.Bind(GetProxy(&host_client));
|
app, host_client_binding_.CreateInterfacePtrAndBind(), this,
|
||||||
mus::CreateSingleWindowTreeHost(app, std::move(host_client), this,
|
&window_tree_host_, std::move(window_manager), window_manager_.get());
|
||||||
&window_tree_host_, std::move(window_manager),
|
|
||||||
window_manager_.get());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WindowManagerApplication::ConfigureIncomingConnection(
|
bool WindowManagerApplication::ConfigureIncomingConnection(
|
||||||
|
@ -101,14 +101,11 @@ class MediaAppTest : public mojo::test::ApplicationTestBase {
|
|||||||
interfaces::DemuxerStreamPtr video_stream;
|
interfaces::DemuxerStreamPtr video_stream;
|
||||||
new MojoDemuxerStreamImpl(&video_demuxer_stream_, GetProxy(&video_stream));
|
new MojoDemuxerStreamImpl(&video_demuxer_stream_, GetProxy(&video_stream));
|
||||||
|
|
||||||
interfaces::RendererClientPtr client_ptr;
|
|
||||||
renderer_client_binding_.Bind(GetProxy(&client_ptr));
|
|
||||||
|
|
||||||
EXPECT_CALL(*this, OnRendererInitialized(expected_result))
|
EXPECT_CALL(*this, OnRendererInitialized(expected_result))
|
||||||
.Times(Exactly(1))
|
.Times(Exactly(1))
|
||||||
.WillOnce(InvokeWithoutArgs(run_loop_.get(), &base::RunLoop::Quit));
|
.WillOnce(InvokeWithoutArgs(run_loop_.get(), &base::RunLoop::Quit));
|
||||||
renderer_->Initialize(std::move(client_ptr), nullptr,
|
renderer_->Initialize(renderer_client_binding_.CreateInterfacePtrAndBind(),
|
||||||
std::move(video_stream),
|
nullptr, std::move(video_stream),
|
||||||
base::Bind(&MediaAppTest::OnRendererInitialized,
|
base::Bind(&MediaAppTest::OnRendererInitialized,
|
||||||
base::Unretained(this)));
|
base::Unretained(this)));
|
||||||
}
|
}
|
||||||
|
@ -76,9 +76,7 @@ MojoCdm::MojoCdm(interfaces::ContentDecryptionModulePtr remote_cdm,
|
|||||||
DCHECK(!session_keys_change_cb_.is_null());
|
DCHECK(!session_keys_change_cb_.is_null());
|
||||||
DCHECK(!session_expiration_update_cb_.is_null());
|
DCHECK(!session_expiration_update_cb_.is_null());
|
||||||
|
|
||||||
interfaces::ContentDecryptionModuleClientPtr client_ptr;
|
remote_cdm_->SetClient(binding_.CreateInterfacePtrAndBind());
|
||||||
binding_.Bind(GetProxy(&client_ptr));
|
|
||||||
remote_cdm_->SetClient(std::move(client_ptr));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MojoCdm::~MojoCdm() {
|
MojoCdm::~MojoCdm() {
|
||||||
|
@ -68,10 +68,9 @@ void MojoRendererImpl::Initialize(
|
|||||||
if (video)
|
if (video)
|
||||||
new MojoDemuxerStreamImpl(video, GetProxy(&video_stream));
|
new MojoDemuxerStreamImpl(video, GetProxy(&video_stream));
|
||||||
|
|
||||||
interfaces::RendererClientPtr client_ptr;
|
|
||||||
binding_.Bind(GetProxy(&client_ptr));
|
|
||||||
remote_renderer_->Initialize(
|
remote_renderer_->Initialize(
|
||||||
std::move(client_ptr), std::move(audio_stream), std::move(video_stream),
|
binding_.CreateInterfacePtrAndBind(), std::move(audio_stream),
|
||||||
|
std::move(video_stream),
|
||||||
BindToCurrentLoop(base::Bind(&MojoRendererImpl::OnInitialized,
|
BindToCurrentLoop(base::Bind(&MojoRendererImpl::OnInitialized,
|
||||||
weak_factory_.GetWeakPtr())));
|
weak_factory_.GetWeakPtr())));
|
||||||
}
|
}
|
||||||
|
@ -98,13 +98,10 @@ void NetworkServiceDelegate::Initialize(ApplicationImpl* app) {
|
|||||||
// apptests are also fairly resistant to being run under gdb on android.
|
// apptests are also fairly resistant to being run under gdb on android.
|
||||||
app_->ConnectToService("mojo:filesystem", &files_);
|
app_->ConnectToService("mojo:filesystem", &files_);
|
||||||
|
|
||||||
filesystem::FileSystemClientPtr client;
|
|
||||||
binding_.Bind(GetProxy(&client));
|
|
||||||
|
|
||||||
filesystem::FileError error = filesystem::FileError::FAILED;
|
filesystem::FileError error = filesystem::FileError::FAILED;
|
||||||
filesystem::DirectoryPtr directory;
|
filesystem::DirectoryPtr directory;
|
||||||
files_->OpenFileSystem("origin", GetProxy(&directory), std::move(client),
|
files_->OpenFileSystem("origin", GetProxy(&directory),
|
||||||
Capture(&error));
|
binding_.CreateInterfacePtrAndBind(), Capture(&error));
|
||||||
files_.WaitForIncomingResponse();
|
files_.WaitForIncomingResponse();
|
||||||
|
|
||||||
io_worker_thread_.reset(new SQLThread(std::move(directory)));
|
io_worker_thread_.reset(new SQLThread(std::move(directory)));
|
||||||
|
@ -53,10 +53,9 @@ ApplicationInstance::~ApplicationInstance() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ApplicationInstance::InitializeApplication() {
|
void ApplicationInstance::InitializeApplication() {
|
||||||
ShellPtr shell;
|
application_->Initialize(binding_.CreateInterfacePtrAndBind(),
|
||||||
binding_.Bind(GetProxy(&shell));
|
identity_.url().spec());
|
||||||
binding_.set_connection_error_handler([this]() { OnConnectionError(); });
|
binding_.set_connection_error_handler([this]() { OnConnectionError(); });
|
||||||
application_->Initialize(std::move(shell), identity_.url().spec());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplicationInstance::ConnectToClient(
|
void ApplicationInstance::ConnectToClient(
|
||||||
|
@ -88,11 +88,7 @@ class ApplicationManagerAppTest : public mojo::test::ApplicationTestBase,
|
|||||||
mojom::ApplicationManagerPtr application_manager;
|
mojom::ApplicationManagerPtr application_manager;
|
||||||
application_impl()->ConnectToService("mojo:shell", &application_manager);
|
application_impl()->ConnectToService("mojo:shell", &application_manager);
|
||||||
|
|
||||||
mojom::ApplicationManagerListenerPtr listener;
|
application_manager->AddListener(binding_.CreateInterfacePtrAndBind());
|
||||||
InterfaceRequest<mojom::ApplicationManagerListener> request =
|
|
||||||
GetProxy(&listener);
|
|
||||||
application_manager->AddListener(std::move(listener));
|
|
||||||
binding_.Bind(std::move(request));
|
|
||||||
binding_.WaitForIncomingMethodCall();
|
binding_.WaitForIncomingMethodCall();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,12 +198,10 @@ ProxyResolverMojo::Job::Job(ProxyResolverMojo* resolver,
|
|||||||
results_(results),
|
results_(results),
|
||||||
callback_(callback),
|
callback_(callback),
|
||||||
binding_(this) {
|
binding_(this) {
|
||||||
interfaces::ProxyResolverRequestClientPtr client_ptr;
|
resolver_->mojo_proxy_resolver_ptr_->GetProxyForUrl(
|
||||||
binding_.Bind(mojo::GetProxy(&client_ptr));
|
mojo::String::From(url_), binding_.CreateInterfacePtrAndBind());
|
||||||
binding_.set_connection_error_handler(base::Bind(
|
binding_.set_connection_error_handler(base::Bind(
|
||||||
&ProxyResolverMojo::Job::OnConnectionError, base::Unretained(this)));
|
&ProxyResolverMojo::Job::OnConnectionError, base::Unretained(this)));
|
||||||
resolver_->mojo_proxy_resolver_ptr_->GetProxyForUrl(mojo::String::From(url_),
|
|
||||||
std::move(client_ptr));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ProxyResolverMojo::Job::~Job() {
|
ProxyResolverMojo::Job::~Job() {
|
||||||
@ -340,11 +338,9 @@ class ProxyResolverFactoryMojo::Job
|
|||||||
callback_(callback),
|
callback_(callback),
|
||||||
binding_(this),
|
binding_(this),
|
||||||
error_observer_(std::move(error_observer)) {
|
error_observer_(std::move(error_observer)) {
|
||||||
interfaces::ProxyResolverFactoryRequestClientPtr client_ptr;
|
|
||||||
binding_.Bind(mojo::GetProxy(&client_ptr));
|
|
||||||
on_delete_callback_runner_ = factory_->mojo_proxy_factory_->CreateResolver(
|
on_delete_callback_runner_ = factory_->mojo_proxy_factory_->CreateResolver(
|
||||||
mojo::String::From(pac_script->utf16()), mojo::GetProxy(&resolver_ptr_),
|
mojo::String::From(pac_script->utf16()), mojo::GetProxy(&resolver_ptr_),
|
||||||
std::move(client_ptr));
|
binding_.CreateInterfacePtrAndBind());
|
||||||
resolver_ptr_.set_connection_error_handler(
|
resolver_ptr_.set_connection_error_handler(
|
||||||
base::Bind(&ProxyResolverFactoryMojo::Job::OnConnectionError,
|
base::Bind(&ProxyResolverFactoryMojo::Job::OnConnectionError,
|
||||||
base::Unretained(this)));
|
base::Unretained(this)));
|
||||||
|
@ -139,12 +139,10 @@ void SQLTestBase::SetUp() {
|
|||||||
|
|
||||||
application_impl()->ConnectToService("mojo:filesystem", &files_);
|
application_impl()->ConnectToService("mojo:filesystem", &files_);
|
||||||
|
|
||||||
filesystem::FileSystemClientPtr client;
|
|
||||||
binding_.Bind(GetProxy(&client));
|
|
||||||
|
|
||||||
filesystem::FileError error = filesystem::FileError::FAILED;
|
filesystem::FileError error = filesystem::FileError::FAILED;
|
||||||
filesystem::DirectoryPtr directory;
|
filesystem::DirectoryPtr directory;
|
||||||
files()->OpenFileSystem("temp", GetProxy(&directory), std::move(client),
|
files()->OpenFileSystem("temp", GetProxy(&directory),
|
||||||
|
binding_.CreateInterfacePtrAndBind(),
|
||||||
Capture(&error));
|
Capture(&error));
|
||||||
ASSERT_TRUE(files().WaitForIncomingResponse());
|
ASSERT_TRUE(files().WaitForIncomingResponse());
|
||||||
ASSERT_EQ(filesystem::FileError::OK, error);
|
ASSERT_EQ(filesystem::FileError::OK, error);
|
||||||
|
@ -55,12 +55,10 @@ class VFSTest : public mojo::test::ApplicationTestBase,
|
|||||||
|
|
||||||
application_impl()->ConnectToService("mojo:filesystem", &files_);
|
application_impl()->ConnectToService("mojo:filesystem", &files_);
|
||||||
|
|
||||||
filesystem::FileSystemClientPtr client;
|
|
||||||
binding_.Bind(GetProxy(&client));
|
|
||||||
|
|
||||||
filesystem::FileError error = filesystem::FileError::FAILED;
|
filesystem::FileError error = filesystem::FileError::FAILED;
|
||||||
filesystem::DirectoryPtr directory;
|
filesystem::DirectoryPtr directory;
|
||||||
files_->OpenFileSystem("temp", GetProxy(&directory), std::move(client),
|
files_->OpenFileSystem("temp", GetProxy(&directory),
|
||||||
|
binding_.CreateInterfacePtrAndBind(),
|
||||||
mojo::Capture(&error));
|
mojo::Capture(&error));
|
||||||
ASSERT_TRUE(files_.WaitForIncomingResponse());
|
ASSERT_TRUE(files_.WaitForIncomingResponse());
|
||||||
ASSERT_EQ(filesystem::FileError::OK, error);
|
ASSERT_EQ(filesystem::FileError::OK, error);
|
||||||
|
@ -29,9 +29,7 @@ void ArcNotificationManager::OnNotificationsInstanceReady() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NotificationsHostPtr host;
|
notifications_instance->Init(binding_.CreateInterfacePtrAndBind());
|
||||||
binding_.Bind(mojo::GetProxy(&host));
|
|
||||||
notifications_instance->Init(std::move(host));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArcNotificationManager::OnNotificationPosted(ArcNotificationDataPtr data) {
|
void ArcNotificationManager::OnNotificationPosted(ArcNotificationDataPtr data) {
|
||||||
|
Reference in New Issue
Block a user