| Index: content/shell/shell_browser_main.cc
|
| diff --git a/content/shell/shell_browser_main.cc b/content/shell/shell_browser_main.cc
|
| index a3364040b13f1cc98362197c3c5660296601b4d2..2a9bd95bd9d44a5403490303ab2c7e92900d38f5 100644
|
| --- a/content/shell/shell_browser_main.cc
|
| +++ b/content/shell/shell_browser_main.cc
|
| @@ -29,41 +29,9 @@ ShellBrowserMainParts::ShellBrowserMainParts(
|
| }
|
|
|
| ShellBrowserMainParts::~ShellBrowserMainParts() {
|
| - base::ThreadRestrictions::SetIOAllowed(true);
|
| - io_thread()->message_loop()->PostTask(
|
| - FROM_HERE,
|
| - NewRunnableFunction(&base::ThreadRestrictions::SetIOAllowed, true));
|
| -
|
| - browser_context_.reset();
|
| -
|
| - resource_dispatcher_host_->download_file_manager()->Shutdown();
|
| - resource_dispatcher_host_->save_file_manager()->Shutdown();
|
| - resource_dispatcher_host_->Shutdown();
|
| - io_thread_.reset();
|
| - cache_thread_.reset();
|
| - process_launcher_thread_.reset();
|
| - file_thread_.reset();
|
| - resource_dispatcher_host_.reset(); // Kills WebKit thread.
|
| - db_thread_.reset();
|
| }
|
|
|
| -void ShellBrowserMainParts::PreMainMessageLoopRun() {
|
| - db_thread_.reset(new BrowserProcessSubThread(BrowserThread::DB));
|
| - db_thread_->Start();
|
| - file_thread_.reset(new BrowserProcessSubThread(BrowserThread::FILE));
|
| - file_thread_->Start();
|
| - process_launcher_thread_.reset(
|
| - new BrowserProcessSubThread(BrowserThread::PROCESS_LAUNCHER));
|
| - process_launcher_thread_->Start();
|
| -
|
| - base::Thread::Options options;
|
| - options.message_loop_type = MessageLoop::TYPE_IO;
|
| -
|
| - cache_thread_.reset(new BrowserProcessSubThread(BrowserThread::CACHE));
|
| - cache_thread_->StartWithOptions(options);
|
| - io_thread_.reset(new BrowserProcessSubThread(BrowserThread::IO));
|
| - io_thread_->StartWithOptions(options);
|
| -
|
| +content::IOThreadDelegate* ShellBrowserMainParts::PreMainMessageLoopRun() {
|
| browser_context_.reset(new ShellBrowserContext(this));
|
|
|
| Shell::PlatformInitialize();
|
| @@ -74,7 +42,23 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() {
|
| NULL,
|
| MSG_ROUTING_NONE,
|
| NULL);
|
| + return NULL;
|
| +}
|
| +
|
| +void ShellBrowserMainParts::PostMainMessageLoopRun() {
|
| + browser_context_.reset();
|
|
|
| + resource_dispatcher_host_->download_file_manager()->Shutdown();
|
| + resource_dispatcher_host_->save_file_manager()->Shutdown();
|
| + resource_dispatcher_host_->Shutdown();
|
| +}
|
| +
|
| +void ShellBrowserMainParts::PreStopThread(BrowserThread::ID id) {
|
| + if (id == BrowserThread::WEBKIT) {
|
| + // It remains the embedder's responsibility to kill the WebKit
|
| + // thread. This happens when RDH is destroyed.
|
| + resource_dispatcher_host_.reset();
|
| + }
|
| }
|
|
|
| bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) {
|
|
|