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

Side by Side Diff: content/common/mojo/mojo_shell_connection_impl.cc

Issue 1544293002: Convert Pass()→std::move() in //content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « content/common/mojo/channel_init.cc ('k') | content/common/mojo/service_registry_impl.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 "content/common/mojo/mojo_shell_connection_impl.h" 5 #include "content/common/mojo/mojo_shell_connection_impl.h"
6 6
7 #include <utility>
8
7 #include "base/command_line.h" 9 #include "base/command_line.h"
8 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
9 #include "base/stl_util.h" 11 #include "base/stl_util.h"
10 #include "base/threading/thread_local.h" 12 #include "base/threading/thread_local.h"
11 #include "mojo/application/public/cpp/application_delegate.h" 13 #include "mojo/application/public/cpp/application_delegate.h"
12 #include "mojo/application/public/cpp/application_impl.h" 14 #include "mojo/application/public/cpp/application_impl.h"
13 #include "mojo/converters/network/network_type_converters.h" 15 #include "mojo/converters/network/network_type_converters.h"
14 #include "mojo/runner/child/runner_connection.h" 16 #include "mojo/runner/child/runner_connection.h"
15 17
16 namespace content { 18 namespace content {
(...skipping 28 matching lines...) Expand all
45 DCHECK(IsRunningInMojoShell()); 47 DCHECK(IsRunningInMojoShell());
46 if (initialized_) 48 if (initialized_)
47 return; 49 return;
48 WaitForShell(mojo::ScopedMessagePipeHandle()); 50 WaitForShell(mojo::ScopedMessagePipeHandle());
49 } 51 }
50 52
51 void MojoShellConnectionImpl::BindToMessagePipe( 53 void MojoShellConnectionImpl::BindToMessagePipe(
52 mojo::ScopedMessagePipeHandle handle) { 54 mojo::ScopedMessagePipeHandle handle) {
53 if (initialized_) 55 if (initialized_)
54 return; 56 return;
55 WaitForShell(handle.Pass()); 57 WaitForShell(std::move(handle));
56 } 58 }
57 59
58 MojoShellConnectionImpl::MojoShellConnectionImpl() : initialized_(false) {} 60 MojoShellConnectionImpl::MojoShellConnectionImpl() : initialized_(false) {}
59 MojoShellConnectionImpl::~MojoShellConnectionImpl() { 61 MojoShellConnectionImpl::~MojoShellConnectionImpl() {
60 STLDeleteElements(&listeners_); 62 STLDeleteElements(&listeners_);
61 } 63 }
62 64
63 void MojoShellConnectionImpl::WaitForShell( 65 void MojoShellConnectionImpl::WaitForShell(
64 mojo::ScopedMessagePipeHandle handle) { 66 mojo::ScopedMessagePipeHandle handle) {
65 mojo::InterfaceRequest<mojo::Application> application_request; 67 mojo::InterfaceRequest<mojo::Application> application_request;
66 runner_connection_.reset(mojo::runner::RunnerConnection::ConnectToRunner( 68 runner_connection_.reset(mojo::runner::RunnerConnection::ConnectToRunner(
67 &application_request, handle.Pass())); 69 &application_request, std::move(handle)));
68 application_impl_.reset(new mojo::ApplicationImpl( 70 application_impl_.reset(
69 this, application_request.Pass())); 71 new mojo::ApplicationImpl(this, std::move(application_request)));
70 application_impl_->WaitForInitialize(); 72 application_impl_->WaitForInitialize();
71 } 73 }
72 74
73 void MojoShellConnectionImpl::Initialize(mojo::ApplicationImpl* application) { 75 void MojoShellConnectionImpl::Initialize(mojo::ApplicationImpl* application) {
74 initialized_ = true; 76 initialized_ = true;
75 } 77 }
76 78
77 bool MojoShellConnectionImpl::ConfigureIncomingConnection( 79 bool MojoShellConnectionImpl::ConfigureIncomingConnection(
78 mojo::ApplicationConnection* connection) { 80 mojo::ApplicationConnection* connection) {
79 bool found = false; 81 bool found = false;
(...skipping 27 matching lines...) Expand all
107 // static 109 // static
108 void MojoShellConnection::Destroy() { 110 void MojoShellConnection::Destroy() {
109 // This joins the shell controller thread. 111 // This joins the shell controller thread.
110 delete Get(); 112 delete Get();
111 lazy_tls_ptr.Pointer()->Set(nullptr); 113 lazy_tls_ptr.Pointer()->Set(nullptr);
112 } 114 }
113 115
114 MojoShellConnection::~MojoShellConnection() {} 116 MojoShellConnection::~MojoShellConnection() {}
115 117
116 } // namespace content 118 } // namespace content
OLDNEW
« no previous file with comments | « content/common/mojo/channel_init.cc ('k') | content/common/mojo/service_registry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698