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

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

Issue 7669055: Remove webkit::ppapi::Resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nulls auditeed Created 9 years, 4 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
« no previous file with comments | « webkit/plugins/ppapi/ppb_broker_impl.h ('k') | webkit/plugins/ppapi/ppb_buffer_impl.h » ('j') | 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 46ff79f49e09e85555c6b44e1400250f81cc68c1..8bf2e79ea5565f5021b97e85ce28209b1d4b2976 100644
--- a/webkit/plugins/ppapi/ppb_broker_impl.cc
+++ b/webkit/plugins/ppapi/ppb_broker_impl.cc
@@ -7,6 +7,7 @@
#include "base/logging.h"
#include "webkit/plugins/ppapi/common.h"
#include "webkit/plugins/ppapi/plugin_module.h"
+#include "webkit/plugins/ppapi/resource_helper.h"
using ::ppapi::thunk::PPB_Broker_API;
@@ -31,7 +32,7 @@ int32_t PlatformFileToInt(base::PlatformFile handle) {
// PPB_Broker_Impl ------------------------------------------------------
-PPB_Broker_Impl::PPB_Broker_Impl(PluginInstance* instance)
+PPB_Broker_Impl::PPB_Broker_Impl(PP_Instance instance)
: Resource(instance),
broker_(NULL),
connect_callback_(),
@@ -65,15 +66,19 @@ int32_t PPB_Broker_Impl::Connect(PP_CompletionCallback connect_callback) {
return PP_ERROR_FAILED;
}
+ PluginInstance* plugin_instance = ResourceHelper::GetPluginInstance(this);
+ if (!plugin_instance)
+ return PP_ERROR_FAILED;
+
// The callback must be populated now in case we are connected to the broker
// and BrokerConnected is called before ConnectToPpapiBroker returns.
// Because it must be created now, it must be aborted and cleared if
// ConnectToPpapiBroker fails.
connect_callback_ = new TrackedCompletionCallback(
- instance()->module()->GetCallbackTracker(), pp_resource(),
+ plugin_instance->module()->GetCallbackTracker(), pp_resource(),
connect_callback);
- broker_ = instance()->delegate()->ConnectToPpapiBroker(this);
+ broker_ = plugin_instance->delegate()->ConnectToPpapiBroker(this);
if (!broker_) {
scoped_refptr<TrackedCompletionCallback> callback;
callback.swap(connect_callback_);
« no previous file with comments | « webkit/plugins/ppapi/ppb_broker_impl.h ('k') | webkit/plugins/ppapi/ppb_buffer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698