Chromium Code Reviews| Index: ppapi/cpp/private/flash_drm.cc |
| diff --git a/ppapi/cpp/private/flash_device_id.cc b/ppapi/cpp/private/flash_drm.cc |
| similarity index 51% |
| rename from ppapi/cpp/private/flash_device_id.cc |
| rename to ppapi/cpp/private/flash_drm.cc |
| index 6ed893573ec75f8aefb87ea7393db1e4713ee234..442ba2feaaa81ed8a65a3b402610e8c190e0cd2e 100644 |
| --- a/ppapi/cpp/private/flash_device_id.cc |
| +++ b/ppapi/cpp/private/flash_drm.cc |
| @@ -2,16 +2,21 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "ppapi/cpp/private/flash_device_id.h" |
| +#include "ppapi/cpp/private/flash_drm.h" |
| #include "ppapi/c/pp_errors.h" |
| #include "ppapi/c/private/ppb_flash_device_id.h" |
| +#include "ppapi/c/private/ppb_flash_drm.h" |
| #include "ppapi/cpp/module_impl.h" |
| namespace pp { |
| namespace { |
| +template <> const char* interface_name<PPB_Flash_DRM_1_0>() { |
| + return PPB_FLASH_DRM_INTERFACE_1_0; |
| +} |
| + |
| template <> const char* interface_name<PPB_Flash_DeviceID_1_0>() { |
| return PPB_FLASH_DEVICEID_INTERFACE_1_0; |
| } |
| @@ -20,19 +25,26 @@ template <> const char* interface_name<PPB_Flash_DeviceID_1_0>() { |
| namespace flash { |
| -DeviceID::DeviceID() { |
| +DRM::DRM() { |
| } |
| -DeviceID::DeviceID(const InstanceHandle& instance) : Resource() { |
| - if (has_interface<PPB_Flash_DeviceID_1_0>()) { |
| +DRM::DRM(const InstanceHandle& instance) : Resource() { |
| + if (has_interface<PPB_Flash_DRM_1_0>()) { |
| + PassRefFromConstructor(get_interface<PPB_Flash_DRM_1_0>()->Create( |
| + instance.pp_instance())); |
| + } else if (has_interface<PPB_Flash_DeviceID_1_0>()) { |
| PassRefFromConstructor(get_interface<PPB_Flash_DeviceID_1_0>()->Create( |
| instance.pp_instance())); |
| } |
| } |
| -int32_t DeviceID::GetDeviceID( |
| - const CompletionCallbackWithOutput<Var>& callback) { |
| - if (has_interface<PPB_Flash_DeviceID_1_0>()) { |
| +int32_t DRM::GetDeviceID(const CompletionCallbackWithOutput<Var>& callback) { |
| + if (has_interface<PPB_Flash_DRM_1_0>()) { |
| + return get_interface<PPB_Flash_DRM_1_0>()->GetDeviceID( |
| + pp_resource(), |
| + callback.output(), |
| + callback.pp_completion_callback()); |
| + } else if (has_interface<PPB_Flash_DeviceID_1_0>()) { |
|
yzshen1
2013/05/21 06:32:31
The way that our style guide prefers: remove the '
raymes
2013/05/21 16:32:51
Done.
|
| return get_interface<PPB_Flash_DeviceID_1_0>()->GetDeviceID( |
| pp_resource(), |
| callback.output(), |