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

Side by Side Diff: components/arc/arc_bridge_bootstrap.cc

Issue 1925183004: arc_bridge: Add more logging, plus cleanup (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Fixed unit tests 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 | « components/arc/arc_bridge_bootstrap.h ('k') | components/arc/arc_bridge_service.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 "components/arc/arc_bridge_bootstrap.h" 5 #include "components/arc/arc_bridge_bootstrap.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <grp.h> 8 #include <grp.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 10
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 base::WeakPtrFactory<ArcBridgeBootstrapImpl> weak_factory_; 121 base::WeakPtrFactory<ArcBridgeBootstrapImpl> weak_factory_;
122 122
123 private: 123 private:
124 DISALLOW_COPY_AND_ASSIGN(ArcBridgeBootstrapImpl); 124 DISALLOW_COPY_AND_ASSIGN(ArcBridgeBootstrapImpl);
125 }; 125 };
126 126
127 ArcBridgeBootstrapImpl::ArcBridgeBootstrapImpl() : weak_factory_(this) {} 127 ArcBridgeBootstrapImpl::ArcBridgeBootstrapImpl() : weak_factory_(this) {}
128 128
129 ArcBridgeBootstrapImpl::~ArcBridgeBootstrapImpl() { 129 ArcBridgeBootstrapImpl::~ArcBridgeBootstrapImpl() {
130 DCHECK(thread_checker_.CalledOnValidThread()); 130 DCHECK(thread_checker_.CalledOnValidThread());
131 DCHECK(state_ == State::STOPPED); 131 DCHECK(state_ == State::STOPPED || state_ == State::STOPPING);
132 } 132 }
133 133
134 void ArcBridgeBootstrapImpl::Start() { 134 void ArcBridgeBootstrapImpl::Start() {
135 DCHECK(thread_checker_.CalledOnValidThread()); 135 DCHECK(thread_checker_.CalledOnValidThread());
136 DCHECK(delegate_); 136 DCHECK(delegate_);
137 if (state_ != State::STOPPED) { 137 if (state_ != State::STOPPED) {
138 VLOG(1) << "Start() called when instance is not stopped"; 138 VLOG(1) << "Start() called when instance is not stopped";
139 return; 139 return;
140 } 140 }
141 SetState(State::SOCKET_CREATING); 141 SetState(State::SOCKET_CREATING);
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 DCHECK(delegate_); 322 DCHECK(delegate_);
323 SetState(State::STOPPED); 323 SetState(State::STOPPED);
324 delegate_->OnStopped(); 324 delegate_->OnStopped();
325 } 325 }
326 326
327 void ArcBridgeBootstrapImpl::SetState(State state) { 327 void ArcBridgeBootstrapImpl::SetState(State state) {
328 DCHECK(thread_checker_.CalledOnValidThread()); 328 DCHECK(thread_checker_.CalledOnValidThread());
329 // DCHECK on enum classes not supported. 329 // DCHECK on enum classes not supported.
330 DCHECK(state_ != state); 330 DCHECK(state_ != state);
331 state_ = state; 331 state_ = state;
332 VLOG(2) << "State: " << static_cast<uint32_t>(state_);
332 } 333 }
333 334
334 } // namespace 335 } // namespace
335 336
336 ArcBridgeBootstrap::ArcBridgeBootstrap() {}
337
338 ArcBridgeBootstrap::~ArcBridgeBootstrap() {}
339
340 // static 337 // static
341 std::unique_ptr<ArcBridgeBootstrap> ArcBridgeBootstrap::Create() { 338 std::unique_ptr<ArcBridgeBootstrap> ArcBridgeBootstrap::Create() {
342 return base::WrapUnique(new ArcBridgeBootstrapImpl()); 339 return base::WrapUnique(new ArcBridgeBootstrapImpl());
343 } 340 }
344 341
345 } // namespace arc 342 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/arc_bridge_bootstrap.h ('k') | components/arc/arc_bridge_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698