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/npapi/webplugin_delegate_proxy.h" | 5 #include "content/renderer/npapi/webplugin_delegate_proxy.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 if (render_view_) | 491 if (render_view_) |
492 render_view_->PluginFocusChanged(false, instance_id_); | 492 render_view_->PluginFocusChanged(false, instance_id_); |
493 #endif | 493 #endif |
494 } | 494 } |
495 | 495 |
496 static void CopySharedMemoryHandleForMessage( | 496 static void CopySharedMemoryHandleForMessage( |
497 const base::SharedMemoryHandle& handle_in, | 497 const base::SharedMemoryHandle& handle_in, |
498 base::SharedMemoryHandle* handle_out, | 498 base::SharedMemoryHandle* handle_out, |
499 base::ProcessId peer_pid) { | 499 base::ProcessId peer_pid) { |
500 #if defined(OS_POSIX) | 500 #if defined(OS_POSIX) |
501 // On POSIX, base::ShardMemoryHandle is typedef'ed to FileDescriptor, and | 501 *handle_out = base::SharedMemory::DeepCopyHandle(handle_in, true); |
502 // FileDescriptor message fields needs to remain valid until the message is | |
503 // sent or else the sendmsg() call will fail. | |
504 if ((handle_out->fd = HANDLE_EINTR(dup(handle_in.fd))) < 0) { | |
505 PLOG(ERROR) << "dup()"; | |
506 return; | |
507 } | |
508 handle_out->auto_close = true; | |
509 #elif defined(OS_WIN) | 502 #elif defined(OS_WIN) |
510 // On Windows we need to duplicate the handle for the plugin process. | 503 // On Windows we need to duplicate the handle for the plugin process. |
511 *handle_out = NULL; | 504 *handle_out = NULL; |
512 BrokerDuplicateHandle(handle_in, peer_pid, handle_out, | 505 BrokerDuplicateHandle(handle_in, peer_pid, handle_out, |
513 FILE_MAP_READ | FILE_MAP_WRITE, 0); | 506 FILE_MAP_READ | FILE_MAP_WRITE, 0); |
514 DCHECK(*handle_out != NULL); | 507 DCHECK(*handle_out != NULL); |
515 #else | 508 #else |
516 #error Shared memory copy not implemented. | 509 #error Shared memory copy not implemented. |
517 #endif | 510 #endif |
518 } | 511 } |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 | 1228 |
1236 plugin_->URLRedirectResponse(allow, resource_id); | 1229 plugin_->URLRedirectResponse(allow, resource_id); |
1237 } | 1230 } |
1238 | 1231 |
1239 void WebPluginDelegateProxy::OnCheckIfRunInsecureContent(const GURL& url, | 1232 void WebPluginDelegateProxy::OnCheckIfRunInsecureContent(const GURL& url, |
1240 bool* result) { | 1233 bool* result) { |
1241 *result = plugin_->CheckIfRunInsecureContent(url); | 1234 *result = plugin_->CheckIfRunInsecureContent(url); |
1242 } | 1235 } |
1243 | 1236 |
1244 } // namespace content | 1237 } // namespace content |
OLD | NEW |