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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 | 520 |
521 bool Init(base::ProcessHandle plugin_process_handle, | 521 bool Init(base::ProcessHandle plugin_process_handle, |
522 const IPC::ChannelHandle& channel_handle, | 522 const IPC::ChannelHandle& channel_handle, |
523 PP_Module pp_module, | 523 PP_Module pp_module, |
524 ppapi::proxy::Dispatcher::GetInterfaceFunc local_get_interface, | 524 ppapi::proxy::Dispatcher::GetInterfaceFunc local_get_interface, |
525 const ppapi::Preferences& preferences) { | 525 const ppapi::Preferences& preferences) { |
526 if (channel_handle.name.empty()) | 526 if (channel_handle.name.empty()) |
527 return false; | 527 return false; |
528 | 528 |
529 #if defined(OS_POSIX) | 529 #if defined(OS_POSIX) |
| 530 // Check the validity of fd for bug investigation. Remove after fixed. |
| 531 // See for details: crbug.com/103957. |
| 532 CHECK_NE(-1, channel_handle.socket.fd); |
530 if (channel_handle.socket.fd == -1) | 533 if (channel_handle.socket.fd == -1) |
531 return false; | 534 return false; |
532 #endif | 535 #endif |
533 | 536 |
534 dispatcher_delegate_.reset(new DispatcherDelegate); | 537 dispatcher_delegate_.reset(new DispatcherDelegate); |
535 dispatcher_.reset(new ppapi::proxy::HostDispatcher( | 538 dispatcher_.reset(new ppapi::proxy::HostDispatcher( |
536 plugin_process_handle, pp_module, local_get_interface)); | 539 plugin_process_handle, pp_module, local_get_interface)); |
537 | 540 |
538 if (!dispatcher_->InitHostWithChannel(dispatcher_delegate_.get(), | 541 if (!dispatcher_->InitHostWithChannel(dispatcher_delegate_.get(), |
539 channel_handle, | 542 channel_handle, |
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1931 if (!context) | 1934 if (!context) |
1932 return NULL; | 1935 return NULL; |
1933 if (!context->makeContextCurrent() || context->isContextLost()) | 1936 if (!context->makeContextCurrent() || context->isContextLost()) |
1934 return NULL; | 1937 return NULL; |
1935 | 1938 |
1936 RendererGLContext* parent_context = context->context(); | 1939 RendererGLContext* parent_context = context->context(); |
1937 if (!parent_context) | 1940 if (!parent_context) |
1938 return NULL; | 1941 return NULL; |
1939 return parent_context; | 1942 return parent_context; |
1940 } | 1943 } |
OLD | NEW |