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

Unified Diff: chromecast/shell/browser/cast_browser_main_parts.cc

Issue 521753002: Chromecast: adds CastBrowserProcess to manage browser process entities. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed obsolete member Created 6 years, 4 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/shell/browser/cast_browser_main_parts.h ('k') | chromecast/shell/browser/cast_browser_process.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/shell/browser/cast_browser_main_parts.cc
diff --git a/chromecast/shell/browser/cast_browser_main_parts.cc b/chromecast/shell/browser/cast_browser_main_parts.cc
index 8b98918dc9ef01baeeee2c9e3fd53880fbdb50b8..3f7b358349eab5b9963073d880ef7d9f71bff842 100644
--- a/chromecast/shell/browser/cast_browser_main_parts.cc
+++ b/chromecast/shell/browser/cast_browser_main_parts.cc
@@ -12,6 +12,7 @@
#include "chromecast/net/network_change_notifier_factory_cast.h"
#include "chromecast/service/cast_service.h"
#include "chromecast/shell/browser/cast_browser_context.h"
+#include "chromecast/shell/browser/cast_browser_process.h"
#include "chromecast/shell/browser/devtools/remote_debugging_server.h"
#include "chromecast/shell/browser/url_request_context_factory.h"
#include "chromecast/shell/browser/webui/webui_cast.h"
@@ -49,6 +50,7 @@ CastBrowserMainParts::CastBrowserMainParts(
const content::MainFunctionParams& parameters,
URLRequestContextFactory* url_request_context_factory)
: BrowserMainParts(),
+ cast_browser_process_(new CastBrowserProcess()),
url_request_context_factory_(url_request_context_factory) {
CommandLine* command_line = CommandLine::ForCurrentProcess();
AddDefaultCommandLineSwitches(command_line);
@@ -74,16 +76,19 @@ int CastBrowserMainParts::PreCreateThreads() {
void CastBrowserMainParts::PreMainMessageLoopRun() {
url_request_context_factory_->InitializeOnUIThread();
- browser_context_.reset(new CastBrowserContext(url_request_context_factory_));
- metrics_service_client_.reset(metrics::CastMetricsServiceClient::Create(
- ChromecastConfig::GetInstance()->pref_service(),
- browser_context_->GetRequestContext()));
- dev_tools_.reset(new RemoteDebuggingServer());
+ cast_browser_process_->SetBrowserContext(
+ new CastBrowserContext(url_request_context_factory_));
+ cast_browser_process_->SetMetricsServiceClient(
+ metrics::CastMetricsServiceClient::Create(
+ ChromecastConfig::GetInstance()->pref_service(),
+ cast_browser_process_->browser_context()->GetRequestContext()));
+ cast_browser_process_->SetRemoteDebuggingServer(new RemoteDebuggingServer());
InitializeWebUI();
- cast_service_.reset(CastService::Create(browser_context_.get()));
- cast_service_->Start();
+ cast_browser_process_->SetCastService(
+ CastService::Create(cast_browser_process_->browser_context()));
+ cast_browser_process_->cast_service()->Start();
}
bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) {
@@ -92,12 +97,8 @@ bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) {
}
void CastBrowserMainParts::PostMainMessageLoopRun() {
- cast_service_->Stop();
-
- cast_service_.reset();
- dev_tools_.reset();
- metrics_service_client_.reset();
- browser_context_.reset();
+ cast_browser_process_->cast_service()->Stop();
+ cast_browser_process_.reset();
}
} // namespace shell
« no previous file with comments | « chromecast/shell/browser/cast_browser_main_parts.h ('k') | chromecast/shell/browser/cast_browser_process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698