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

Side by Side Diff: shell/context.cc

Issue 1926123002: Add a ctor for InterfaceRequest<I> that takes a ScopedMessagePipeHandle, and remove MakeRequest<I>(… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 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 | « shell/android/android_handler.cc ('k') | no next file » | 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 "shell/context.h" 5 #include "shell/context.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base_switches.h" 9 #include "base/base_switches.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 public: 197 public:
198 TracingServiceProvider(Tracer* tracer, 198 TracingServiceProvider(Tracer* tracer,
199 mojo::InterfaceRequest<ServiceProvider> request) 199 mojo::InterfaceRequest<ServiceProvider> request)
200 : tracer_(tracer), binding_(this, request.Pass()) {} 200 : tracer_(tracer), binding_(this, request.Pass()) {}
201 ~TracingServiceProvider() override {} 201 ~TracingServiceProvider() override {}
202 202
203 void ConnectToService(const mojo::String& service_name, 203 void ConnectToService(const mojo::String& service_name,
204 mojo::ScopedMessagePipeHandle client_handle) override { 204 mojo::ScopedMessagePipeHandle client_handle) override {
205 if (tracer_ && service_name == tracing::TraceProvider::Name_) { 205 if (tracer_ && service_name == tracing::TraceProvider::Name_) {
206 tracer_->ConnectToProvider( 206 tracer_->ConnectToProvider(
207 mojo::MakeRequest<tracing::TraceProvider>(client_handle.Pass())); 207 mojo::InterfaceRequest<tracing::TraceProvider>(client_handle.Pass()));
208 } 208 }
209 } 209 }
210 210
211 private: 211 private:
212 Tracer* tracer_; 212 Tracer* tracer_;
213 mojo::StrongBinding<mojo::ServiceProvider> binding_; 213 mojo::StrongBinding<mojo::ServiceProvider> binding_;
214 214
215 DISALLOW_COPY_AND_ASSIGN(TracingServiceProvider); 215 DISALLOW_COPY_AND_ASSIGN(TracingServiceProvider);
216 }; 216 };
217 217
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 if (app_urls_.find(url) != app_urls_.end()) { 387 if (app_urls_.find(url) != app_urls_.end()) {
388 app_urls_.erase(url); 388 app_urls_.erase(url);
389 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) { 389 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) {
390 DCHECK(task_runners_->shell_runner()->RunsTasksOnCurrentThread()); 390 DCHECK(task_runners_->shell_runner()->RunsTasksOnCurrentThread());
391 base::MessageLoop::current()->Quit(); 391 base::MessageLoop::current()->Quit();
392 } 392 }
393 } 393 }
394 } 394 }
395 395
396 } // namespace shell 396 } // namespace shell
OLDNEW
« no previous file with comments | « shell/android/android_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698