| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ppapi/proxy/flash_drm_resource.h" | 5 #include "ppapi/proxy/flash_drm_resource.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
| 9 #include "ppapi/proxy/dispatch_reply_message.h" | 9 #include "ppapi/proxy/dispatch_reply_message.h" |
| 10 #include "ppapi/proxy/file_ref_resource.h" | |
| 11 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
| 11 #include "ppapi/proxy/ppb_file_ref_proxy.h" |
| 12 #include "ppapi/shared_impl/ppb_file_ref_shared.h" |
| 12 #include "ppapi/shared_impl/var.h" | 13 #include "ppapi/shared_impl/var.h" |
| 13 | 14 |
| 14 namespace ppapi { | 15 namespace ppapi { |
| 15 namespace proxy { | 16 namespace proxy { |
| 16 | 17 |
| 17 FlashDRMResource::FlashDRMResource(Connection connection, | 18 FlashDRMResource::FlashDRMResource(Connection connection, |
| 18 PP_Instance instance) | 19 PP_Instance instance) |
| 19 : PluginResource(connection, instance) { | 20 : PluginResource(connection, instance) { |
| 20 SendCreate(BROWSER, PpapiHostMsg_FlashDRM_Create()); | 21 SendCreate(BROWSER, PpapiHostMsg_FlashDRM_Create()); |
| 21 SendCreate(RENDERER, PpapiHostMsg_FlashDRM_Create()); | 22 SendCreate(RENDERER, PpapiHostMsg_FlashDRM_Create()); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 if (params.result() == PP_OK) | 81 if (params.result() == PP_OK) |
| 81 *dest = StringVar::StringToPPVar(id); | 82 *dest = StringVar::StringToPPVar(id); |
| 82 callback->Run(params.result()); | 83 callback->Run(params.result()); |
| 83 } | 84 } |
| 84 } | 85 } |
| 85 | 86 |
| 86 void FlashDRMResource::OnPluginMsgGetVoucherFileReply( | 87 void FlashDRMResource::OnPluginMsgGetVoucherFileReply( |
| 87 PP_Resource* dest, | 88 PP_Resource* dest, |
| 88 scoped_refptr<TrackedCallback> callback, | 89 scoped_refptr<TrackedCallback> callback, |
| 89 const ResourceMessageReplyParams& params, | 90 const ResourceMessageReplyParams& params, |
| 90 const FileRefCreateInfo& file_info) { | 91 const PPB_FileRef_CreateInfo& file_info) { |
| 91 if (TrackedCallback::IsPending(callback)) { | 92 if (TrackedCallback::IsPending(callback)) { |
| 92 if (params.result() == PP_OK) { | 93 if (params.result() == PP_OK) |
| 93 *dest = FileRefResource::CreateFileRef( | 94 *dest = PPB_FileRef_Proxy::DeserializeFileRef(file_info); |
| 94 connection(), | |
| 95 pp_instance(), | |
| 96 file_info); | |
| 97 } | |
| 98 callback->Run(params.result()); | 95 callback->Run(params.result()); |
| 99 } | 96 } |
| 100 } | 97 } |
| 101 | 98 |
| 102 } // namespace proxy | 99 } // namespace proxy |
| 103 } // namespace ppapi | 100 } // namespace ppapi |
| OLD | NEW |