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

Unified Diff: ppapi/cpp/dev/video_decoder_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/video_decoder_client_dev.h ('k') | ppapi/cpp/dev/video_decoder_dev.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/dev/video_decoder_client_dev.cc
diff --git a/ppapi/cpp/dev/video_decoder_client_dev.cc b/ppapi/cpp/dev/video_decoder_client_dev.cc
index 20cd329cf89769b7846ce65c8ccc848b4261b389..4c345308b7094dc1026f68c34d2ed5556a1d09c1 100644
--- a/ppapi/cpp/dev/video_decoder_client_dev.cc
+++ b/ppapi/cpp/dev/video_decoder_client_dev.cc
@@ -7,6 +7,7 @@
#include "ppapi/c/dev/ppp_video_decoder_dev.h"
#include "ppapi/cpp/dev/video_decoder_dev.h"
#include "ppapi/cpp/instance.h"
+#include "ppapi/cpp/instance_handle.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/module_impl.h"
@@ -21,8 +22,8 @@ void ProvidePictureBuffers(PP_Instance instance,
PP_Resource decoder,
uint32_t req_num_of_bufs,
const PP_Size* dimensions) {
- void* object = pp::Instance::GetPerInstanceObject(
- instance, kPPPVideoDecoderInterface);
+ void* object = Instance::GetPerInstanceObject(instance,
+ kPPPVideoDecoderInterface);
if (!object)
return;
static_cast<VideoDecoderClient_Dev*>(object)->ProvidePictureBuffers(
@@ -32,8 +33,8 @@ void ProvidePictureBuffers(PP_Instance instance,
void DismissPictureBuffer(PP_Instance instance,
PP_Resource decoder,
int32_t picture_buffer_id) {
- void* object = pp::Instance::GetPerInstanceObject(
- instance, kPPPVideoDecoderInterface);
+ void* object = Instance::GetPerInstanceObject(instance,
+ kPPPVideoDecoderInterface);
if (!object)
return;
static_cast<VideoDecoderClient_Dev*>(object)->DismissPictureBuffer(
@@ -43,8 +44,8 @@ void DismissPictureBuffer(PP_Instance instance,
void PictureReady(PP_Instance instance,
PP_Resource decoder,
const PP_Picture_Dev* picture) {
- void* object = pp::Instance::GetPerInstanceObject(
- instance, kPPPVideoDecoderInterface);
+ void* object = Instance::GetPerInstanceObject(instance,
+ kPPPVideoDecoderInterface);
if (!object)
return;
static_cast<VideoDecoderClient_Dev*>(object)->PictureReady(decoder, *picture);
@@ -53,8 +54,8 @@ void PictureReady(PP_Instance instance,
void NotifyError(PP_Instance instance,
PP_Resource decoder,
PP_VideoDecodeError_Dev error) {
- void* object = pp::Instance::GetPerInstanceObject(
- instance, kPPPVideoDecoderInterface);
+ void* object = Instance::GetPerInstanceObject(instance,
+ kPPPVideoDecoderInterface);
if (!object)
return;
static_cast<VideoDecoderClient_Dev*>(object)->NotifyError(decoder, error);
@@ -69,17 +70,16 @@ static PPP_VideoDecoder_Dev videodecoder_interface = {
} // namespace
-VideoDecoderClient_Dev::VideoDecoderClient_Dev(Instance* instance)
+VideoDecoderClient_Dev::VideoDecoderClient_Dev(const InstanceHandle& instance)
: associated_instance_(instance) {
- pp::Module::Get()->AddPluginInterface(kPPPVideoDecoderInterface,
- &videodecoder_interface);
- associated_instance_->AddPerInstanceObject(
- kPPPVideoDecoderInterface, this);
+ Module::Get()->AddPluginInterface(kPPPVideoDecoderInterface,
+ &videodecoder_interface);
+ Instance::AddPerInstanceObject(instance, kPPPVideoDecoderInterface, this);
}
VideoDecoderClient_Dev::~VideoDecoderClient_Dev() {
- associated_instance_->RemovePerInstanceObject(
- kPPPVideoDecoderInterface, this);
+ Instance::RemovePerInstanceObject(associated_instance_,
+ kPPPVideoDecoderInterface, this);
}
} // namespace pp
« no previous file with comments | « ppapi/cpp/dev/video_decoder_client_dev.h ('k') | ppapi/cpp/dev/video_decoder_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698