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

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: WebThreadImpl is in a namespace 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
« no previous file with comments | « content/renderer/render_thread.h ('k') | 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/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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/WebView.h" 67 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
68 #include "ui/base/ui_base_switches.h" 68 #include "ui/base/ui_base_switches.h"
69 #include "v8/include/v8.h" 69 #include "v8/include/v8.h"
70 #include "webkit/extensions/v8/playback_extension.h" 70 #include "webkit/extensions/v8/playback_extension.h"
71 #include "webkit/glue/webkit_glue.h" 71 #include "webkit/glue/webkit_glue.h"
72 #include "webkit/glue/webthread_impl.h"
73
74 #ifdef HAVE_WEBCOMPOSITOR
75 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h"
76 #endif
72 77
73 // TODO(port) 78 // TODO(port)
74 #if defined(OS_WIN) 79 #if defined(OS_WIN)
75 #include "content/common/child_process_messages.h" 80 #include "content/common/child_process_messages.h"
76 #else 81 #else
77 #include "base/memory/scoped_handle.h" 82 #include "base/memory/scoped_handle.h"
78 #include "content/common/np_channel_base.h" 83 #include "content/common/np_channel_base.h"
79 #endif 84 #endif
80 85
81 #if defined(OS_WIN) 86 #if defined(OS_WIN)
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 if (webkit_platform_support_.get()) 436 if (webkit_platform_support_.get())
432 return; 437 return;
433 438
434 v8::V8::SetCounterFunction(base::StatsTable::FindLocation); 439 v8::V8::SetCounterFunction(base::StatsTable::FindLocation);
435 v8::V8::SetCreateHistogramFunction(CreateHistogram); 440 v8::V8::SetCreateHistogramFunction(CreateHistogram);
436 v8::V8::SetAddHistogramSampleFunction(AddHistogramSample); 441 v8::V8::SetAddHistogramSampleFunction(AddHistogramSample);
437 442
438 webkit_platform_support_.reset(new RendererWebKitPlatformSupportImpl); 443 webkit_platform_support_.reset(new RendererWebKitPlatformSupportImpl);
439 WebKit::initialize(webkit_platform_support_.get()); 444 WebKit::initialize(webkit_platform_support_.get());
440 445
446 #ifdef HAVE_WEBCOMPOSITOR
447 compositor_thread_.reset(new webkit_glue::WebThreadImpl("Compositor"));
448 WebKit::WebCompositor::setThread(compositor_thread_.get());
449 #endif
450
441 WebScriptController::enableV8SingleThreadMode(); 451 WebScriptController::enableV8SingleThreadMode();
442 452
443 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 453 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
444 454
445 webkit_glue::EnableWebCoreLogChannels( 455 webkit_glue::EnableWebCoreLogChannels(
446 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); 456 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels));
447 457
448 if (command_line.HasSwitch(switches::kPlaybackMode) || 458 if (command_line.HasSwitch(switches::kPlaybackMode) ||
449 command_line.HasSwitch(switches::kRecordMode) || 459 command_line.HasSwitch(switches::kRecordMode) ||
450 command_line.HasSwitch(switches::kNoJsRandomness)) { 460 command_line.HasSwitch(switches::kNoJsRandomness)) {
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 734
725 void RenderThread::RegisterExtension(v8::Extension* extension) { 735 void RenderThread::RegisterExtension(v8::Extension* extension) {
726 WebScriptController::registerExtension(extension); 736 WebScriptController::registerExtension(extension);
727 v8_extensions_.insert(extension->name()); 737 v8_extensions_.insert(extension->name());
728 } 738 }
729 739
730 bool RenderThread::IsRegisteredExtension( 740 bool RenderThread::IsRegisteredExtension(
731 const std::string& v8_extension_name) const { 741 const std::string& v8_extension_name) const {
732 return v8_extensions_.find(v8_extension_name) != v8_extensions_.end(); 742 return v8_extensions_.find(v8_extension_name) != v8_extensions_.end();
733 } 743 }
OLDNEW
« no previous file with comments | « content/renderer/render_thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698