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

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

Issue 7054002: Temporary fix until WebKit::initialize does this for us. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 months 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) 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/browser/in_process_webkit/webkit_thread.h" 5 #include "content/browser/in_process_webkit/webkit_thread.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/browser/in_process_webkit/browser_webkitclient_impl.h" 8 #include "content/browser/in_process_webkit/browser_webkitclient_impl.h"
9 #include "content/common/content_switches.h" 9 #include "content/common/content_switches.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
11 #include "webkit/glue/webkit_glue.h" 12 #include "webkit/glue/webkit_glue.h"
12 13
13 WebKitThread::WebKitThread() { 14 WebKitThread::WebKitThread() {
14 } 15 }
15 16
16 // 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.
17 WebKitThread::~WebKitThread() { 18 WebKitThread::~WebKitThread() {
18 // We can't just check CurrentlyOn(BrowserThread::UI) because in unit tests, 19 // We can't just check CurrentlyOn(BrowserThread::UI) because in unit tests,
19 // 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
20 // no BrowserThread object. Can't check that CurrentlyOn is not IO since 21 // no BrowserThread object. Can't check that CurrentlyOn is not IO since
(...skipping 22 matching lines...) Expand all
43 Stop(); 44 Stop();
44 } 45 }
45 46
46 void WebKitThread::InternalWebKitThread::Init() { 47 void WebKitThread::InternalWebKitThread::Init() {
47 DCHECK(!webkit_client_.get()); 48 DCHECK(!webkit_client_.get());
48 webkit_client_.reset(new BrowserWebKitClientImpl); 49 webkit_client_.reset(new BrowserWebKitClientImpl);
49 WebKit::initialize(webkit_client_.get()); 50 WebKit::initialize(webkit_client_.get());
50 webkit_glue::EnableWebCoreLogChannels( 51 webkit_glue::EnableWebCoreLogChannels(
51 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 52 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
52 switches::kWebCoreLogChannels)); 53 switches::kWebCoreLogChannels));
54 // Exercise WebSecurityOrigin to get its underlying statics initialized.
55 // TODO(michaeln): remove this when the following is landed.
56 // https://bugs.webkit.org/show_bug.cgi?id=61145
57 WebKit::WebSecurityOrigin::create(GURL("http://chromium.org"));
53 58
54 // If possible, post initialization tasks to this thread (rather than doing 59 // If possible, post initialization tasks to this thread (rather than doing
55 // them now) so we don't block the UI thread any longer than we have to. 60 // them now) so we don't block the UI thread any longer than we have to.
56 } 61 }
57 62
58 void WebKitThread::InternalWebKitThread::CleanUp() { 63 void WebKitThread::InternalWebKitThread::CleanUp() {
59 DCHECK(webkit_client_.get()); 64 DCHECK(webkit_client_.get());
60 WebKit::shutdown(); 65 WebKit::shutdown();
61 } 66 }
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