summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_process_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r--chrome/browser/browser_process_impl.cc31
1 files changed, 3 insertions, 28 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 682c491..539bf57 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -11,7 +11,6 @@
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/path_service.h"
-#include "base/task.h"
#include "base/thread.h"
#include "base/waitable_event.h"
#include "chrome/browser/appcache/chrome_appcache_service.h"
@@ -75,13 +74,6 @@
static const int kUpdateCheckIntervalHours = 6;
#endif
-#if defined(USE_X11)
-// How long to wait for the File thread to complete during EndSession, on
-// Linux. We have a timeout here because we're unable to run the UI messageloop
-// and there's some deadlock risk. Our only option is to exit anyway.
-static const int kEndSessionTimeoutSeconds = 10;
-#endif
-
BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line)
: created_resource_dispatcher_host_(false),
created_metrics_service_(false),
@@ -223,16 +215,10 @@ BrowserProcessImpl::~BrowserProcessImpl() {
g_browser_process = NULL;
}
-#if defined(OS_WIN)
// Send a QuitTask to the given MessageLoop.
static void PostQuit(MessageLoop* message_loop) {
message_loop->PostTask(FROM_HERE, new MessageLoop::QuitTask());
}
-#elif defined(USE_X11)
-static void Signal(base::WaitableEvent* event) {
- event->Signal();
-}
-#endif
unsigned int BrowserProcessImpl::AddRefModule() {
DCHECK(CalledOnValidThread());
@@ -254,9 +240,9 @@ unsigned int BrowserProcessImpl::ReleaseModule() {
}
void BrowserProcessImpl::EndSession() {
-#if defined(OS_WIN) || defined(USE_X11)
+#if defined(OS_WIN)
// Notify we are going away.
- shutdown_event_->Signal();
+ ::SetEvent(shutdown_event_->handle());
#endif
// Mark all the profiles as clean.
@@ -278,20 +264,9 @@ void BrowserProcessImpl::EndSession() {
// We must write that the profile and metrics service shutdown cleanly,
// otherwise on startup we'll think we crashed. So we block until done and
// then proceed with normal shutdown.
-#if defined(USE_X11)
- // Can't run a local loop on linux. Instead create a waitable event.
- base::WaitableEvent done_writing(false, false);
- ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE,
- NewRunnableFunction(Signal, &done_writing));
- done_writing.TimedWait(
- base::TimeDelta::FromSeconds(kEndSessionTimeoutSeconds));
-#elif defined(OS_WIN)
- ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE,
+ g_browser_process->file_thread()->message_loop()->PostTask(FROM_HERE,
NewRunnableFunction(PostQuit, MessageLoop::current()));
MessageLoop::current()->Run();
-#else
- NOTIMPLEMENTED();
-#endif
}
ResourceDispatcherHost* BrowserProcessImpl::resource_dispatcher_host() {