diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-20 06:07:11 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-20 06:07:11 +0000 |
commit | 03d8d3e9148647efc149147eb2dbb0b4d38958a5 (patch) | |
tree | 0d850be5541519dbfd78e0f5dff5ea5e1fe09a46 | |
parent | 3ee56bc239d1aaacd5fb56c4a9bcb82880311bd5 (diff) | |
download | chromium_src-03d8d3e9148647efc149147eb2dbb0b4d38958a5.zip chromium_src-03d8d3e9148647efc149147eb2dbb0b4d38958a5.tar.gz chromium_src-03d8d3e9148647efc149147eb2dbb0b4d38958a5.tar.bz2 |
Get rid of content::DidEndMainMessageLoop since it was declared in content but defined in chrome, and called by chrome.
Review URL: http://codereview.chromium.org/7948006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101924 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser_process_impl.cc | 8 | ||||
-rw-r--r-- | chrome/browser/chrome_browser_main_gtk.cc | 7 | ||||
-rw-r--r-- | chrome/browser/chrome_browser_main_mac.h | 4 | ||||
-rw-r--r-- | chrome/browser/chrome_browser_main_mac.mm | 14 | ||||
-rw-r--r-- | chrome/browser/chrome_browser_main_win.cc | 8 | ||||
-rw-r--r-- | content/browser/browser_main.cc | 8 | ||||
-rw-r--r-- | content/browser/browser_main.h | 6 |
7 files changed, 22 insertions, 33 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 9f4d82f..858e572 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -90,6 +90,8 @@ #if defined(OS_WIN) #include "views/focus/view_storage.h" +#elif defined(OS_MACOSX) +#include "chrome/browser/chrome_browser_main_mac.h" #endif #if defined(IPC_MESSAGE_LOG_ENABLED) @@ -319,8 +321,12 @@ unsigned int BrowserProcessImpl::ReleaseModule() { io_thread()->message_loop()->PostTask( FROM_HERE, NewRunnableFunction(&base::ThreadRestrictions::SetIOAllowed, true)); + +#if defined(OS_MACOSX) MessageLoop::current()->PostTask( - FROM_HERE, NewRunnableFunction(content::DidEndMainMessageLoop)); + FROM_HERE, + NewRunnableFunction(ChromeBrowserMainPartsMac::DidEndMainMessageLoop)); +#endif MessageLoop::current()->Quit(); } return module_ref_count_; diff --git a/chrome/browser/chrome_browser_main_gtk.cc b/chrome/browser/chrome_browser_main_gtk.cc index c3a327c..58731bb 100644 --- a/chrome/browser/chrome_browser_main_gtk.cc +++ b/chrome/browser/chrome_browser_main_gtk.cc @@ -130,13 +130,6 @@ void ChromeBrowserMainPartsGtk::DetectRunningAsRoot() { #endif } -namespace content { - -void DidEndMainMessageLoop() { -} - -} - void RecordBreakpadStatusUMA(MetricsService* metrics) { #if defined(USE_LINUX_BREAKPAD) metrics->RecordBreakpadRegistration(IsCrashReporterEnabled()); diff --git a/chrome/browser/chrome_browser_main_mac.h b/chrome/browser/chrome_browser_main_mac.h index 45e68de..cf71045 100644 --- a/chrome/browser/chrome_browser_main_mac.h +++ b/chrome/browser/chrome_browser_main_mac.h @@ -14,6 +14,10 @@ class ChromeBrowserMainPartsMac : public ChromeBrowserMainPartsPosix { virtual void PreEarlyInitialization() OVERRIDE; virtual void PreMainMessageLoopStart() OVERRIDE; + + // Perform platform-specific work that needs to be done after the main event + // loop has ended. The embedder must be sure to call this. + static void DidEndMainMessageLoop(); }; #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_MAC_H_ diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm index c208d32..1873eae 100644 --- a/chrome/browser/chrome_browser_main_mac.mm +++ b/chrome/browser/chrome_browser_main_mac.mm @@ -24,15 +24,6 @@ #include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/resource/resource_bundle.h" -namespace content { - -void DidEndMainMessageLoop() { - AppController* appController = [NSApp delegate]; - [appController didEndMainMessageLoop]; -} - -} - void RecordBreakpadStatusUMA(MetricsService* metrics) { metrics->RecordBreakpadRegistration(IsCrashReporterEnabled()); metrics->RecordBreakpadHasDebugger(base::debug::BeingDebugged()); @@ -136,3 +127,8 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() { [[NSUserDefaults standardUserDefaults] setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"]; } + +void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { + AppController* appController = [NSApp delegate]; + [appController didEndMainMessageLoop]; +} diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc index 33b59a4..3097018 100644 --- a/chrome/browser/chrome_browser_main_win.cc +++ b/chrome/browser/chrome_browser_main_win.cc @@ -39,14 +39,6 @@ #include "views/focus/accelerator_handler.h" #include "views/widget/widget.h" -namespace content { - -void DidEndMainMessageLoop() { - OleUninitialize(); -} - -} - namespace { typedef HRESULT (STDAPICALLTYPE* RegisterApplicationRestartProc)( diff --git a/content/browser/browser_main.cc b/content/browser/browser_main.cc index 9171a01..29cee15 100644 --- a/content/browser/browser_main.cc +++ b/content/browser/browser_main.cc @@ -164,9 +164,15 @@ BrowserMainParts::BrowserMainParts(const MainFunctionParams& parameters) : parameters_(parameters), parsed_command_line_(parameters.command_line_), result_code_(content::RESULT_CODE_NORMAL_EXIT) { +#if defined(OS_WIN) + OleInitialize(NULL); +#endif } BrowserMainParts::~BrowserMainParts() { +#if defined(OS_WIN) + OleUninitialize(); +#endif } void BrowserMainParts::EarlyInitialization() { @@ -219,8 +225,6 @@ void BrowserMainParts::MainMessageLoopStart() { PreMainMessageLoopStart(); #if defined(OS_WIN) - OleInitialize(NULL); - // If we're running tests (ui_task is non-null), then the ResourceBundle // has already been initialized. if (!parameters().ui_task) { diff --git a/content/browser/browser_main.h b/content/browser/browser_main.h index 141fe1f..f45c72b 100644 --- a/content/browser/browser_main.h +++ b/content/browser/browser_main.h @@ -125,12 +125,6 @@ class CONTENT_EXPORT BrowserMainParts { DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); }; -// Perform platform-specific work that needs to be done after the main event -// loop has ended. The embedder must be sure to call this. -// TODO(jam): change this so that content calls it so that we don't depend on -// the embedder. -void DidEndMainMessageLoop(); - } // namespace content #endif // CONTENT_BROWSER_BROWSER_MAIN_H_ |