Chromium Code Reviews| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 92 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
| 93 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h " | 93 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h " |
| 94 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" | 94 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" |
| 95 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSharedWorkerReposi tory.h" | 95 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSharedWorkerReposi tory.h" |
| 96 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 96 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 97 #include "ui/base/layout.h" | 97 #include "ui/base/layout.h" |
| 98 #include "ui/base/ui_base_switches.h" | 98 #include "ui/base/ui_base_switches.h" |
| 99 #include "v8/include/v8.h" | 99 #include "v8/include/v8.h" |
| 100 #include "webkit/glue/webkit_glue.h" | 100 #include "webkit/glue/webkit_glue.h" |
| 101 | 101 |
| 102 #include "base/threading/thread_restrictions.h" | |
| 103 | |
| 102 #if defined(OS_WIN) | 104 #if defined(OS_WIN) |
| 103 #include <windows.h> | 105 #include <windows.h> |
| 104 #include <objbase.h> | 106 #include <objbase.h> |
| 105 #include "base/win/scoped_com_initializer.h" | 107 #include "base/win/scoped_com_initializer.h" |
| 106 #else | 108 #else |
| 107 // TODO(port) | 109 // TODO(port) |
| 108 #include "base/memory/scoped_handle.h" | 110 #include "base/memory/scoped_handle.h" |
| 109 #include "content/common/np_channel_base.h" | 111 #include "content/common/np_channel_base.h" |
| 110 #endif | 112 #endif |
| 111 | 113 |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 758 RenderThreadImpl::HostAllocateSharedMemoryBuffer(size_t size) { | 760 RenderThreadImpl::HostAllocateSharedMemoryBuffer(size_t size) { |
| 759 if (size > static_cast<size_t>(std::numeric_limits<int>::max())) | 761 if (size > static_cast<size_t>(std::numeric_limits<int>::max())) |
| 760 return scoped_ptr<base::SharedMemory>(); | 762 return scoped_ptr<base::SharedMemory>(); |
| 761 | 763 |
| 762 base::SharedMemoryHandle handle; | 764 base::SharedMemoryHandle handle; |
| 763 bool success; | 765 bool success; |
| 764 IPC::Message* message = | 766 IPC::Message* message = |
| 765 new ChildProcessHostMsg_SyncAllocateSharedMemory(size, &handle); | 767 new ChildProcessHostMsg_SyncAllocateSharedMemory(size, &handle); |
| 766 | 768 |
| 767 // Allow calling this from the compositor thread. | 769 // Allow calling this from the compositor thread. |
| 768 if (MessageLoop::current() == message_loop()) | 770 if (MessageLoop::current() == message_loop()) { |
| 769 success = ChildThread::Send(message); | 771 success = ChildThread::Send(message); |
| 770 else | 772 } else { |
| 773 // This one should be ok... | |
| 774 base::ThreadRestrictions::ScopedAllowWait allow_wait; | |
|
boliu
2013/03/01 00:19:12
This one just allocates shared mem and does not us
| |
| 771 success = sync_message_filter()->Send(message); | 775 success = sync_message_filter()->Send(message); |
| 776 } | |
| 772 | 777 |
| 773 if (!success) | 778 if (!success) |
| 774 return scoped_ptr<base::SharedMemory>(); | 779 return scoped_ptr<base::SharedMemory>(); |
| 775 | 780 |
| 776 if (!base::SharedMemory::IsHandleValid(handle)) | 781 if (!base::SharedMemory::IsHandleValid(handle)) |
| 777 return scoped_ptr<base::SharedMemory>(); | 782 return scoped_ptr<base::SharedMemory>(); |
| 778 | 783 |
| 779 return scoped_ptr<base::SharedMemory>(new base::SharedMemory(handle, false)); | 784 return scoped_ptr<base::SharedMemory>(new base::SharedMemory(handle, false)); |
| 780 } | 785 } |
| 781 | 786 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 998 "surface_id", | 1003 "surface_id", |
| 999 surface_id); | 1004 surface_id); |
| 1000 | 1005 |
| 1001 int32 route_id = MSG_ROUTING_NONE; | 1006 int32 route_id = MSG_ROUTING_NONE; |
| 1002 IPC::Message* message = new GpuHostMsg_CreateViewCommandBuffer( | 1007 IPC::Message* message = new GpuHostMsg_CreateViewCommandBuffer( |
| 1003 surface_id, | 1008 surface_id, |
| 1004 init_params, | 1009 init_params, |
| 1005 &route_id); | 1010 &route_id); |
| 1006 | 1011 |
| 1007 // Allow calling this from the compositor thread. | 1012 // Allow calling this from the compositor thread. |
| 1008 if (MessageLoop::current() == message_loop()) | 1013 if (MessageLoop::current() == message_loop()) { |
| 1009 ChildThread::Send(message); | 1014 ChildThread::Send(message); |
| 1010 else | 1015 } else { |
| 1016 base::ThreadRestrictions::ScopedAllowWait allow_wait; | |
|
boliu
2013/03/01 00:19:12
potential deadlock? See comment in gpu_message_fil
| |
| 1011 sync_message_filter()->Send(message); | 1017 sync_message_filter()->Send(message); |
| 1018 } | |
| 1012 | 1019 |
| 1013 return route_id; | 1020 return route_id; |
| 1014 } | 1021 } |
| 1015 | 1022 |
| 1016 void RenderThreadImpl::CreateImage( | 1023 void RenderThreadImpl::CreateImage( |
| 1017 gfx::PluginWindowHandle window, | 1024 gfx::PluginWindowHandle window, |
| 1018 int32 image_id, | 1025 int32 image_id, |
| 1019 const CreateImageCallback& callback) { | 1026 const CreateImageCallback& callback) { |
| 1020 NOTREACHED(); | 1027 NOTREACHED(); |
| 1021 } | 1028 } |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1205 | 1212 |
| 1206 void RenderThreadImpl::SetFlingCurveParameters( | 1213 void RenderThreadImpl::SetFlingCurveParameters( |
| 1207 const std::vector<float>& new_touchpad, | 1214 const std::vector<float>& new_touchpad, |
| 1208 const std::vector<float>& new_touchscreen) { | 1215 const std::vector<float>& new_touchscreen) { |
| 1209 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, | 1216 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, |
| 1210 new_touchscreen); | 1217 new_touchscreen); |
| 1211 | 1218 |
| 1212 } | 1219 } |
| 1213 | 1220 |
| 1214 } // namespace content | 1221 } // namespace content |
| OLD | NEW |