Index: ppapi/proxy/flash_drm_resource.cc |
diff --git a/ppapi/proxy/flash_device_id_resource.cc b/ppapi/proxy/flash_drm_resource.cc |
similarity index 38% |
rename from ppapi/proxy/flash_device_id_resource.cc |
rename to ppapi/proxy/flash_drm_resource.cc |
index 493ebdacc3c1063fcfebafb1e7df3efe6dd839c4..0f244ba4af5ca2e1c73335be16e0d05c6760063c 100644 |
--- a/ppapi/proxy/flash_device_id_resource.cc |
+++ b/ppapi/proxy/flash_drm_resource.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "ppapi/proxy/flash_device_id_resource.h" |
+#include "ppapi/proxy/flash_drm_resource.h" |
#include "base/bind.h" |
#include "ppapi/c/pp_errors.h" |
@@ -13,48 +13,43 @@ |
namespace ppapi { |
namespace proxy { |
-FlashDeviceIDResource::FlashDeviceIDResource(Connection connection, |
- PP_Instance instance) |
- : PluginResource(connection, instance), |
- dest_(NULL) { |
- SendCreate(BROWSER, PpapiHostMsg_FlashDeviceID_Create()); |
+FlashDRMResource::FlashDRMResource(Connection connection, |
+ PP_Instance instance) |
+ : PluginResource(connection, instance) { |
+ SendCreate(BROWSER, PpapiHostMsg_FlashDRM_Create()); |
} |
-FlashDeviceIDResource::~FlashDeviceIDResource() { |
+FlashDRMResource::~FlashDRMResource() { |
} |
-thunk::PPB_Flash_DeviceID_API* |
-FlashDeviceIDResource::AsPPB_Flash_DeviceID_API() { |
+thunk::PPB_Flash_DRM_API* |
+FlashDRMResource::AsPPB_Flash_DRM_API() { |
yzshen1
2013/05/21 06:32:31
I guess we don't have to wrap now. (But I didn't a
raymes
2013/05/21 16:32:51
Done.
|
return this; |
} |
-int32_t FlashDeviceIDResource::GetDeviceID( |
- PP_Var* id, |
- scoped_refptr<TrackedCallback> callback) { |
- if (TrackedCallback::IsPending(callback_)) |
- return PP_ERROR_INPROGRESS; |
+int32_t FlashDRMResource::GetDeviceID(PP_Var* id, |
+ scoped_refptr<TrackedCallback> callback) { |
if (!id) |
return PP_ERROR_BADARGUMENT; |
- dest_ = id; |
- callback_ = callback; |
+ *id = PP_MakeUndefined(); |
- Call<PpapiPluginMsg_FlashDeviceID_GetDeviceIDReply>( |
+ Call<PpapiPluginMsg_FlashDRM_GetDeviceIDReply>( |
BROWSER, |
- PpapiHostMsg_FlashDeviceID_GetDeviceID(), |
- base::Bind(&FlashDeviceIDResource::OnPluginMsgGetDeviceIDReply, this)); |
+ PpapiHostMsg_FlashDRM_GetDeviceID(), |
+ base::Bind(&FlashDRMResource::OnPluginMsgGetDeviceIDReply, this, |
+ id, callback)); |
return PP_OK_COMPLETIONPENDING; |
} |
-void FlashDeviceIDResource::OnPluginMsgGetDeviceIDReply( |
+void FlashDRMResource::OnPluginMsgGetDeviceIDReply( |
+ PP_Var* dest, |
+ scoped_refptr<TrackedCallback> callback, |
const ResourceMessageReplyParams& params, |
const std::string& id) { |
if (params.result() == PP_OK) |
yzshen1
2013/05/21 06:32:31
Please check whether callback is pending. If not,
raymes
2013/05/21 16:32:51
Done.
|
- *dest_ = StringVar::StringToPPVar(id); |
- else |
- *dest_ = PP_MakeUndefined(); |
- dest_ = NULL; |
- callback_->Run(params.result()); |
+ *dest = StringVar::StringToPPVar(id); |
+ callback->Run(params.result()); |
} |
} // namespace proxy |