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

Unified Diff: ppapi/cpp/mouse_lock.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/mouse_lock.h ('k') | ppapi/cpp/pass_ref.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/mouse_lock.cc
diff --git a/ppapi/cpp/mouse_lock.cc b/ppapi/cpp/mouse_lock.cc
index 4d3b9bf70ee26d15d41a018050e80d6c3faf6f2d..828ee89436b5d49142453889e0fac109479c58a4 100644
--- a/ppapi/cpp/mouse_lock.cc
+++ b/ppapi/cpp/mouse_lock.cc
@@ -8,6 +8,7 @@
#include "ppapi/c/ppp_mouse_lock.h"
#include "ppapi/cpp/completion_callback.h"
#include "ppapi/cpp/instance.h"
+#include "ppapi/cpp/instance_handle.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/module_impl.h"
@@ -19,7 +20,7 @@ static const char kPPPMouseLockInterface[] = PPP_MOUSELOCK_INTERFACE;
void MouseLockLost(PP_Instance instance) {
void* object =
- pp::Instance::GetPerInstanceObject(instance, kPPPMouseLockInterface);
+ Instance::GetPerInstanceObject(instance, kPPPMouseLockInterface);
if (!object)
return;
static_cast<MouseLock*>(object)->MouseLockLost();
@@ -35,28 +36,28 @@ template <> const char* interface_name<PPB_MouseLock>() {
} // namespace
-MouseLock::MouseLock(Instance* instance)
+MouseLock::MouseLock(const InstanceHandle& instance)
: associated_instance_(instance) {
- pp::Module::Get()->AddPluginInterface(kPPPMouseLockInterface,
- &ppp_mouse_lock);
- associated_instance_->AddPerInstanceObject(kPPPMouseLockInterface, this);
+ Module::Get()->AddPluginInterface(kPPPMouseLockInterface, &ppp_mouse_lock);
+ Instance::AddPerInstanceObject(instance, kPPPMouseLockInterface, this);
}
MouseLock::~MouseLock() {
- associated_instance_->RemovePerInstanceObject(kPPPMouseLockInterface, this);
+ Instance::RemovePerInstanceObject(associated_instance_,
+ kPPPMouseLockInterface, this);
}
int32_t MouseLock::LockMouse(const CompletionCallback& cc) {
if (!has_interface<PPB_MouseLock>())
return cc.MayForce(PP_ERROR_NOINTERFACE);
return get_interface<PPB_MouseLock>()->LockMouse(
- associated_instance_->pp_instance(), cc.pp_completion_callback());
+ associated_instance_.pp_instance(), cc.pp_completion_callback());
}
void MouseLock::UnlockMouse() {
if (has_interface<PPB_MouseLock>()) {
get_interface<PPB_MouseLock>()->UnlockMouse(
- associated_instance_->pp_instance());
+ associated_instance_.pp_instance());
}
}
« no previous file with comments | « ppapi/cpp/mouse_lock.h ('k') | ppapi/cpp/pass_ref.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698