| OLD | NEW | 
|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.  Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.  Use of this | 
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the | 
| 3 // LICENSE file. | 3 // LICENSE file. | 
| 4 | 4 | 
| 5 #include "chrome/browser/in_process_webkit/webkit_thread.h" | 5 #include "chrome/browser/in_process_webkit/webkit_thread.h" | 
| 6 | 6 | 
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" | 
| 8 #include "chrome/browser/in_process_webkit/browser_webkitclient_impl.h" | 8 #include "chrome/browser/in_process_webkit/browser_webkitclient_impl.h" | 
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" | 
| 10 #include "webkit/api/public/WebKit.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" | 
| 11 | 11 | 
| 12 // This happens on the UI thread before the IO thread has been shut down. | 12 // This happens on the UI thread before the IO thread has been shut down. | 
| 13 WebKitThread::WebKitThread() { | 13 WebKitThread::WebKitThread() { | 
| 14   // The thread is started lazily by InitializeThread() on the IO thread. | 14   // The thread is started lazily by InitializeThread() on the IO thread. | 
| 15 } | 15 } | 
| 16 | 16 | 
| 17 // This happens on the UI thread after the IO thread has been shut down. | 17 // This happens on the UI thread after the IO thread has been shut down. | 
| 18 WebKitThread::~WebKitThread() { | 18 WebKitThread::~WebKitThread() { | 
| 19   // We can't just check CurrentlyOn(ChromeThread::UI) because in unit tests, | 19   // We can't just check CurrentlyOn(ChromeThread::UI) because in unit tests, | 
| 20   // MessageLoop::Current is sometimes NULL and other times valid and there's | 20   // MessageLoop::Current is sometimes NULL and other times valid and there's | 
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 54 MessageLoop* WebKitThread::InitializeThread() { | 54 MessageLoop* WebKitThread::InitializeThread() { | 
| 55   if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) | 55   if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) | 
| 56     return NULL; | 56     return NULL; | 
| 57 | 57 | 
| 58   DCHECK(!webkit_thread_.get()); | 58   DCHECK(!webkit_thread_.get()); | 
| 59   webkit_thread_.reset(new InternalWebKitThread); | 59   webkit_thread_.reset(new InternalWebKitThread); | 
| 60   bool started = webkit_thread_->Start(); | 60   bool started = webkit_thread_->Start(); | 
| 61   DCHECK(started); | 61   DCHECK(started); | 
| 62   return webkit_thread_->message_loop(); | 62   return webkit_thread_->message_loop(); | 
| 63 } | 63 } | 
| OLD | NEW | 
|---|