Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2781)

Unified Diff: content/renderer/pepper_plugin_delegate_impl.cc

Issue 8965053: Implement support for a cancelable SyncSocket. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Using a single event for file operations on Windows. Some comment improvements. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper_plugin_delegate_impl.cc
diff --git a/content/renderer/pepper_plugin_delegate_impl.cc b/content/renderer/pepper_plugin_delegate_impl.cc
index 40e3f1b6d4a6a7b8fea0a4b695f7ce2bb1bf8e7c..83316a937effcac17e06843bcf4950a60fcdcb7c 100644
--- a/content/renderer/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper_plugin_delegate_impl.cc
@@ -822,13 +822,11 @@ void PpapiBrokerImpl::ConnectPluginToBroker(
base::SyncSocket::Handle plugin_handle = base::kInvalidPlatformFileValue;
int32_t result = PP_OK;
- base::SyncSocket* sockets[2] = {0};
- if (base::SyncSocket::CreatePair(sockets)) {
- // The socket objects will be deleted when this function exits, closing the
- // handles. Any uses of the socket must duplicate them.
- scoped_ptr<base::SyncSocket> broker_socket(sockets[0]);
- scoped_ptr<base::SyncSocket> plugin_socket(sockets[1]);
-
+ // The socket objects will be deleted when this function exits, closing the
+ // handles. Any uses of the socket must duplicate them.
+ scoped_ptr<base::SyncSocket> broker_socket(new base::SyncSocket());
+ scoped_ptr<base::SyncSocket> plugin_socket(new base::SyncSocket());
+ if (base::SyncSocket::CreatePair(broker_socket.get(), plugin_socket.get())) {
result = dispatcher_->SendHandleToBroker(client->pp_instance(),
broker_socket->handle());

Powered by Google App Engine
This is Rietveld 408576698