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

Side by Side Diff: mojo/shell/application_instance.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, 11 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
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 "mojo/shell/application_instance.h" 5 #include "mojo/shell/application_instance.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 native_runner_(nullptr), 46 native_runner_(nullptr),
47 pid_(base::kNullProcessId) {} 47 pid_(base::kNullProcessId) {}
48 48
49 ApplicationInstance::~ApplicationInstance() { 49 ApplicationInstance::~ApplicationInstance() {
50 for (auto request : queued_client_requests_) 50 for (auto request : queued_client_requests_)
51 request->connect_callback().Run(kInvalidContentHandlerID); 51 request->connect_callback().Run(kInvalidContentHandlerID);
52 STLDeleteElements(&queued_client_requests_); 52 STLDeleteElements(&queued_client_requests_);
53 } 53 }
54 54
55 void ApplicationInstance::InitializeApplication() { 55 void ApplicationInstance::InitializeApplication() {
56 ShellPtr shell; 56 application_->Initialize(binding_.CreateInterfacePtrAndBind(),
57 binding_.Bind(GetProxy(&shell)); 57 identity_.url().spec());
58 binding_.set_connection_error_handler([this]() { OnConnectionError(); }); 58 binding_.set_connection_error_handler([this]() { OnConnectionError(); });
59 application_->Initialize(std::move(shell), identity_.url().spec());
60 } 59 }
61 60
62 void ApplicationInstance::ConnectToClient( 61 void ApplicationInstance::ConnectToClient(
63 scoped_ptr<ConnectToApplicationParams> params) { 62 scoped_ptr<ConnectToApplicationParams> params) {
64 if (queue_requests_) { 63 if (queue_requests_) {
65 queued_client_requests_.push_back(params.release()); 64 queued_client_requests_.push_back(params.release());
66 return; 65 return;
67 } 66 }
68 67
69 CallAcceptConnection(std::move(params)); 68 CallAcceptConnection(std::move(params));
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 192
194 queue_requests_ = false; 193 queue_requests_ = false;
195 for (auto request : queued_client_requests_) 194 for (auto request : queued_client_requests_)
196 CallAcceptConnection(make_scoped_ptr(request)); 195 CallAcceptConnection(make_scoped_ptr(request));
197 196
198 queued_client_requests_.clear(); 197 queued_client_requests_.clear();
199 } 198 }
200 199
201 } // namespace shell 200 } // namespace shell
202 } // namespace mojo 201 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/network/network_service_delegate.cc ('k') | mojo/shell/application_manager_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698