| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper_plugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 #include "webkit/plugins/ppapi/file_path.h" | 68 #include "webkit/plugins/ppapi/file_path.h" |
| 69 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" | 69 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" |
| 70 #include "webkit/plugins/ppapi/plugin_module.h" | 70 #include "webkit/plugins/ppapi/plugin_module.h" |
| 71 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 71 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 72 #include "webkit/plugins/ppapi/ppb_broker_impl.h" | 72 #include "webkit/plugins/ppapi/ppb_broker_impl.h" |
| 73 #include "webkit/plugins/ppapi/ppb_flash_impl.h" | 73 #include "webkit/plugins/ppapi/ppb_flash_impl.h" |
| 74 #include "webkit/plugins/ppapi/ppb_flash_net_connector_impl.h" | 74 #include "webkit/plugins/ppapi/ppb_flash_net_connector_impl.h" |
| 75 #include "webkit/plugins/ppapi/resource_helper.h" | 75 #include "webkit/plugins/ppapi/resource_helper.h" |
| 76 #include "webkit/plugins/webplugininfo.h" | 76 #include "webkit/plugins/webplugininfo.h" |
| 77 | 77 |
| 78 using ppapi::proxy::PlatformFileToInt; |
| 78 using WebKit::WebView; | 79 using WebKit::WebView; |
| 79 | 80 |
| 80 namespace { | 81 namespace { |
| 81 | 82 |
| 82 int32_t PlatformFileToInt(base::PlatformFile handle) { | |
| 83 #if defined(OS_WIN) | |
| 84 return static_cast<int32_t>(reinterpret_cast<intptr_t>(handle)); | |
| 85 #elif defined(OS_POSIX) | |
| 86 return handle; | |
| 87 #else | |
| 88 #error Not implemented. | |
| 89 #endif | |
| 90 } | |
| 91 | |
| 92 base::SyncSocket::Handle DuplicateHandle(base::SyncSocket::Handle handle) { | 83 base::SyncSocket::Handle DuplicateHandle(base::SyncSocket::Handle handle) { |
| 93 base::SyncSocket::Handle out_handle = base::kInvalidPlatformFileValue; | 84 base::SyncSocket::Handle out_handle = base::kInvalidPlatformFileValue; |
| 94 #if defined(OS_WIN) | 85 #if defined(OS_WIN) |
| 95 DWORD options = DUPLICATE_SAME_ACCESS; | 86 DWORD options = DUPLICATE_SAME_ACCESS; |
| 96 if (!::DuplicateHandle(::GetCurrentProcess(), | 87 if (!::DuplicateHandle(::GetCurrentProcess(), |
| 97 handle, | 88 handle, |
| 98 ::GetCurrentProcess(), | 89 ::GetCurrentProcess(), |
| 99 &out_handle, | 90 &out_handle, |
| 100 0, | 91 0, |
| 101 FALSE, | 92 FALSE, |
| (...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1754 if (!context) | 1745 if (!context) |
| 1755 return NULL; | 1746 return NULL; |
| 1756 if (!context->makeContextCurrent() || context->isContextLost()) | 1747 if (!context->makeContextCurrent() || context->isContextLost()) |
| 1757 return NULL; | 1748 return NULL; |
| 1758 | 1749 |
| 1759 RendererGLContext* parent_context = context->context(); | 1750 RendererGLContext* parent_context = context->context(); |
| 1760 if (!parent_context) | 1751 if (!parent_context) |
| 1761 return NULL; | 1752 return NULL; |
| 1762 return parent_context; | 1753 return parent_context; |
| 1763 } | 1754 } |
| OLD | NEW |