Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / content / renderer / render_thread_impl.cc
index ed604a9..e27d04f 100644 (file)
@@ -94,6 +94,7 @@
 #include "media/filters/gpu_video_accelerator_factories.h"
 #include "net/base/net_errors.h"
 #include "net/base/net_util.h"
+#include "skia/ext/event_tracer_impl.h"
 #include "third_party/WebKit/public/platform/WebString.h"
 #include "third_party/WebKit/public/web/WebColorName.h"
 #include "third_party/WebKit/public/web/WebDatabase.h"
@@ -234,7 +235,7 @@ scoped_ptr<base::SharedMemory> AllocateSharedMemoryFunction(size_t size) {
   return RenderThreadImpl::Get()->HostAllocateSharedMemoryBuffer(size);
 }
 
-void EnableWebCoreLogChannels(const std::string& channels) {
+void EnableBlinkPlatformLogChannels(const std::string& channels) {
   if (channels.empty())
     return;
   base::StringTokenizer t(channels, ", ");
@@ -371,7 +372,7 @@ void RenderThreadImpl::Init() {
   audio_message_filter_ = new AudioMessageFilter(GetIOMessageLoopProxy());
   AddFilter(audio_message_filter_.get());
 
-  midi_message_filter_ = new MIDIMessageFilter(GetIOMessageLoopProxy());
+  midi_message_filter_ = new MidiMessageFilter(GetIOMessageLoopProxy());
   AddFilter(midi_message_filter_.get());
 
   AddFilter((new IndexedDBMessageFilter(thread_safe_sender()))->GetFilter());
@@ -380,8 +381,10 @@ void RenderThreadImpl::Init() {
 
   GetContentClient()->renderer()->RenderThreadStarted();
 
+  InitSkiaEventTracer();
+
   const CommandLine& command_line = *CommandLine::ForCurrentProcess();
-  if (command_line.HasSwitch(switches::kEnableGpuBenchmarking))
+  if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking))
       RegisterExtension(GpuBenchmarkingExtension::Get());
 
   // Note that under Linux, the media library will normally already have
@@ -701,12 +704,10 @@ void RenderThreadImpl::EnsureWebKitInitialized() {
       CompositorOutputSurface::CreateFilter(output_surface_loop.get());
   AddFilter(compositor_output_surface_filter_.get());
 
-  WebScriptController::enableV8SingleThreadMode();
-
   RenderThreadImpl::RegisterSchemes();
 
-  EnableWebCoreLogChannels(
-      command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels));
+  EnableBlinkPlatformLogChannels(
+      command_line.GetSwitchValueASCII(switches::kBlinkPlatformLogChannels));
 
   SetRuntimeFeaturesDefaultsAndUpdateFromArgs(command_line);
 
@@ -895,6 +896,8 @@ RenderThreadImpl::GetGpuFactories() {
   scoped_refptr<GpuChannelHost> gpu_channel_host = GetGpuChannel();
   const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
   scoped_refptr<RendererGpuVideoAcceleratorFactories> gpu_factories;
+  scoped_refptr<base::MessageLoopProxy> media_loop_proxy =
+      GetMediaThreadMessageLoopProxy();
   if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) {
     if (!gpu_va_context_provider_ ||
         gpu_va_context_provider_->DestroyedOnMainThread()) {
@@ -910,11 +913,18 @@ RenderThreadImpl::GetGpuFactories() {
                   GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"),
                   WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits())),
           "GPU-VideoAccelerator-Offscreen");
+      if (gpu_va_context_provider_) {
+        media_loop_proxy->PostTask(
+            FROM_HERE,
+            base::Bind(
+                base::IgnoreResult(&cc::ContextProvider::BindToCurrentThread),
+                gpu_va_context_provider_));
+      }
     }
   }
-  if (gpu_channel_host) {
+  if (gpu_va_context_provider_) {
     gpu_factories = new RendererGpuVideoAcceleratorFactories(
-        gpu_channel_host.get(), gpu_va_context_provider_);
+        gpu_channel_host, media_loop_proxy, gpu_va_context_provider_);
   }
   return gpu_factories;
 }