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

Unified Diff: content/browser/browser_main_loop.cc

Issue 9375017: Support sharing of ContentMain and BrowserMain code with embedded use cases (try #3). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 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 | « content/browser/browser_main_loop.h ('k') | content/browser/browser_main_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_main_loop.cc
===================================================================
--- content/browser/browser_main_loop.cc (revision 121246)
+++ content/browser/browser_main_loop.cc (working copy)
@@ -290,7 +290,9 @@
// Must first NULL pointer or we hit a DCHECK that the newly constructed
// message loop is the current one.
main_message_loop_.reset();
- main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI));
+ main_message_loop_.reset(parts_->GetMainMessageLoop());
+ if (!main_message_loop_.get())
+ main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI));
InitializeMainThread();
@@ -317,8 +319,7 @@
parts_->PostMainMessageLoopStart();
}
-void BrowserMainLoop::RunMainMessageLoopParts(
- bool* completed_main_message_loop) {
+void BrowserMainLoop::CreateThreads() {
if (parts_.get())
result_code_ = parts_->PreCreateThreads();
@@ -400,11 +401,14 @@
if (parts_.get())
parts_->PreMainMessageLoopRun();
- TRACE_EVENT_BEGIN_ETW("BrowserMain:MESSAGE_LOOP", 0, "");
// If the UI thread blocks, the whole UI is unresponsive.
// Do not allow disk IO from the UI thread.
base::ThreadRestrictions::SetIOAllowed(false);
+}
+void BrowserMainLoop::RunMainMessageLoopParts() {
+ TRACE_EVENT_BEGIN_ETW("BrowserMain:MESSAGE_LOOP", 0, "");
+
bool ran_main_loop = false;
if (parts_.get())
ran_main_loop = parts_->MainMessageLoopRun(&result_code_);
@@ -413,11 +417,6 @@
MainMessageLoopRun();
TRACE_EVENT_END_ETW("BrowserMain:MESSAGE_LOOP", 0, "");
-
- if (completed_main_message_loop)
- *completed_main_message_loop = true;
-
- ShutdownThreadsAndCleanUp();
}
void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
« no previous file with comments | « content/browser/browser_main_loop.h ('k') | content/browser/browser_main_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698