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/pepper/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1376 const GURL& plugin_url) { | 1376 const GURL& plugin_url) { |
1377 PP_FlashLSORestrictions restrictions = PP_FLASHLSORESTRICTIONS_NONE; | 1377 PP_FlashLSORestrictions restrictions = PP_FLASHLSORESTRICTIONS_NONE; |
1378 render_view_->Send( | 1378 render_view_->Send( |
1379 new PepperMsg_GetLocalDataRestrictions(document_url, plugin_url, | 1379 new PepperMsg_GetLocalDataRestrictions(document_url, plugin_url, |
1380 &restrictions)); | 1380 &restrictions)); |
1381 return restrictions; | 1381 return restrictions; |
1382 } | 1382 } |
1383 | 1383 |
1384 base::SharedMemory* PepperPluginDelegateImpl::CreateAnonymousSharedMemory( | 1384 base::SharedMemory* PepperPluginDelegateImpl::CreateAnonymousSharedMemory( |
1385 uint32_t size) { | 1385 uint32_t size) { |
1386 if (size == 0) | 1386 return RenderThread::Get()->HostAllocateSharedMemoryBuffer(size).release(); |
1387 return NULL; | |
1388 base::SharedMemoryHandle handle; | |
1389 if (!render_view_->Send( | |
1390 new ChildProcessHostMsg_SyncAllocateSharedMemory(size, &handle))) { | |
1391 DLOG(WARNING) << "Browser allocation request message failed"; | |
1392 return NULL; | |
1393 } | |
1394 if (!base::SharedMemory::IsHandleValid(handle)) { | |
1395 DLOG(WARNING) << "Browser failed to allocate shared memory"; | |
1396 return NULL; | |
1397 } | |
1398 return new base::SharedMemory(handle, false); | |
1399 } | 1387 } |
1400 | 1388 |
1401 ppapi::Preferences PepperPluginDelegateImpl::GetPreferences() { | 1389 ppapi::Preferences PepperPluginDelegateImpl::GetPreferences() { |
1402 return ppapi::Preferences(render_view_->webkit_preferences()); | 1390 return ppapi::Preferences(render_view_->webkit_preferences()); |
1403 } | 1391 } |
1404 | 1392 |
1405 bool PepperPluginDelegateImpl::LockMouse( | 1393 bool PepperPluginDelegateImpl::LockMouse( |
1406 webkit::ppapi::PluginInstance* instance) { | 1394 webkit::ppapi::PluginInstance* instance) { |
1407 return GetMouseLockDispatcher(instance)->LockMouse( | 1395 return GetMouseLockDispatcher(instance)->LockMouse( |
1408 GetOrCreateLockTargetAdapter(instance)); | 1396 GetOrCreateLockTargetAdapter(instance)); |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1747 RenderWidgetFullscreenPepper* container = | 1735 RenderWidgetFullscreenPepper* container = |
1748 static_cast<RenderWidgetFullscreenPepper*>( | 1736 static_cast<RenderWidgetFullscreenPepper*>( |
1749 instance->fullscreen_container()); | 1737 instance->fullscreen_container()); |
1750 return container->mouse_lock_dispatcher(); | 1738 return container->mouse_lock_dispatcher(); |
1751 } else { | 1739 } else { |
1752 return render_view_->mouse_lock_dispatcher(); | 1740 return render_view_->mouse_lock_dispatcher(); |
1753 } | 1741 } |
1754 } | 1742 } |
1755 | 1743 |
1756 } // namespace content | 1744 } // namespace content |
OLD | NEW |