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

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: Added missing include 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
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 VLOG(1) << "State: " << static_cast<uint32_t>(state_);
132 DCHECK(state_ == State::STOPPED || state_ == State::STOPPING);
132 } 133 }
133 134
134 void ArcBridgeBootstrapImpl::Start() { 135 void ArcBridgeBootstrapImpl::Start() {
135 DCHECK(thread_checker_.CalledOnValidThread()); 136 DCHECK(thread_checker_.CalledOnValidThread());
136 DCHECK(delegate_); 137 DCHECK(delegate_);
137 if (state_ != State::STOPPED) { 138 if (state_ != State::STOPPED) {
138 VLOG(1) << "Start() called when instance is not stopped"; 139 VLOG(1) << "Start() called when instance is not stopped";
139 return; 140 return;
140 } 141 }
141 SetState(State::SOCKET_CREATING); 142 SetState(State::SOCKET_CREATING);
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 DCHECK(delegate_); 323 DCHECK(delegate_);
323 SetState(State::STOPPED); 324 SetState(State::STOPPED);
324 delegate_->OnStopped(); 325 delegate_->OnStopped();
325 } 326 }
326 327
327 void ArcBridgeBootstrapImpl::SetState(State state) { 328 void ArcBridgeBootstrapImpl::SetState(State state) {
328 DCHECK(thread_checker_.CalledOnValidThread()); 329 DCHECK(thread_checker_.CalledOnValidThread());
329 // DCHECK on enum classes not supported. 330 // DCHECK on enum classes not supported.
330 DCHECK(state_ != state); 331 DCHECK(state_ != state);
331 state_ = state; 332 state_ = state;
333 VLOG(2) << "State: " << static_cast<uint32_t>(state_);
332 } 334 }
333 335
334 } // namespace 336 } // namespace
335 337
336 ArcBridgeBootstrap::ArcBridgeBootstrap() {}
337
338 ArcBridgeBootstrap::~ArcBridgeBootstrap() {}
339
340 // static 338 // static
341 std::unique_ptr<ArcBridgeBootstrap> ArcBridgeBootstrap::Create() { 339 std::unique_ptr<ArcBridgeBootstrap> ArcBridgeBootstrap::Create() {
342 return base::WrapUnique(new ArcBridgeBootstrapImpl()); 340 return base::WrapUnique(new ArcBridgeBootstrapImpl());
343 } 341 }
344 342
345 } // namespace arc 343 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698