Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/shell/shell_browser_main.h" | 5 #include "content/shell/shell_browser_main.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
| 9 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
| 10 #include "content/browser/browser_process_sub_thread.h" | 10 #include "content/browser/browser_process_sub_thread.h" |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 io_thread()->message_loop()->PostTask( | 33 io_thread()->message_loop()->PostTask( |
| 34 FROM_HERE, | 34 FROM_HERE, |
| 35 NewRunnableFunction(&base::ThreadRestrictions::SetIOAllowed, true)); | 35 NewRunnableFunction(&base::ThreadRestrictions::SetIOAllowed, true)); |
| 36 | 36 |
| 37 browser_context_.reset(); | 37 browser_context_.reset(); |
| 38 | 38 |
| 39 resource_dispatcher_host_->download_file_manager()->Shutdown(); | 39 resource_dispatcher_host_->download_file_manager()->Shutdown(); |
| 40 resource_dispatcher_host_->save_file_manager()->Shutdown(); | 40 resource_dispatcher_host_->save_file_manager()->Shutdown(); |
| 41 resource_dispatcher_host_->Shutdown(); | 41 resource_dispatcher_host_->Shutdown(); |
| 42 io_thread_.reset(); | 42 io_thread_.reset(); |
| 43 appcache_thread_.reset(); | |
| 43 cache_thread_.reset(); | 44 cache_thread_.reset(); |
| 44 process_launcher_thread_.reset(); | 45 process_launcher_thread_.reset(); |
| 45 file_thread_.reset(); | 46 file_thread_.reset(); |
| 46 resource_dispatcher_host_.reset(); // Kills WebKit thread. | 47 resource_dispatcher_host_.reset(); // Kills WebKit thread. |
| 47 db_thread_.reset(); | 48 db_thread_.reset(); |
| 48 } | 49 } |
| 49 | 50 |
| 50 void ShellBrowserMainParts::PreMainMessageLoopRun() { | 51 void ShellBrowserMainParts::PreMainMessageLoopRun() { |
| 51 db_thread_.reset(new BrowserProcessSubThread(BrowserThread::DB)); | 52 db_thread_.reset(new BrowserProcessSubThread(BrowserThread::DB)); |
| 52 db_thread_->Start(); | 53 db_thread_->Start(); |
| 53 file_thread_.reset(new BrowserProcessSubThread(BrowserThread::FILE)); | 54 file_thread_.reset(new BrowserProcessSubThread(BrowserThread::FILE)); |
| 54 file_thread_->Start(); | 55 file_thread_->Start(); |
| 55 process_launcher_thread_.reset( | 56 process_launcher_thread_.reset( |
| 56 new BrowserProcessSubThread(BrowserThread::PROCESS_LAUNCHER)); | 57 new BrowserProcessSubThread(BrowserThread::PROCESS_LAUNCHER)); |
| 57 process_launcher_thread_->Start(); | 58 process_launcher_thread_->Start(); |
| 58 | 59 |
| 59 base::Thread::Options options; | 60 base::Thread::Options options; |
| 60 options.message_loop_type = MessageLoop::TYPE_IO; | 61 options.message_loop_type = MessageLoop::TYPE_IO; |
| 61 | 62 |
| 62 cache_thread_.reset(new BrowserProcessSubThread(BrowserThread::CACHE)); | 63 cache_thread_.reset(new BrowserProcessSubThread(BrowserThread::CACHE)); |
| 63 cache_thread_->StartWithOptions(options); | 64 cache_thread_->StartWithOptions(options); |
| 65 appcache_thread_.reset(new BrowserProcessSubThread(BrowserThread::APPCACHE)); | |
|
rvargas (doing something else)
2011/10/21 19:46:17
and here
| |
| 66 appcache_thread_->Start(); | |
| 64 io_thread_.reset(new BrowserProcessSubThread(BrowserThread::IO)); | 67 io_thread_.reset(new BrowserProcessSubThread(BrowserThread::IO)); |
| 65 io_thread_->StartWithOptions(options); | 68 io_thread_->StartWithOptions(options); |
| 66 | 69 |
| 67 browser_context_.reset(new ShellBrowserContext(this)); | 70 browser_context_.reset(new ShellBrowserContext(this)); |
| 68 | 71 |
| 69 Shell::PlatformInitialize(); | 72 Shell::PlatformInitialize(); |
| 70 net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider); | 73 net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider); |
| 71 | 74 |
| 72 Shell::CreateNewWindow(browser_context_.get(), | 75 Shell::CreateNewWindow(browser_context_.get(), |
| 73 GURL("http://www.google.com"), | 76 GURL("http://www.google.com"), |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 86 return resource_dispatcher_host_.get(); | 89 return resource_dispatcher_host_.get(); |
| 87 } | 90 } |
| 88 | 91 |
| 89 ui::Clipboard* ShellBrowserMainParts::GetClipboard() { | 92 ui::Clipboard* ShellBrowserMainParts::GetClipboard() { |
| 90 if (!clipboard_.get()) | 93 if (!clipboard_.get()) |
| 91 clipboard_.reset(new ui::Clipboard()); | 94 clipboard_.reset(new ui::Clipboard()); |
| 92 return clipboard_.get(); | 95 return clipboard_.get(); |
| 93 } | 96 } |
| 94 | 97 |
| 95 } // namespace | 98 } // namespace |
| OLD | NEW |