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

Side by Side Diff: chromecast/service/cast_service.cc

Issue 608093002: Chromecast: adds callback for CastService to control metrics state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cast-network-delegate
Patch Set: rebase Created 6 years, 2 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 | « chromecast/service/cast_service.h ('k') | chromecast/service/cast_service_android.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromecast/service/cast_service.h" 5 #include "chromecast/service/cast_service.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/threading/thread_checker.h" 8 #include "base/threading/thread_checker.h"
9 9
10 namespace chromecast { 10 namespace chromecast {
11 11
12 CastService::CastService(content::BrowserContext* browser_context) 12 CastService::CastService(
13 content::BrowserContext* browser_context,
14 const OptInStatsChangedCallback& opt_in_stats_callback)
13 : browser_context_(browser_context), 15 : browser_context_(browser_context),
16 opt_in_stats_callback_(opt_in_stats_callback),
14 stopped_(true), 17 stopped_(true),
15 thread_checker_(new base::ThreadChecker()) { 18 thread_checker_(new base::ThreadChecker()) {
16 } 19 }
17 20
18 CastService::~CastService() { 21 CastService::~CastService() {
19 DCHECK(thread_checker_->CalledOnValidThread()); 22 DCHECK(thread_checker_->CalledOnValidThread());
20 DCHECK(stopped_); 23 DCHECK(stopped_);
21 } 24 }
22 25
23 void CastService::Start() { 26 void CastService::Start() {
24 DCHECK(thread_checker_->CalledOnValidThread()); 27 DCHECK(thread_checker_->CalledOnValidThread());
25 28
26 Initialize(); 29 Initialize();
27 stopped_ = false; 30 stopped_ = false;
28 StartInternal(); 31 StartInternal();
29 } 32 }
30 33
31 void CastService::Stop() { 34 void CastService::Stop() {
32 DCHECK(thread_checker_->CalledOnValidThread()); 35 DCHECK(thread_checker_->CalledOnValidThread());
33 StopInternal(); 36 StopInternal();
34 stopped_ = true; 37 stopped_ = true;
35 } 38 }
36 39
37 } // namespace chromecast 40 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/service/cast_service.h ('k') | chromecast/service/cast_service_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698