Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: chrome/browser/in_process_webkit/webkit_thread.cc

Issue 345028: Fix several MAJOR crashers in Chrome+LocalStorage/Extensions. Need to explic... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "webkit/api/public/WebKit.h"
(...skipping 17 matching lines...) Expand all
28 if (webkit_thread_.get()) 28 if (webkit_thread_.get())
29 return; 29 return;
30 InitializeThread(); 30 InitializeThread();
31 } 31 }
32 32
33 WebKitThread::InternalWebKitThread::InternalWebKitThread() 33 WebKitThread::InternalWebKitThread::InternalWebKitThread()
34 : ChromeThread(ChromeThread::WEBKIT) { 34 : ChromeThread(ChromeThread::WEBKIT) {
35 } 35 }
36 36
37 WebKitThread::InternalWebKitThread::~InternalWebKitThread() { 37 WebKitThread::InternalWebKitThread::~InternalWebKitThread() {
38 Stop();
38 } 39 }
39 40
40 void WebKitThread::InternalWebKitThread::Init() { 41 void WebKitThread::InternalWebKitThread::Init() {
41 DCHECK(!webkit_client_.get()); 42 DCHECK(!webkit_client_.get());
42 webkit_client_.reset(new BrowserWebKitClientImpl); 43 webkit_client_.reset(new BrowserWebKitClientImpl);
43 WebKit::initialize(webkit_client_.get()); 44 WebKit::initialize(webkit_client_.get());
44 // If possible, post initialization tasks to this thread (rather than doing 45 // If possible, post initialization tasks to this thread (rather than doing
45 // them now) so we don't block the IO thread any longer than we have to. 46 // them now) so we don't block the IO thread any longer than we have to.
46 } 47 }
47 48
48 void WebKitThread::InternalWebKitThread::CleanUp() { 49 void WebKitThread::InternalWebKitThread::CleanUp() {
49 DCHECK(webkit_client_.get()); 50 DCHECK(webkit_client_.get());
50 WebKit::shutdown(); 51 WebKit::shutdown();
51 } 52 }
52 53
53 MessageLoop* WebKitThread::InitializeThread() { 54 MessageLoop* WebKitThread::InitializeThread() {
54 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) 55 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess))
55 return NULL; 56 return NULL;
56 57
57 DCHECK(!webkit_thread_.get()); 58 DCHECK(!webkit_thread_.get());
58 webkit_thread_.reset(new InternalWebKitThread); 59 webkit_thread_.reset(new InternalWebKitThread);
59 bool started = webkit_thread_->Start(); 60 bool started = webkit_thread_->Start();
60 DCHECK(started); 61 DCHECK(started);
61 return webkit_thread_->message_loop(); 62 return webkit_thread_->message_loop();
62 } 63 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698