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 "chrome/renderer/pepper/pepper_flash_drm_renderer_host.h" | 5 #include "chrome/renderer/pepper/pepper_flash_drm_renderer_host.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "content/public/renderer/renderer_ppapi_host.h" | 8 #include "content/public/renderer/renderer_ppapi_host.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/host/dispatch_host_message.h" | 10 #include "ppapi/host/dispatch_host_message.h" |
11 #include "ppapi/host/host_message_context.h" | 11 #include "ppapi/host/host_message_context.h" |
12 #include "ppapi/host/ppapi_host.h" | 12 #include "ppapi/host/ppapi_host.h" |
13 #include "ppapi/proxy/ppapi_messages.h" | 13 #include "ppapi/proxy/ppapi_messages.h" |
14 #include "ppapi/proxy/ppb_file_ref_proxy.h" | 14 #include "ppapi/proxy/ppb_file_ref_proxy.h" |
15 #include "webkit/plugins/ppapi/plugin_module.h" | |
16 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 15 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
17 | 16 |
18 namespace chrome { | 17 namespace chrome { |
19 | 18 |
20 // TODO(raymes): This is duplicated from pepper_flash_drm_host.cc but once | 19 // TODO(raymes): This is duplicated from pepper_flash_drm_host.cc but once |
21 // FileRef is refactored to the browser, it won't need to be. | 20 // FileRef is refactored to the browser, it won't need to be. |
22 namespace { | 21 namespace { |
23 const base::FilePath::CharType kVoucherFilename[] = | 22 const base::FilePath::CharType kVoucherFilename[] = |
24 FILE_PATH_LITERAL("plugin.vch"); | 23 FILE_PATH_LITERAL("plugin.vch"); |
25 } // namespace | 24 } // namespace |
(...skipping 19 matching lines...) Expand all Loading... |
45 return PP_ERROR_FAILED; | 44 return PP_ERROR_FAILED; |
46 } | 45 } |
47 | 46 |
48 int32_t PepperFlashDRMRendererHost::OnGetVoucherFile( | 47 int32_t PepperFlashDRMRendererHost::OnGetVoucherFile( |
49 ppapi::host::HostMessageContext* context) { | 48 ppapi::host::HostMessageContext* context) { |
50 webkit::ppapi::PluginInstance* plugin_instance = | 49 webkit::ppapi::PluginInstance* plugin_instance = |
51 renderer_ppapi_host_->GetPluginInstance(pp_instance()); | 50 renderer_ppapi_host_->GetPluginInstance(pp_instance()); |
52 if (!plugin_instance) | 51 if (!plugin_instance) |
53 return PP_ERROR_FAILED; | 52 return PP_ERROR_FAILED; |
54 | 53 |
55 base::FilePath plugin_dir = plugin_instance->module()->path().DirName(); | 54 base::FilePath plugin_dir = plugin_instance->GetModulePath().DirName(); |
56 DCHECK(!plugin_dir.empty()); | 55 DCHECK(!plugin_dir.empty()); |
57 base::FilePath voucher_file = plugin_dir.Append( | 56 base::FilePath voucher_file = plugin_dir.Append( |
58 base::FilePath(kVoucherFilename)); | 57 base::FilePath(kVoucherFilename)); |
59 | 58 |
60 ppapi::PPB_FileRef_CreateInfo create_info; | 59 ppapi::PPB_FileRef_CreateInfo create_info; |
61 ppapi::proxy::PPB_FileRef_Proxy::SerializeFileRef( | 60 ppapi::proxy::PPB_FileRef_Proxy::SerializeFileRef( |
62 plugin_instance->CreateExternalFileReference(voucher_file), | 61 plugin_instance->CreateExternalFileReference(voucher_file), |
63 &create_info); | 62 &create_info); |
64 context->reply_msg = | 63 context->reply_msg = |
65 PpapiPluginMsg_FlashDRM_GetVoucherFileReply(create_info); | 64 PpapiPluginMsg_FlashDRM_GetVoucherFileReply(create_info); |
66 return PP_OK; | 65 return PP_OK; |
67 } | 66 } |
68 | 67 |
69 } // namespace chrome | 68 } // namespace chrome |
70 | 69 |
OLD | NEW |