summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/chrome_browser_main.cc4
-rw-r--r--chrome/browser/chrome_browser_main.h1
-rw-r--r--chrome_frame/test/net/fake_external_tab.cc4
-rw-r--r--chrome_frame/test/net/fake_external_tab.h1
-rw-r--r--content/browser/browser_main_loop.cc10
-rw-r--r--content/public/browser/browser_main_parts.h6
-rw-r--r--content/shell/shell_browser_main_parts.cc4
-rw-r--r--content/shell/shell_browser_main_parts.h1
8 files changed, 4 insertions, 27 deletions
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 3cca0dd..10cc98f 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -1088,10 +1088,6 @@ void ChromeBrowserMainParts::PreMainMessageLoopStart() {
chrome_extra_parts_[i]->PreMainMessageLoopStart();
}
-MessageLoop* ChromeBrowserMainParts::GetMainMessageLoop() {
- return NULL;
-}
-
void ChromeBrowserMainParts::PostMainMessageLoopStart() {
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PostMainMessageLoopStart();
diff --git a/chrome/browser/chrome_browser_main.h b/chrome/browser/chrome_browser_main.h
index 2f75057..8f761260 100644
--- a/chrome/browser/chrome_browser_main.h
+++ b/chrome/browser/chrome_browser_main.h
@@ -64,7 +64,6 @@ class ChromeBrowserMainParts : public content::BrowserMainParts {
virtual void PostEarlyInitialization() OVERRIDE;
virtual void ToolkitInitialized() OVERRIDE;
virtual void PreMainMessageLoopStart() OVERRIDE;
- virtual MessageLoop* GetMainMessageLoop() OVERRIDE;
virtual void PostMainMessageLoopStart() OVERRIDE;
virtual int PreCreateThreads() OVERRIDE;
virtual void PreMainMessageLoopRun() OVERRIDE;
diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc
index 1fb0126..aa88758 100644
--- a/chrome_frame/test/net/fake_external_tab.cc
+++ b/chrome_frame/test/net/fake_external_tab.cc
@@ -754,10 +754,6 @@ void CFUrlRequestUnittestRunner::PreEarlyInitialization() {
StartFileLogger();
}
-MessageLoop* CFUrlRequestUnittestRunner::GetMainMessageLoop() {
- return NULL;
-}
-
int CFUrlRequestUnittestRunner::PreCreateThreads() {
fake_chrome_.reset(new FakeExternalTab());
fake_chrome_->Initialize();
diff --git a/chrome_frame/test/net/fake_external_tab.h b/chrome_frame/test/net/fake_external_tab.h
index cd92dc0..69d5663 100644
--- a/chrome_frame/test/net/fake_external_tab.h
+++ b/chrome_frame/test/net/fake_external_tab.h
@@ -109,7 +109,6 @@ class CFUrlRequestUnittestRunner
virtual void PreEarlyInitialization() OVERRIDE;
virtual void PostEarlyInitialization() OVERRIDE {}
virtual void PreMainMessageLoopStart() OVERRIDE {}
- virtual MessageLoop* GetMainMessageLoop() OVERRIDE;
virtual void PostMainMessageLoopStart() OVERRIDE {}
virtual void ToolkitInitialized() OVERRIDE {}
virtual int PreCreateThreads() OVERRIDE;
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index b716f78..87baea5 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -308,11 +308,8 @@ void BrowserMainLoop::MainMessageLoopStart() {
}
#endif
- // 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(parts_->GetMainMessageLoop());
- if (!main_message_loop_.get())
+ // Create a MessageLoop if one does not already exist for the current thread.
+ if (!MessageLoop::current())
main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI));
InitializeMainThread();
@@ -585,7 +582,8 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
void BrowserMainLoop::InitializeMainThread() {
const char* kThreadName = "CrBrowserMain";
base::PlatformThread::SetName(kThreadName);
- main_message_loop_->set_thread_name(kThreadName);
+ if (main_message_loop_.get())
+ main_message_loop_->set_thread_name(kThreadName);
// Register the main thread by instantiating it, but don't call any methods.
main_thread_.reset(new BrowserThreadImpl(BrowserThread::UI,
diff --git a/content/public/browser/browser_main_parts.h b/content/public/browser/browser_main_parts.h
index 0917581..919e03e 100644
--- a/content/public/browser/browser_main_parts.h
+++ b/content/public/browser/browser_main_parts.h
@@ -10,8 +10,6 @@
#include "content/common/content_export.h"
#include "content/public/browser/browser_thread.h"
-class MessageLoop;
-
namespace content {
// This class contains different "stages" to be executed by |BrowserMain()|,
@@ -62,10 +60,6 @@ class CONTENT_EXPORT BrowserMainParts {
virtual void PreMainMessageLoopStart() = 0;
- // Return the main message loop object or NULL to use the default message
- // loop object.
- virtual MessageLoop* GetMainMessageLoop() = 0;
-
virtual void PostMainMessageLoopStart() = 0;
// Allows an embedder to do any extra toolkit initialization.
diff --git a/content/shell/shell_browser_main_parts.cc b/content/shell/shell_browser_main_parts.cc
index 0173023..a3fb53c 100644
--- a/content/shell/shell_browser_main_parts.cc
+++ b/content/shell/shell_browser_main_parts.cc
@@ -44,10 +44,6 @@ void ShellBrowserMainParts::PreMainMessageLoopStart() {
}
#endif
-MessageLoop* ShellBrowserMainParts::GetMainMessageLoop() {
- return NULL;
-}
-
int ShellBrowserMainParts::PreCreateThreads() {
return 0;
}
diff --git a/content/shell/shell_browser_main_parts.h b/content/shell/shell_browser_main_parts.h
index 849d3c3..c6d6f06 100644
--- a/content/shell/shell_browser_main_parts.h
+++ b/content/shell/shell_browser_main_parts.h
@@ -33,7 +33,6 @@ class ShellBrowserMainParts : public BrowserMainParts {
virtual void PreEarlyInitialization() OVERRIDE {}
virtual void PostEarlyInitialization() OVERRIDE {}
virtual void PreMainMessageLoopStart() OVERRIDE;
- virtual MessageLoop* GetMainMessageLoop() OVERRIDE;
virtual void PostMainMessageLoopStart() OVERRIDE {}
virtual void ToolkitInitialized() OVERRIDE {}
virtual int PreCreateThreads() OVERRIDE;