| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_impl.h" | 5 #include "content/renderer/render_thread_impl.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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 99 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
| 100 #include "third_party/WebKit/public/web/WebSharedWorkerRepository.h" | 100 #include "third_party/WebKit/public/web/WebSharedWorkerRepository.h" |
| 101 #include "third_party/WebKit/public/web/WebView.h" | 101 #include "third_party/WebKit/public/web/WebView.h" |
| 102 #include "third_party/WebKit/public/platform/WebString.h" | 102 #include "third_party/WebKit/public/platform/WebString.h" |
| 103 #include "ui/base/layout.h" | 103 #include "ui/base/layout.h" |
| 104 #include "ui/base/ui_base_switches.h" | 104 #include "ui/base/ui_base_switches.h" |
| 105 #include "v8/include/v8.h" | 105 #include "v8/include/v8.h" |
| 106 #include "webkit/glue/webkit_glue.h" | 106 #include "webkit/glue/webkit_glue.h" |
| 107 #include "webkit/child/worker_task_runner.h" | 107 #include "webkit/child/worker_task_runner.h" |
| 108 #include "webkit/renderer/appcache/appcache_frontend_impl.h" | 108 #include "webkit/renderer/appcache/appcache_frontend_impl.h" |
| 109 #include "webkit/renderer/compositor_bindings/web_external_bitmap_impl.h" |
| 109 | 110 |
| 110 #if defined(OS_WIN) | 111 #if defined(OS_WIN) |
| 111 #include <windows.h> | 112 #include <windows.h> |
| 112 #include <objbase.h> | 113 #include <objbase.h> |
| 113 #include "base/win/scoped_com_initializer.h" | 114 #include "base/win/scoped_com_initializer.h" |
| 114 #else | 115 #else |
| 115 // TODO(port) | 116 // TODO(port) |
| 116 #include "base/memory/scoped_handle.h" | 117 #include "base/memory/scoped_handle.h" |
| 117 #include "content/child/np_channel_base.h" | 118 #include "content/child/np_channel_base.h" |
| 118 #endif | 119 #endif |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 histogram_name, min, max, buckets, | 211 histogram_name, min, max, buckets, |
| 211 base::Histogram::kUmaTargetedHistogramFlag); | 212 base::Histogram::kUmaTargetedHistogramFlag); |
| 212 return histogram; | 213 return histogram; |
| 213 } | 214 } |
| 214 | 215 |
| 215 void AddHistogramSample(void* hist, int sample) { | 216 void AddHistogramSample(void* hist, int sample) { |
| 216 base::Histogram* histogram = static_cast<base::Histogram*>(hist); | 217 base::Histogram* histogram = static_cast<base::Histogram*>(hist); |
| 217 histogram->Add(sample); | 218 histogram->Add(sample); |
| 218 } | 219 } |
| 219 | 220 |
| 221 scoped_ptr<base::SharedMemory> AllocateSharedMemoryFunction(size_t size) { |
| 222 return RenderThreadImpl::Get()->HostAllocateSharedMemoryBuffer(size); |
| 223 } |
| 224 |
| 220 } // namespace | 225 } // namespace |
| 221 | 226 |
| 222 class RenderThreadImpl::GpuVDAContextLostCallback | 227 class RenderThreadImpl::GpuVDAContextLostCallback |
| 223 : public WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback { | 228 : public WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback { |
| 224 public: | 229 public: |
| 225 GpuVDAContextLostCallback() | 230 GpuVDAContextLostCallback() |
| 226 : main_message_loop_(base::MessageLoopProxy::current()) {} | 231 : main_message_loop_(base::MessageLoopProxy::current()) {} |
| 227 virtual ~GpuVDAContextLostCallback() {} | 232 virtual ~GpuVDAContextLostCallback() {} |
| 228 virtual void onContextLost() { | 233 virtual void onContextLost() { |
| 229 main_message_loop_->PostTask(FROM_HERE, base::Bind( | 234 main_message_loop_->PostTask(FROM_HERE, base::Bind( |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 WebRuntimeFeatures::enableWebAudio(false); | 726 WebRuntimeFeatures::enableWebAudio(false); |
| 722 } | 727 } |
| 723 | 728 |
| 724 FOR_EACH_OBSERVER(RenderProcessObserver, observers_, WebKitInitialized()); | 729 FOR_EACH_OBSERVER(RenderProcessObserver, observers_, WebKitInitialized()); |
| 725 | 730 |
| 726 devtools_agent_message_filter_ = new DevToolsAgentFilter(); | 731 devtools_agent_message_filter_ = new DevToolsAgentFilter(); |
| 727 AddFilter(devtools_agent_message_filter_.get()); | 732 AddFilter(devtools_agent_message_filter_.get()); |
| 728 | 733 |
| 729 if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) | 734 if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) |
| 730 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 735 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
| 736 |
| 737 webkit::SetSharedMemoryAllocationFunction(AllocateSharedMemoryFunction); |
| 731 } | 738 } |
| 732 | 739 |
| 733 void RenderThreadImpl::RegisterSchemes() { | 740 void RenderThreadImpl::RegisterSchemes() { |
| 734 // swappedout: pages should not be accessible, and should also | 741 // swappedout: pages should not be accessible, and should also |
| 735 // be treated as empty documents that can commit synchronously. | 742 // be treated as empty documents that can commit synchronously. |
| 736 WebString swappedout_scheme(ASCIIToUTF16(chrome::kSwappedOutScheme)); | 743 WebString swappedout_scheme(ASCIIToUTF16(chrome::kSwappedOutScheme)); |
| 737 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(swappedout_scheme); | 744 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(swappedout_scheme); |
| 738 WebSecurityPolicy::registerURLSchemeAsEmptyDocument(swappedout_scheme); | 745 WebSecurityPolicy::registerURLSchemeAsEmptyDocument(swappedout_scheme); |
| 739 } | 746 } |
| 740 | 747 |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1251 | 1258 |
| 1252 void RenderThreadImpl::SetFlingCurveParameters( | 1259 void RenderThreadImpl::SetFlingCurveParameters( |
| 1253 const std::vector<float>& new_touchpad, | 1260 const std::vector<float>& new_touchpad, |
| 1254 const std::vector<float>& new_touchscreen) { | 1261 const std::vector<float>& new_touchscreen) { |
| 1255 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, | 1262 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, |
| 1256 new_touchscreen); | 1263 new_touchscreen); |
| 1257 | 1264 |
| 1258 } | 1265 } |
| 1259 | 1266 |
| 1260 } // namespace content | 1267 } // namespace content |
| OLD | NEW |