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

Unified Diff: webkit/plugins/ppapi/ppb_broker_impl.cc

Issue 6833002: Implemented PPB_Broker_Proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review feedback Created 9 years, 8 months 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
« ppapi/proxy/ppb_broker_proxy.cc ('K') | « webkit/plugins/ppapi/ppb_broker_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_broker_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_broker_impl.cc b/webkit/plugins/ppapi/ppb_broker_impl.cc
index d214c7bc038f09fac5f3e610b36a9d1417e3b0c2..45fe560c43513ea840a0eb09ede270f6b2b02ea9 100644
--- a/webkit/plugins/ppapi/ppb_broker_impl.cc
+++ b/webkit/plugins/ppapi/ppb_broker_impl.cc
@@ -67,7 +67,7 @@ PPB_Broker_Impl::PPB_Broker_Impl(PluginInstance* instance)
: Resource(instance),
broker_(NULL),
connect_callback_(),
- pipe_handle_(0) {
+ pipe_handle_(base::kInvalidPlatformFileValue) {
}
PPB_Broker_Impl::~PPB_Broker_Impl() {
@@ -76,8 +76,8 @@ PPB_Broker_Impl::~PPB_Broker_Impl() {
broker_ = NULL;
}
- // TODO(ddorwin): Should the plugin or Chrome free the handle?
- pipe_handle_ = 0;
+ // The plugin owns the handle.
+ pipe_handle_ = base::kInvalidPlatformFileValue;
}
const PPB_BrokerTrusted* PPB_Broker_Impl::GetTrustedInterface() {
@@ -108,10 +108,6 @@ int32_t PPB_Broker_Impl::Connect(
int32_t PPB_Broker_Impl::GetHandle(int32_t* handle) {
*handle = pipe_handle_;
-
- if (!*handle)
- return PP_ERROR_FAILED;
-
return PP_OK;
}
@@ -119,6 +115,7 @@ PPB_Broker_Impl* PPB_Broker_Impl::AsPPB_Broker_Impl() {
return this;
}
+// Transfers ownership of the handle to the plugin.
void PPB_Broker_Impl::BrokerConnected(int32_t handle) {
DCHECK(handle);
pipe_handle_ = handle;
@@ -128,7 +125,7 @@ void PPB_Broker_Impl::BrokerConnected(int32_t handle) {
scoped_refptr<TrackedCompletionCallback> callback;
callback.swap(connect_callback_);
- callback->Run(0); // Will complete abortively if necessary.
+ callback->Run(PP_OK); // Will complete abortively if necessary.
}
} // namespace ppapi
« ppapi/proxy/ppb_broker_proxy.cc ('K') | « webkit/plugins/ppapi/ppb_broker_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698