blob: 70e0c02465f3dce85200c6f88bb566f1a5b7cecc [file] [log] [blame]
[email protected]1c081e52013-05-25 14:30:551// 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
3// found in the LICENSE file.
4
5#ifndef PPAPI_PROXY_FLASH_DRM_RESOURCE_H_
6#define PPAPI_PROXY_FLASH_DRM_RESOURCE_H_
7
avie029c4132015-12-23 06:45:228#include <stdint.h>
9
10#include "base/macros.h"
[email protected]1c081e52013-05-25 14:30:5511#include "ppapi/proxy/plugin_resource.h"
12#include "ppapi/proxy/ppapi_proxy_export.h"
13#include "ppapi/shared_impl/tracked_callback.h"
14#include "ppapi/thunk/ppb_flash_drm_api.h"
15
16namespace ppapi {
[email protected]c6420f082013-09-18 22:42:4117struct FileRefCreateInfo;
[email protected]a245006a2013-06-11 21:36:0518}
19
20namespace ppapi {
[email protected]1c081e52013-05-25 14:30:5521namespace proxy {
22
23class FlashDRMResource
24 : public PluginResource,
25 public thunk::PPB_Flash_DRM_API {
26 public:
27 FlashDRMResource(Connection connection,
28 PP_Instance instance);
nicke4784432015-04-23 14:01:4829 ~FlashDRMResource() override;
[email protected]1c081e52013-05-25 14:30:5530
31 // Resource override.
nicke4784432015-04-23 14:01:4832 thunk::PPB_Flash_DRM_API* AsPPB_Flash_DRM_API() override;
[email protected]1c081e52013-05-25 14:30:5533
34 // PPB_Flash_DRM_API implementation.
nicke4784432015-04-23 14:01:4835 int32_t GetDeviceID(PP_Var* id,
36 scoped_refptr<TrackedCallback> callback) override;
37 PP_Bool GetHmonitor(int64_t* hmonitor) override;
38 int32_t GetVoucherFile(
[email protected]a245006a2013-06-11 21:36:0539 PP_Resource* file_ref,
mostynb699af3c2014-10-06 18:03:3440 scoped_refptr<TrackedCallback> callback) override;
nicke4784432015-04-23 14:01:4841 int32_t MonitorIsExternal(
[email protected]5a9f47ad2013-11-27 01:33:3742 PP_Bool* is_external,
mostynb699af3c2014-10-06 18:03:3443 scoped_refptr<TrackedCallback> callback) override;
[email protected]1c081e52013-05-25 14:30:5544
45 private:
46 void OnPluginMsgGetDeviceIDReply(PP_Var* dest,
47 scoped_refptr<TrackedCallback> callback,
48 const ResourceMessageReplyParams& params,
49 const std::string& id);
[email protected]a245006a2013-06-11 21:36:0550 void OnPluginMsgGetVoucherFileReply(PP_Resource* dest,
51 scoped_refptr<TrackedCallback> callback,
52 const ResourceMessageReplyParams& params,
[email protected]c6420f082013-09-18 22:42:4153 const FileRefCreateInfo& file_info);
[email protected]5a9f47ad2013-11-27 01:33:3754 void OnPluginMsgMonitorIsExternalReply(
55 PP_Bool* dest,
56 scoped_refptr<TrackedCallback> callback,
57 const ResourceMessageReplyParams& params,
58 PP_Bool is_external);
[email protected]1c081e52013-05-25 14:30:5559
60 DISALLOW_COPY_AND_ASSIGN(FlashDRMResource);
61};
62
63} // namespace proxy
64} // namespace ppapi
65
66#endif // PPAPI_PROXY_FLASH_DRM_RESOURCE_H_