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

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: 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 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"
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 "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h"
76 #endif
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)
82 #include <windows.h> 87 #include <windows.h>
(...skipping 348 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(
448 webkit_platform_support_->createThread("Compositor"));
jam 2011/09/30 02:50:58 nit: it's a little odd that the webkit embedder ca
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
« 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