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/webplugin_delegate_proxy.h" | 5 #include "content/renderer/webplugin_delegate_proxy.h" |
6 | 6 |
7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #elif defined(USE_X11) | 9 #elif defined(USE_X11) |
10 #include <cairo/cairo.h> | 10 #include <cairo/cairo.h> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 #if defined(OS_POSIX) | 56 #if defined(OS_POSIX) |
57 #include "ipc/ipc_channel_posix.h" | 57 #include "ipc/ipc_channel_posix.h" |
58 #endif | 58 #endif |
59 | 59 |
60 #if defined(OS_MACOSX) | 60 #if defined(OS_MACOSX) |
61 #include "base/mac/mac_util.h" | 61 #include "base/mac/mac_util.h" |
62 #endif | 62 #endif |
63 | 63 |
64 #if defined(OS_WIN) | 64 #if defined(OS_WIN) |
65 #include "content/common/sandbox_policy.h" | 65 #include "content/public/common/sandbox_init.h" |
66 #endif | 66 #endif |
67 | 67 |
68 using WebKit::WebBindings; | 68 using WebKit::WebBindings; |
69 using WebKit::WebCursorInfo; | 69 using WebKit::WebCursorInfo; |
70 using WebKit::WebDragData; | 70 using WebKit::WebDragData; |
71 using WebKit::WebInputEvent; | 71 using WebKit::WebInputEvent; |
72 using WebKit::WebString; | 72 using WebKit::WebString; |
73 using WebKit::WebView; | 73 using WebKit::WebView; |
74 | 74 |
75 // Proxy for WebPluginResourceClient. The object owns itself after creation, | 75 // Proxy for WebPluginResourceClient. The object owns itself after creation, |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 // FileDescriptor message fields needs to remain valid until the message is | 496 // FileDescriptor message fields needs to remain valid until the message is |
497 // sent or else the sendmsg() call will fail. | 497 // sent or else the sendmsg() call will fail. |
498 if ((handle_out->fd = HANDLE_EINTR(dup(handle_in.fd))) < 0) { | 498 if ((handle_out->fd = HANDLE_EINTR(dup(handle_in.fd))) < 0) { |
499 PLOG(ERROR) << "dup()"; | 499 PLOG(ERROR) << "dup()"; |
500 return; | 500 return; |
501 } | 501 } |
502 handle_out->auto_close = true; | 502 handle_out->auto_close = true; |
503 #elif defined(OS_WIN) | 503 #elif defined(OS_WIN) |
504 // On Windows we need to duplicate the handle for the plugin process. | 504 // On Windows we need to duplicate the handle for the plugin process. |
505 *handle_out = NULL; | 505 *handle_out = NULL; |
506 sandbox::BrokerDuplicateHandle(handle_in, peer_pid, handle_out, | 506 content::BrokerDuplicateHandle(handle_in, peer_pid, handle_out, |
507 FILE_MAP_READ | FILE_MAP_WRITE, 0); | 507 FILE_MAP_READ | FILE_MAP_WRITE, 0); |
508 CHECK(*handle_out != NULL); | 508 CHECK(*handle_out != NULL); |
509 #else | 509 #else |
510 // Don't need to do anything special for other platforms. | 510 // Don't need to do anything special for other platforms. |
511 *handle_out = handle_in; | 511 *handle_out = handle_in; |
512 #endif | 512 #endif |
513 } | 513 } |
514 | 514 |
515 void WebPluginDelegateProxy::SendUpdateGeometry( | 515 void WebPluginDelegateProxy::SendUpdateGeometry( |
516 bool bitmaps_changed) { | 516 bool bitmaps_changed) { |
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1473 } | 1473 } |
1474 #endif | 1474 #endif |
1475 | 1475 |
1476 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1476 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
1477 int resource_id) { | 1477 int resource_id) { |
1478 if (!plugin_) | 1478 if (!plugin_) |
1479 return; | 1479 return; |
1480 | 1480 |
1481 plugin_->URLRedirectResponse(allow, resource_id); | 1481 plugin_->URLRedirectResponse(allow, resource_id); |
1482 } | 1482 } |
OLD | NEW |