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

Side by Side Diff: chromecast/shell/browser/cast_browser_main_parts.cc

Issue 397143003: Build-level separation of default CastService implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chromecast-resource-fix
Patch Set: addressing damienv's comments Created 6 years, 5 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_simple.cc ('k') | no next file » | 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/shell/browser/cast_browser_main_parts.h" 5 #include "chromecast/shell/browser/cast_browser_main_parts.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chromecast/net/network_change_notifier_cast.h" 8 #include "chromecast/net/network_change_notifier_cast.h"
9 #include "chromecast/net/network_change_notifier_factory_cast.h" 9 #include "chromecast/net/network_change_notifier_factory_cast.h"
10 #include "chromecast/service/cast_service.h" 10 #include "chromecast/service/cast_service.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 int CastBrowserMainParts::PreCreateThreads() { 71 int CastBrowserMainParts::PreCreateThreads() {
72 return 0; 72 return 0;
73 } 73 }
74 74
75 void CastBrowserMainParts::PreMainMessageLoopRun() { 75 void CastBrowserMainParts::PreMainMessageLoopRun() {
76 url_request_context_factory_->InitializeOnUIThread(); 76 url_request_context_factory_->InitializeOnUIThread();
77 77
78 browser_context_.reset(new CastBrowserContext(url_request_context_factory_)); 78 browser_context_.reset(new CastBrowserContext(url_request_context_factory_));
79 79
80 cast_service_.reset(new CastService(browser_context_.get())); 80 cast_service_.reset(CastService::Create(browser_context_.get()));
81 cast_service_->Start(); 81 cast_service_->Start();
82 } 82 }
83 83
84 bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) { 84 bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) {
85 base::MessageLoopForUI::current()->Run(); 85 base::MessageLoopForUI::current()->Run();
86 return true; 86 return true;
87 } 87 }
88 88
89 void CastBrowserMainParts::PostMainMessageLoopRun() { 89 void CastBrowserMainParts::PostMainMessageLoopRun() {
90 cast_service_->Stop(); 90 cast_service_->Stop();
91 browser_context_.reset(); 91 browser_context_.reset();
92 } 92 }
93 93
94 // static 94 // static
95 CastBrowserMainParts* CastBrowserMainParts::GetInstance() { 95 CastBrowserMainParts* CastBrowserMainParts::GetInstance() {
96 DCHECK(instance_ != NULL); 96 DCHECK(instance_ != NULL);
97 return instance_; 97 return instance_;
98 } 98 }
99 99
100 } // namespace shell 100 } // namespace shell
101 } // namespace chromecast 101 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/service/cast_service_simple.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698