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

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

Issue 17859002: Allow WebExternalTextureLayers to receive a bitmap along with a mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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) 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" 98 #include "third_party/WebKit/public/web/WebSecurityPolicy.h"
99 #include "third_party/WebKit/public/web/WebSharedWorkerRepository.h" 99 #include "third_party/WebKit/public/web/WebSharedWorkerRepository.h"
100 #include "third_party/WebKit/public/web/WebView.h" 100 #include "third_party/WebKit/public/web/WebView.h"
101 #include "third_party/WebKit/public/platform/WebString.h" 101 #include "third_party/WebKit/public/platform/WebString.h"
102 #include "ui/base/layout.h" 102 #include "ui/base/layout.h"
103 #include "ui/base/ui_base_switches.h" 103 #include "ui/base/ui_base_switches.h"
104 #include "v8/include/v8.h" 104 #include "v8/include/v8.h"
105 #include "webkit/glue/webkit_glue.h" 105 #include "webkit/glue/webkit_glue.h"
106 #include "webkit/child/worker_task_runner.h" 106 #include "webkit/child/worker_task_runner.h"
107 #include "webkit/renderer/appcache/appcache_frontend_impl.h" 107 #include "webkit/renderer/appcache/appcache_frontend_impl.h"
108 #include "webkit/renderer/compositor_bindings/web_external_bitmap_impl.h"
108 109
109 #if defined(OS_WIN) 110 #if defined(OS_WIN)
110 #include <windows.h> 111 #include <windows.h>
111 #include <objbase.h> 112 #include <objbase.h>
112 #include "base/win/scoped_com_initializer.h" 113 #include "base/win/scoped_com_initializer.h"
113 #else 114 #else
114 // TODO(port) 115 // TODO(port)
115 #include "base/memory/scoped_handle.h" 116 #include "base/memory/scoped_handle.h"
116 #include "content/child/np_channel_base.h" 117 #include "content/child/np_channel_base.h"
117 #endif 118 #endif
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 histogram_name, min, max, buckets, 210 histogram_name, min, max, buckets,
210 base::Histogram::kUmaTargetedHistogramFlag); 211 base::Histogram::kUmaTargetedHistogramFlag);
211 return histogram; 212 return histogram;
212 } 213 }
213 214
214 void AddHistogramSample(void* hist, int sample) { 215 void AddHistogramSample(void* hist, int sample) {
215 base::Histogram* histogram = static_cast<base::Histogram*>(hist); 216 base::Histogram* histogram = static_cast<base::Histogram*>(hist);
216 histogram->Add(sample); 217 histogram->Add(sample);
217 } 218 }
218 219
220 scoped_ptr<base::SharedMemory> AllocateSharedMemoryFunction(size_t size) {
221 return RenderThreadImpl::Get()->HostAllocateSharedMemoryBuffer(size);
222 }
223
219 } // namespace 224 } // namespace
220 225
221 class RenderThreadImpl::GpuVDAContextLostCallback 226 class RenderThreadImpl::GpuVDAContextLostCallback
222 : public WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback { 227 : public WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback {
223 public: 228 public:
224 GpuVDAContextLostCallback() 229 GpuVDAContextLostCallback()
225 : main_message_loop_(base::MessageLoopProxy::current()) {} 230 : main_message_loop_(base::MessageLoopProxy::current()) {}
226 virtual ~GpuVDAContextLostCallback() {} 231 virtual ~GpuVDAContextLostCallback() {}
227 virtual void onContextLost() { 232 virtual void onContextLost() {
228 main_message_loop_->PostTask(FROM_HERE, base::Bind( 233 main_message_loop_->PostTask(FROM_HERE, base::Bind(
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 WebRuntimeFeatures::enableWebAudio(false); 721 WebRuntimeFeatures::enableWebAudio(false);
717 } 722 }
718 723
719 FOR_EACH_OBSERVER(RenderProcessObserver, observers_, WebKitInitialized()); 724 FOR_EACH_OBSERVER(RenderProcessObserver, observers_, WebKitInitialized());
720 725
721 devtools_agent_message_filter_ = new DevToolsAgentFilter(); 726 devtools_agent_message_filter_ = new DevToolsAgentFilter();
722 AddFilter(devtools_agent_message_filter_.get()); 727 AddFilter(devtools_agent_message_filter_.get());
723 728
724 if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) 729 if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden())
725 ScheduleIdleHandler(kLongIdleHandlerDelayMs); 730 ScheduleIdleHandler(kLongIdleHandlerDelayMs);
731
732 webkit::SetSharedMemoryAllocationFunction(AllocateSharedMemoryFunction);
726 } 733 }
727 734
728 void RenderThreadImpl::RegisterSchemes() { 735 void RenderThreadImpl::RegisterSchemes() {
729 // swappedout: pages should not be accessible, and should also 736 // swappedout: pages should not be accessible, and should also
730 // be treated as empty documents that can commit synchronously. 737 // be treated as empty documents that can commit synchronously.
731 WebString swappedout_scheme(ASCIIToUTF16(chrome::kSwappedOutScheme)); 738 WebString swappedout_scheme(ASCIIToUTF16(chrome::kSwappedOutScheme));
732 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(swappedout_scheme); 739 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(swappedout_scheme);
733 WebSecurityPolicy::registerURLSchemeAsEmptyDocument(swappedout_scheme); 740 WebSecurityPolicy::registerURLSchemeAsEmptyDocument(swappedout_scheme);
734 741
735 // chrome-native: is a scheme used for placeholder navigations that allow 742 // chrome-native: is a scheme used for placeholder navigations that allow
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 1266
1260 void RenderThreadImpl::SetFlingCurveParameters( 1267 void RenderThreadImpl::SetFlingCurveParameters(
1261 const std::vector<float>& new_touchpad, 1268 const std::vector<float>& new_touchpad,
1262 const std::vector<float>& new_touchscreen) { 1269 const std::vector<float>& new_touchscreen) {
1263 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, 1270 webkit_platform_support_->SetFlingCurveParameters(new_touchpad,
1264 new_touchscreen); 1271 new_touchscreen);
1265 1272
1266 } 1273 }
1267 1274
1268 } // namespace content 1275 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698