Chromium Code Reviews| Index: content/browser/browser_main_loop.cc |
| diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc |
| index 51552b6fd9868d6d94a1f8127b2a58b3876919f9..9a2f9b895a1a26bb64509ae5c935f2646c3db914 100644 |
| --- a/content/browser/browser_main_loop.cc |
| +++ b/content/browser/browser_main_loop.cc |
| @@ -46,6 +46,7 @@ |
| #include "net/base/ssl_config_service.h" |
| #include "net/socket/client_socket_factory.h" |
| #include "net/socket/tcp_client_socket.h" |
| +#include "ui/base/clipboard/clipboard.h" |
| #if defined(USE_AURA) |
| #include "content/browser/renderer_host/image_transport_factory.h" |
| @@ -236,6 +237,7 @@ BrowserMainLoop::BrowserMainLoop(const content::MainFunctionParams& parameters) |
| BrowserMainLoop::~BrowserMainLoop() { |
| DCHECK_EQ(this, g_current_browser_main_loop); |
| + ui::Clipboard::DestroyClipboardForCurrentThread(); |
| g_current_browser_main_loop = NULL; |
| } |
| @@ -472,6 +474,18 @@ void BrowserMainLoop::CreateThreads() { |
| // Do not allow disk IO from the UI thread. |
| base::ThreadRestrictions::SetIOAllowed(false); |
| base::ThreadRestrictions::DisallowWaiting(); |
| + |
| + // Alert the clipboard class to which threads are allowed to access the |
|
jam
2012/09/10 22:44:19
please move this to BrowserThreadsStarted since th
|
| + // clipboard: |
| + std::vector<base::PlatformThreadId> allowed_clipboard_threads; |
| + // The current thread is the UI thread. |
| + allowed_clipboard_threads.push_back(base::PlatformThread::CurrentId()); |
| +#if defined(OS_WIN) |
| + // On Windows, clipboards are also used on the File or IO threads. |
| + allowed_clipboard_threads.push_back(file_thread_->thread_id()); |
| + allowed_clipboard_threads.push_back(io_thread_->thread_id()); |
| +#endif |
| + ui::Clipboard::SetAllowedThreads(allowed_clipboard_threads); |
| } |
| void BrowserMainLoop::RunMainMessageLoopParts() { |