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

Side by Side Diff: mojo/shell/application_manager_apptest.cc

Issue 1635603002: Make use of CreateInterfacePtrAndBind() where appropriate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweaks 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 | « mojo/shell/application_instance.cc ('k') | net/proxy/proxy_resolver_factory_mojo.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 int id; 82 int id;
83 std::string url; 83 std::string url;
84 base::ProcessId pid; 84 base::ProcessId pid;
85 }; 85 };
86 86
87 void AddListenerAndWaitForApplications() { 87 void AddListenerAndWaitForApplications() {
88 mojom::ApplicationManagerPtr application_manager; 88 mojom::ApplicationManagerPtr application_manager;
89 application_impl()->ConnectToService("mojo:shell", &application_manager); 89 application_impl()->ConnectToService("mojo:shell", &application_manager);
90 90
91 mojom::ApplicationManagerListenerPtr listener; 91 application_manager->AddListener(binding_.CreateInterfacePtrAndBind());
92 InterfaceRequest<mojom::ApplicationManagerListener> request =
93 GetProxy(&listener);
94 application_manager->AddListener(std::move(listener));
95 binding_.Bind(std::move(request));
96 binding_.WaitForIncomingMethodCall(); 92 binding_.WaitForIncomingMethodCall();
97 } 93 }
98 94
99 const std::string& data() const { 95 const std::string& data() const {
100 DCHECK(delegate_); 96 DCHECK(delegate_);
101 return delegate_->data(); 97 return delegate_->data();
102 } 98 }
103 99
104 const std::vector<ApplicationInfo>& applications() const { 100 const std::vector<ApplicationInfo>& applications() const {
105 return applications_; 101 return applications_;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 175
180 driver.set_connection_error_handler( 176 driver.set_connection_error_handler(
181 base::Bind(&ApplicationManagerAppTest::OnDriverQuit, 177 base::Bind(&ApplicationManagerAppTest::OnDriverQuit,
182 base::Unretained(this))); 178 base::Unretained(this)));
183 driver->QuitDriver(); 179 driver->QuitDriver();
184 base::MessageLoop::current()->Run(); 180 base::MessageLoop::current()->Run();
185 } 181 }
186 182
187 } // namespace shell 183 } // namespace shell
188 } // namespace mojo 184 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/application_instance.cc ('k') | net/proxy/proxy_resolver_factory_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698