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

Unified Diff: chromecast/service/cast_service_simple.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromecast/service/cast_service_simple.h ('k') | chromecast/shell/browser/cast_browser_main_parts.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/service/cast_service_simple.cc
diff --git a/chromecast/service/cast_service.cc b/chromecast/service/cast_service_simple.cc
similarity index 84%
copy from chromecast/service/cast_service.cc
copy to chromecast/service/cast_service_simple.cc
index f072523c460bb883fbf98487741f5d84e26d2e50..16b14b6016f3142281143ff6baf7f758df42d77d 100644
--- a/chromecast/service/cast_service.cc
+++ b/chromecast/service/cast_service_simple.cc
@@ -2,12 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chromecast/service/cast_service.h"
+#include "chromecast/service/cast_service_simple.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/macros.h"
-#include "base/threading/thread_checker.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "net/base/filename_util.h"
@@ -69,26 +68,22 @@ class FillLayout : public aura::LayoutManager {
} // namespace
-CastService::CastService(content::BrowserContext* browser_context)
- : browser_context_(browser_context),
- stopped_(true),
- thread_checker_(new base::ThreadChecker()) {
+// static
+CastService* CastService::Create(content::BrowserContext* browser_context) {
+ return new CastServiceSimple(browser_context);
}
-CastService::~CastService() {
- DCHECK(thread_checker_->CalledOnValidThread());
- DCHECK(stopped_);
+CastServiceSimple::CastServiceSimple(content::BrowserContext* browser_context)
+ : CastService(browser_context) {
}
-void CastService::Initialize() {
- PlatformInitialize();
+CastServiceSimple::~CastServiceSimple() {
}
-void CastService::Start() {
- DCHECK(thread_checker_->CalledOnValidThread());
-
- Initialize();
+void CastServiceSimple::Initialize() {
+}
+void CastServiceSimple::StartInternal() {
// Aura initialization
gfx::Size initial_size = gfx::Size(1280, 720);
// TODO(lcwu): http://crbug.com/391074. Chromecast only needs a minimal
@@ -105,7 +100,7 @@ void CastService::Start() {
window_tree_host_->Show();
// Create a WebContents
- content::WebContents::CreateParams create_params(browser_context_, NULL);
+ content::WebContents::CreateParams create_params(browser_context(), NULL);
create_params.routing_id = MSG_ROUTING_NONE;
create_params.initial_size = initial_size;
web_contents_.reset(content::WebContents::Create(create_params));
@@ -122,19 +117,14 @@ void CastService::Start() {
content::Referrer(),
content::PAGE_TRANSITION_TYPED,
std::string());
-
- stopped_ = false;
}
-void CastService::Stop() {
- DCHECK(thread_checker_->CalledOnValidThread());
-
+void CastServiceSimple::StopInternal() {
web_contents_->GetRenderViewHost()->ClosePage();
window_tree_host_.reset();
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, NULL);
aura::Env::DeleteInstance();
web_contents_.reset();
- stopped_ = true;
}
} // namespace chromecast
« no previous file with comments | « chromecast/service/cast_service_simple.h ('k') | chromecast/shell/browser/cast_browser_main_parts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698