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

Side by Side Diff: content/renderer/render_thread.cc

Issue 8081014: Initialize and set compositor thread in WebKit initialization (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: initialize WebThreadImpl directly Created 9 years, 2 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
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/renderer/render_thread.h" 5 #include "content/renderer/render_thread.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" 57 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h"
58 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" 58 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
59 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 59 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
60 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" 60 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
61 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNetworkStateNotifi er.h" 61 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNetworkStateNotifi er.h"
62 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" 62 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h"
63 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" 63 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h"
64 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h " 64 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h "
65 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat cher.h" 65 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat cher.h"
66 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" 66 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
67 #include "third_party/WebKit/Source/WebKit/chromium/public/WebThread.h"
darin (slow to review) 2011/09/30 06:06:06 nit: this include should be unnecessary
67 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 68 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
68 #include "ui/base/ui_base_switches.h" 69 #include "ui/base/ui_base_switches.h"
69 #include "v8/include/v8.h" 70 #include "v8/include/v8.h"
70 #include "webkit/extensions/v8/playback_extension.h" 71 #include "webkit/extensions/v8/playback_extension.h"
71 #include "webkit/glue/webkit_glue.h" 72 #include "webkit/glue/webkit_glue.h"
72 73
74 #ifdef HAVE_WEBCOMPOSITOR
75 #include "webkit/glue/webthread_impl.h"
76 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h"
77 #endif
78
73 // TODO(port) 79 // TODO(port)
74 #if defined(OS_WIN) 80 #if defined(OS_WIN)
75 #include "content/common/child_process_messages.h" 81 #include "content/common/child_process_messages.h"
76 #else 82 #else
77 #include "base/memory/scoped_handle.h" 83 #include "base/memory/scoped_handle.h"
78 #include "content/common/np_channel_base.h" 84 #include "content/common/np_channel_base.h"
79 #endif 85 #endif
80 86
81 #if defined(OS_WIN) 87 #if defined(OS_WIN)
82 #include <windows.h> 88 #include <windows.h>
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 if (webkit_platform_support_.get()) 437 if (webkit_platform_support_.get())
432 return; 438 return;
433 439
434 v8::V8::SetCounterFunction(base::StatsTable::FindLocation); 440 v8::V8::SetCounterFunction(base::StatsTable::FindLocation);
435 v8::V8::SetCreateHistogramFunction(CreateHistogram); 441 v8::V8::SetCreateHistogramFunction(CreateHistogram);
436 v8::V8::SetAddHistogramSampleFunction(AddHistogramSample); 442 v8::V8::SetAddHistogramSampleFunction(AddHistogramSample);
437 443
438 webkit_platform_support_.reset(new RendererWebKitPlatformSupportImpl); 444 webkit_platform_support_.reset(new RendererWebKitPlatformSupportImpl);
439 WebKit::initialize(webkit_platform_support_.get()); 445 WebKit::initialize(webkit_platform_support_.get());
440 446
447 #ifdef HAVE_WEBCOMPOSITOR
448 compositor_thread_.reset(new WebThreadImpl("Compositor"));
449 WebKit::WebCompositor::setThread(compositor_thread_.get());
450 #endif
451
441 WebScriptController::enableV8SingleThreadMode(); 452 WebScriptController::enableV8SingleThreadMode();
442 453
443 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 454 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
444 455
445 webkit_glue::EnableWebCoreLogChannels( 456 webkit_glue::EnableWebCoreLogChannels(
446 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); 457 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels));
447 458
448 if (command_line.HasSwitch(switches::kPlaybackMode) || 459 if (command_line.HasSwitch(switches::kPlaybackMode) ||
449 command_line.HasSwitch(switches::kRecordMode) || 460 command_line.HasSwitch(switches::kRecordMode) ||
450 command_line.HasSwitch(switches::kNoJsRandomness)) { 461 command_line.HasSwitch(switches::kNoJsRandomness)) {
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 735
725 void RenderThread::RegisterExtension(v8::Extension* extension) { 736 void RenderThread::RegisterExtension(v8::Extension* extension) {
726 WebScriptController::registerExtension(extension); 737 WebScriptController::registerExtension(extension);
727 v8_extensions_.insert(extension->name()); 738 v8_extensions_.insert(extension->name());
728 } 739 }
729 740
730 bool RenderThread::IsRegisteredExtension( 741 bool RenderThread::IsRegisteredExtension(
731 const std::string& v8_extension_name) const { 742 const std::string& v8_extension_name) const {
732 return v8_extensions_.find(v8_extension_name) != v8_extensions_.end(); 743 return v8_extensions_.find(v8_extension_name) != v8_extensions_.end();
733 } 744 }
OLDNEW
« content/renderer/render_thread.h ('K') | « content/renderer/render_thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698