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

Unified Diff: ppapi/cpp/dev/widget_client_dev.cc

Issue 9381010: Convert resources to take an instance key instead of an Instance*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: USELESS PATCH TITLE Created 8 years, 10 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 | « ppapi/cpp/dev/widget_client_dev.h ('k') | ppapi/cpp/dev/zoom_dev.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/dev/widget_client_dev.cc
diff --git a/ppapi/cpp/dev/widget_client_dev.cc b/ppapi/cpp/dev/widget_client_dev.cc
index 9f539833761bae73d5546632bfa0781e76940651..f170e159e07a389894199e01db2d1ee419102a81 100644
--- a/ppapi/cpp/dev/widget_client_dev.cc
+++ b/ppapi/cpp/dev/widget_client_dev.cc
@@ -9,6 +9,7 @@
#include "ppapi/cpp/dev/scrollbar_dev.h"
#include "ppapi/cpp/dev/widget_dev.h"
#include "ppapi/cpp/instance.h"
+#include "ppapi/cpp/instance_handle.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/module_impl.h"
#include "ppapi/cpp/rect.h"
@@ -24,8 +25,7 @@ const char kPPPWidgetInterface[] = PPP_WIDGET_DEV_INTERFACE;
void Widget_Invalidate(PP_Instance instance,
PP_Resource widget_id,
const PP_Rect* dirty_rect) {
- void* object =
- pp::Instance::GetPerInstanceObject(instance, kPPPWidgetInterface);
+ void* object = Instance::GetPerInstanceObject(instance, kPPPWidgetInterface);
if (!object)
return;
return static_cast<WidgetClient_Dev*>(object)->InvalidateWidget(
@@ -44,7 +44,7 @@ void Scrollbar_ValueChanged(PP_Instance instance,
PP_Resource scrollbar_id,
uint32_t value) {
void* object =
- pp::Instance::GetPerInstanceObject(instance, kPPPScrollbarInterface);
+ Instance::GetPerInstanceObject(instance, kPPPScrollbarInterface);
if (!object)
return;
return static_cast<WidgetClient_Dev*>(object)->ScrollbarValueChanged(
@@ -55,7 +55,7 @@ void Scrollbar_OverlayChanged(PP_Instance instance,
PP_Resource scrollbar_id,
PP_Bool overlay) {
void* object =
- pp::Instance::GetPerInstanceObject(instance, kPPPScrollbarInterface);
+ Instance::GetPerInstanceObject(instance, kPPPScrollbarInterface);
if (!object)
return;
return static_cast<WidgetClient_Dev*>(object)->ScrollbarOverlayChanged(
@@ -69,18 +69,20 @@ static PPP_Scrollbar_Dev scrollbar_interface = {
} // namespace
-WidgetClient_Dev::WidgetClient_Dev(Instance* instance)
+WidgetClient_Dev::WidgetClient_Dev(const InstanceHandle& instance)
: associated_instance_(instance) {
- pp::Module::Get()->AddPluginInterface(kPPPWidgetInterface, &widget_interface);
- associated_instance_->AddPerInstanceObject(kPPPWidgetInterface, this);
- pp::Module::Get()->AddPluginInterface(kPPPScrollbarInterface,
- &scrollbar_interface);
- associated_instance_->AddPerInstanceObject(kPPPScrollbarInterface, this);
+ Module::Get()->AddPluginInterface(kPPPWidgetInterface, &widget_interface);
+ Instance::AddPerInstanceObject(instance, kPPPWidgetInterface, this);
+ Module::Get()->AddPluginInterface(kPPPScrollbarInterface,
+ &scrollbar_interface);
+ Instance::AddPerInstanceObject(instance, kPPPScrollbarInterface, this);
}
WidgetClient_Dev::~WidgetClient_Dev() {
- associated_instance_->RemovePerInstanceObject(kPPPScrollbarInterface, this);
- associated_instance_->RemovePerInstanceObject(kPPPWidgetInterface, this);
+ Instance::RemovePerInstanceObject(associated_instance_,
+ kPPPScrollbarInterface, this);
+ Instance::RemovePerInstanceObject(associated_instance_,
+ kPPPWidgetInterface, this);
}
} // namespace pp
« no previous file with comments | « ppapi/cpp/dev/widget_client_dev.h ('k') | ppapi/cpp/dev/zoom_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698