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

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

Issue 2552213002: Remove explicit singletonness of ArcBridgeService part 1. (Closed)
Patch Set: git cl format Created 4 years 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_host_impl.cc ('k') | components/arc/arc_session.h » ('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_service_impl.h" 5 #include "components/arc/arc_bridge_service_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 13 matching lines...) Expand all
24 24
25 extern ArcBridgeService* g_arc_bridge_service; 25 extern ArcBridgeService* g_arc_bridge_service;
26 26
27 namespace { 27 namespace {
28 constexpr int64_t kReconnectDelayInSeconds = 5; 28 constexpr int64_t kReconnectDelayInSeconds = 5;
29 } // namespace 29 } // namespace
30 30
31 ArcBridgeServiceImpl::ArcBridgeServiceImpl( 31 ArcBridgeServiceImpl::ArcBridgeServiceImpl(
32 const scoped_refptr<base::TaskRunner>& blocking_task_runner) 32 const scoped_refptr<base::TaskRunner>& blocking_task_runner)
33 : session_started_(false), 33 : session_started_(false),
34 factory_(base::Bind(ArcSession::Create, blocking_task_runner)), 34 factory_(base::Bind(ArcSession::Create, this, blocking_task_runner)),
35 weak_factory_(this) { 35 weak_factory_(this) {
36 DCHECK(!g_arc_bridge_service); 36 DCHECK(!g_arc_bridge_service);
37 g_arc_bridge_service = this; 37 g_arc_bridge_service = this;
38 } 38 }
39 39
40 ArcBridgeServiceImpl::~ArcBridgeServiceImpl() { 40 ArcBridgeServiceImpl::~ArcBridgeServiceImpl() {
41 if (arc_session_) 41 if (arc_session_)
42 arc_session_->RemoveObserver(this); 42 arc_session_->RemoveObserver(this);
43 43
44 DCHECK(g_arc_bridge_service == this); 44 DCHECK(g_arc_bridge_service == this);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 weak_factory_.GetWeakPtr()), 164 weak_factory_.GetWeakPtr()),
165 base::TimeDelta::FromSeconds(kReconnectDelayInSeconds)); 165 base::TimeDelta::FromSeconds(kReconnectDelayInSeconds));
166 } else { 166 } else {
167 // Restart immediately. 167 // Restart immediately.
168 PrerequisitesChanged(); 168 PrerequisitesChanged();
169 } 169 }
170 } 170 }
171 } 171 }
172 172
173 } // namespace arc 173 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/arc_bridge_host_impl.cc ('k') | components/arc/arc_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698