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

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

Issue 1327723002: [Chromecast] Raises CastService creation to CastContentBrowserClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: removed unnecessary include Created 5 years, 3 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 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/browser/service/cast_service.h" 5 #include "chromecast/browser/service/cast_service.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/threading/thread_checker.h" 9 #include "base/threading/thread_checker.h"
10 10
11 namespace chromecast { 11 namespace chromecast {
12 12
13 CastService::CastService( 13 CastService::CastService(
14 content::BrowserContext* browser_context, 14 content::BrowserContext* browser_context,
15 PrefService* pref_service, 15 PrefService* pref_service)
16 metrics::CastMetricsServiceClient* metrics_service_client)
17 : browser_context_(browser_context), 16 : browser_context_(browser_context),
18 pref_service_(pref_service), 17 pref_service_(pref_service),
19 metrics_service_client_(metrics_service_client),
20 stopped_(true), 18 stopped_(true),
21 thread_checker_(new base::ThreadChecker()) { 19 thread_checker_(new base::ThreadChecker()) {
22 } 20 }
23 21
24 CastService::~CastService() { 22 CastService::~CastService() {
25 DCHECK(thread_checker_->CalledOnValidThread()); 23 DCHECK(thread_checker_->CalledOnValidThread());
26 DCHECK(stopped_); 24 DCHECK(stopped_);
27 } 25 }
28 26
29 void CastService::Initialize() { 27 void CastService::Initialize() {
(...skipping 15 matching lines...) Expand all
45 void CastService::Stop() { 43 void CastService::Stop() {
46 DCHECK(thread_checker_->CalledOnValidThread()); 44 DCHECK(thread_checker_->CalledOnValidThread());
47 StopInternal(); 45 StopInternal();
48 // Consume any pending tasks which should be done before destroying in-process 46 // Consume any pending tasks which should be done before destroying in-process
49 // renderer process, for example, destroying web_contents. 47 // renderer process, for example, destroying web_contents.
50 base::RunLoop().RunUntilIdle(); 48 base::RunLoop().RunUntilIdle();
51 stopped_ = true; 49 stopped_ = true;
52 } 50 }
53 51
54 } // namespace chromecast 52 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/browser/service/cast_service.h ('k') | chromecast/browser/service/cast_service_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698