0

Remove output protection pepper APIs

Now that CDMs use mojo exclusively, remove the Pepper APIs that are
now unused.

BUG=772160
TEST=compiles

Change-Id: I4161d7430f86f5033dd7997fb5f2cc4a04aefa22
Reviewed-on: https://chromium-review.googlesource.com/988254
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Ben Smith <binji@chromium.org>
Commit-Queue: John Rummell <jrummell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549671}
This commit is contained in:
John Rummell
2018-04-10 23:23:01 +00:00
committed by Commit Bot
parent 0e4e6c2d84
commit 8682bf273c
34 changed files with 0 additions and 1107 deletions

@ -3863,8 +3863,6 @@ jumbo_split_static_library("browser") {
"renderer_host/pepper/pepper_flash_drm_host.h",
"renderer_host/pepper/pepper_isolated_file_system_message_filter.cc",
"renderer_host/pepper/pepper_isolated_file_system_message_filter.h",
"renderer_host/pepper/pepper_output_protection_message_filter.cc",
"renderer_host/pepper/pepper_output_protection_message_filter.h",
"renderer_host/pepper/pepper_platform_verification_message_filter.cc",
"renderer_host/pepper/pepper_platform_verification_message_filter.h",
]

@ -10,7 +10,6 @@
#include "chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.h"
#include "chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h"
#include "chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h"
#include "chrome/browser/renderer_host/pepper/pepper_output_protection_message_filter.h"
#include "chrome/browser/renderer_host/pepper/pepper_platform_verification_message_filter.h"
#include "content/public/browser/browser_ppapi_host.h"
#include "ppapi/host/message_filter_host.h"
@ -57,13 +56,6 @@ ChromeBrowserPepperHostFactory::CreateResourceHost(
return std::unique_ptr<ResourceHost>(new MessageFilterHost(
host_->GetPpapiHost(), instance, resource, pv_filter));
}
case PpapiHostMsg_OutputProtection_Create::ID: {
scoped_refptr<ResourceMessageFilter> output_protection_filter(
new PepperOutputProtectionMessageFilter(host_, instance));
return std::unique_ptr<ResourceHost>(
new MessageFilterHost(host_->GetPpapiHost(), instance, resource,
output_protection_filter));
}
}
}

@ -1,161 +0,0 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/renderer_host/pepper/pepper_output_protection_message_filter.h"
#include "build/build_config.h"
#include "chrome/browser/media/output_protection_proxy.h"
#include "content/public/browser/browser_ppapi_host.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/private/ppb_output_protection_private.h"
#include "ppapi/host/dispatch_host_message.h"
#include "ppapi/host/host_message_context.h"
#include "ppapi/host/ppapi_host.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ui/display/types/display_constants.h"
namespace {
static_assert(static_cast<int>(PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_NONE) ==
static_cast<int>(display::DISPLAY_CONNECTION_TYPE_NONE),
"PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_NONE value mismatch");
static_assert(
static_cast<int>(PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_UNKNOWN) ==
static_cast<int>(display::DISPLAY_CONNECTION_TYPE_UNKNOWN),
"PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_UNKNOWN value mismatch");
static_assert(
static_cast<int>(PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_INTERNAL) ==
static_cast<int>(display::DISPLAY_CONNECTION_TYPE_INTERNAL),
"PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_INTERNAL value mismatch");
static_assert(static_cast<int>(PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_VGA) ==
static_cast<int>(display::DISPLAY_CONNECTION_TYPE_VGA),
"PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_VGA value mismatch");
static_assert(static_cast<int>(PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_HDMI) ==
static_cast<int>(display::DISPLAY_CONNECTION_TYPE_HDMI),
"PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_HDMI value mismatch");
static_assert(static_cast<int>(PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_DVI) ==
static_cast<int>(display::DISPLAY_CONNECTION_TYPE_DVI),
"PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_DVI value mismatch");
static_assert(
static_cast<int>(PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_DISPLAYPORT) ==
static_cast<int>(display::DISPLAY_CONNECTION_TYPE_DISPLAYPORT),
"PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_DISPLAYPORT value mismatch");
static_assert(
static_cast<int>(PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_NETWORK) ==
static_cast<int>(display::DISPLAY_CONNECTION_TYPE_NETWORK),
"PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_NETWORK value mismatch");
static_assert(static_cast<int>(PP_OUTPUT_PROTECTION_METHOD_PRIVATE_NONE) ==
static_cast<int>(display::CONTENT_PROTECTION_METHOD_NONE),
"PP_OUTPUT_PROTECTION_METHOD_PRIVATE_NONE value mismatch");
static_assert(static_cast<int>(PP_OUTPUT_PROTECTION_METHOD_PRIVATE_HDCP) ==
static_cast<int>(display::CONTENT_PROTECTION_METHOD_HDCP),
"PP_OUTPUT_PROTECTION_METHOD_PRIVATE_HDCP value mismatch");
} // namespace
PepperOutputProtectionMessageFilter::PepperOutputProtectionMessageFilter(
content::BrowserPpapiHost* host,
PP_Instance instance)
: weak_ptr_factory_(this) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
int render_process_id = 0;
int render_frame_id = 0;
host->GetRenderFrameIDsForInstance(
instance, &render_process_id, &render_frame_id);
proxy_.reset(new OutputProtectionProxy(render_process_id, render_frame_id));
}
PepperOutputProtectionMessageFilter::~PepperOutputProtectionMessageFilter() {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
}
scoped_refptr<base::TaskRunner>
PepperOutputProtectionMessageFilter::OverrideTaskRunnerForMessage(
const IPC::Message& message) {
return content::BrowserThread::GetTaskRunnerForThread(
content::BrowserThread::UI);
}
int32_t PepperOutputProtectionMessageFilter::OnResourceMessageReceived(
const IPC::Message& msg,
ppapi::host::HostMessageContext* context) {
PPAPI_BEGIN_MESSAGE_MAP(PepperOutputProtectionMessageFilter, msg)
PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(
PpapiHostMsg_OutputProtection_QueryStatus, OnQueryStatus);
PPAPI_DISPATCH_HOST_RESOURCE_CALL(
PpapiHostMsg_OutputProtection_EnableProtection, OnEnableProtection);
PPAPI_END_MESSAGE_MAP()
return PP_ERROR_FAILED;
}
int32_t PepperOutputProtectionMessageFilter::OnQueryStatus(
ppapi::host::HostMessageContext* context) {
ppapi::host::ReplyMessageContext reply_context =
context->MakeReplyMessageContext();
proxy_->QueryStatus(
base::Bind(&PepperOutputProtectionMessageFilter::OnQueryStatusComplete,
weak_ptr_factory_.GetWeakPtr(), reply_context));
return PP_OK_COMPLETIONPENDING;
}
int32_t PepperOutputProtectionMessageFilter::OnEnableProtection(
ppapi::host::HostMessageContext* context,
uint32_t desired_method_mask) {
ppapi::host::ReplyMessageContext reply_context =
context->MakeReplyMessageContext();
proxy_->EnableProtection(
desired_method_mask,
base::Bind(
&PepperOutputProtectionMessageFilter::OnEnableProtectionComplete,
weak_ptr_factory_.GetWeakPtr(), reply_context));
return PP_OK_COMPLETIONPENDING;
}
// static
void PepperOutputProtectionMessageFilter::OnQueryStatusComplete(
base::WeakPtr<PepperOutputProtectionMessageFilter> filter,
ppapi::host::ReplyMessageContext reply_context,
bool success,
uint32_t link_mask,
uint32_t protection_mask) {
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(
&PepperOutputProtectionMessageFilter::OnQueryStatusCompleteOnIOThread,
filter, reply_context, success, link_mask, protection_mask));
}
void PepperOutputProtectionMessageFilter::OnQueryStatusCompleteOnIOThread(
ppapi::host::ReplyMessageContext reply_context,
bool success,
uint32_t link_mask,
uint32_t protection_mask) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
reply_context.params.set_result(success ? PP_OK : PP_ERROR_FAILED);
SendReply(reply_context, PpapiPluginMsg_OutputProtection_QueryStatusReply(
link_mask, protection_mask));
}
// static
void PepperOutputProtectionMessageFilter::OnEnableProtectionComplete(
base::WeakPtr<PepperOutputProtectionMessageFilter> filter,
ppapi::host::ReplyMessageContext reply_context,
bool success) {
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&PepperOutputProtectionMessageFilter::
OnEnableProtectionCompleteOnIOThread,
filter, reply_context, success));
}
void PepperOutputProtectionMessageFilter::OnEnableProtectionCompleteOnIOThread(
ppapi::host::ReplyMessageContext reply_context,
bool success) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
reply_context.params.set_result(success ? PP_OK : PP_ERROR_FAILED);
SendReply(reply_context,
PpapiPluginMsg_OutputProtection_EnableProtectionReply());
}

@ -1,83 +0,0 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_OUTPUT_PROTECTION_MESSAGE_FILTER_H_
#define CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_OUTPUT_PROTECTION_MESSAGE_FILTER_H_
#include <stdint.h>
#include <memory>
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/browser_thread.h"
#include "build/build_config.h"
#include "ppapi/c/pp_instance.h"
#include "ppapi/host/resource_message_filter.h"
namespace content {
class BrowserPpapiHost;
} // namespace content
namespace ppapi {
namespace host {
struct HostMessageContext;
} // namespace host
} // namespace ppapi
class OutputProtectionProxy;
class PepperOutputProtectionMessageFilter
: public ppapi::host::ResourceMessageFilter {
public:
PepperOutputProtectionMessageFilter(content::BrowserPpapiHost* host,
PP_Instance instance);
private:
// Result handlers for calls made on the UI thread, which hand off the result
// to the IPC filter on the IO thread.
static void OnQueryStatusComplete(
base::WeakPtr<PepperOutputProtectionMessageFilter> filter,
ppapi::host::ReplyMessageContext reply_context,
bool success,
uint32_t link_mask,
uint32_t protection_mask);
static void OnEnableProtectionComplete(
base::WeakPtr<PepperOutputProtectionMessageFilter> filter,
ppapi::host::ReplyMessageContext reply_context,
bool success);
// ppapi::host::ResourceMessageFilter overrides.
scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage(
const IPC::Message& msg) override;
int32_t OnResourceMessageReceived(
const IPC::Message& msg,
ppapi::host::HostMessageContext* context) override;
~PepperOutputProtectionMessageFilter() override;
int32_t OnQueryStatus(ppapi::host::HostMessageContext* context);
int32_t OnEnableProtection(ppapi::host::HostMessageContext* context,
uint32_t desired_method_mask);
// Sends IPC replies for operations. Called on the IO thread.
void OnQueryStatusCompleteOnIOThread(
ppapi::host::ReplyMessageContext reply_context,
bool success,
uint32_t link_mask,
uint32_t protection_mask);
void OnEnableProtectionCompleteOnIOThread(
ppapi::host::ReplyMessageContext reply_context,
bool success);
std::unique_ptr<OutputProtectionProxy,
content::BrowserThread::DeleteOnUIThread>
proxy_;
base::WeakPtrFactory<PepperOutputProtectionMessageFilter> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(PepperOutputProtectionMessageFilter);
};
#endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_OUTPUT_PROTECTION_MESSAGE_FILTER_H_

@ -90,7 +90,6 @@
#include "ppapi/c/private/ppb_flash_print.h"
#include "ppapi/c/private/ppb_host_resolver_private.h"
#include "ppapi/c/private/ppb_isolated_file_system_private.h"
#include "ppapi/c/private/ppb_output_protection_private.h"
#include "ppapi/c/private/ppb_pdf.h"
#include "ppapi/c/private/ppb_platform_verification_private.h"
#include "ppapi/c/private/ppb_proxy_private.h"

@ -1259,10 +1259,6 @@ IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, FlashDRM) {
LIST_TEST(FlashDRM_GetVoucherFile));
}
#if defined(OS_CHROMEOS)
TEST_PPAPI_OUT_OF_PROCESS(OutputProtectionPrivate)
#endif
#if BUILDFLAG(ENABLE_NACL)
class PackagedAppTest : public ExtensionBrowserTest {
public:

@ -122,7 +122,6 @@
#include "ppapi/c/private/ppb_host_resolver_private.h"
#include "ppapi/c/private/ppb_instance_private.h"
#include "ppapi/c/private/ppb_isolated_file_system_private.h"
#include "ppapi/c/private/ppb_output_protection_private.h"
#include "ppapi/c/private/ppb_pdf.h"
#include "ppapi/c/private/ppb_platform_verification_private.h"
#include "ppapi/c/private/ppb_proxy_private.h"

@ -283,11 +283,6 @@ PP_Resource ResourceCreationImpl::CreateNetworkMonitor(PP_Instance instance) {
return 0; // Not supported in-process.
}
PP_Resource ResourceCreationImpl::CreateOutputProtectionPrivate(
PP_Instance instance) {
return 0; // Not supported in-process.
}
PP_Resource ResourceCreationImpl::CreatePlatformVerificationPrivate(
PP_Instance instance) {
return 0; // Not supported in-process.

@ -114,7 +114,6 @@ class ResourceCreationImpl : public ppapi::thunk::ResourceCreationAPI {
const PP_NetAddress_Private& private_addr) override;
PP_Resource CreateNetworkMonitor(PP_Instance instance) override;
PP_Resource CreatePlatformVerificationPrivate(PP_Instance instance) override;
PP_Resource CreateOutputProtectionPrivate(PP_Instance instance) override;
PP_Resource CreateTCPServerSocketPrivate(PP_Instance instance) override;
PP_Resource CreateTCPSocket1_0(PP_Instance instance) override;
PP_Resource CreateTCPSocket(PP_Instance instance) override;

@ -13,7 +13,6 @@
'host_resolver_private.cc',
'isolated_file_system_private.cc',
'net_address_private.cc',
'output_protection_private.cc',
'pass_file_handle.cc',
'tcp_socket_private.cc',
'tcp_server_socket_private.cc',
@ -33,7 +32,6 @@
'ppb_host_resolver_private.h',
'ppb_isolated_file_system_private.h',
'ppb_net_address_private.h',
'ppb_output_protection_private.h',
'ppb_tcp_server_socket_private.h',
'ppb_tcp_socket_private.h',
'ppb_udp_socket_private.h',
@ -52,7 +50,6 @@
'host_resolver_private.h',
'isolated_file_system_private.h',
'net_address_private.h',
'output_protection_private.h',
'pass_file_handle.h',
'tcp_server_socket_private.h',
'tcp_socket_private.h',

@ -92,8 +92,6 @@ test_common_source_files = [
"tests/test_network_monitor.h",
"tests/test_network_proxy.cc",
"tests/test_network_proxy.h",
"tests/test_output_protection_private.cc",
"tests/test_output_protection_private.h",
"tests/test_paint_aggregator.cc",
"tests/test_paint_aggregator.h",
"tests/test_post_message.cc",

@ -1,141 +0,0 @@
/* Copyright 2013 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/**
* This file defines the API for output protection. Currently, it only supports
* Chrome OS.
*/
[generate_thunk]
label Chrome {
M31 = 0.1
};
/**
* Content protection methods applied on video output link.
*/
[assert_size(4)] enum PP_OutputProtectionMethod_Private {
PP_OUTPUT_PROTECTION_METHOD_PRIVATE_NONE = 0,
PP_OUTPUT_PROTECTION_METHOD_PRIVATE_HDCP = 1 << 0
};
/**
* Video output link types.
*/
[assert_size(4)] enum PP_OutputProtectionLinkType_Private {
PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_NONE = 0,
PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_UNKNOWN = 1 << 0,
PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_INTERNAL = 1 << 1,
PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_VGA = 1 << 2,
PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_HDMI = 1 << 3,
PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_DVI = 1 << 4,
PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_DISPLAYPORT = 1 << 5,
PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_NETWORK = 1 << 6
};
/**
* The <code>PPB_OutputProtection_Private</code> interface allows controlling
* output protection.
*
* <strong>Example:</strong>
*
* @code
* op = output_protection->Create(instance);
* output_protection->QueryStatus(op, &link_mask, &protection_mask,
* done_callback);
* @endcode
*
* In this example, the plugin wants to enforce HDCP for HDMI link.
* @code
* if (link_mask & PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_HDMI) {
* output_protection->EnableProtection(
* op, PP_OUTPUT_PROTECTION_METHOD_PRIVATE_HDCP, done_callback);
* }
* @endcode
*
* After EnableProtection() completes, the plugin has to query protection
* status periodically to make sure the protection is enabled and remains
* enabled.
*/
interface PPB_OutputProtection_Private {
/**
* Create() creates a new <code>PPB_OutputProtection_Private</code> object.
*
* @pram[in] instance A <code>PP_Instance</code> identifying one instance of
* a module.
*
* @return A <code>PP_Resource</code> corresponding to a
* <code>PPB_OutputProtection_Private</code> if successful, 0 if creation
* failed.
*/
PP_Resource Create([in] PP_Instance instance);
/**
* IsOutputProtection() determines if the provided resource is a
* <code>PPB_OutputProtection_Private</code>.
*
* @param[in] resource A <code>PP_Resource</code> corresponding to a
* <code>PPB_OutputProtection_Private</code>.
*
* @return <code>PP_TRUE</code> if the resource is a
* <code>PPB_OutputProtection_Private</code>, <code>PP_FALSE</code> if the
* resource is invalid or some type other than
* <code>PPB_OutputProtection_Private</code>.
*/
PP_Bool IsOutputProtection([in] PP_Resource resource);
/**
* Query link status and protection status.
* Clients have to query status periodically in order to detect changes.
*
* @param[in] resource A <code>PP_Resource</code> corresponding to a
* <code>PPB_OutputProtection_Private</code>.
* @param[out] link_mask The type of connected output links, which is a
* bit-mask of the <code>PP_OutputProtectionLinkType_Private</code> values.
* @param[out] protection_mask Enabled protection methods, which is a
* bit-mask of the <code>PP_OutputProtectionMethod_Private</code> values.
* @param[in] callback A <code>PP_CompletionCallback</code> to run on
* asynchronous completion of QueryStatus(). This callback will only run if
* QueryStatus() returns <code>PP_OK_COMPLETIONPENDING</code>.
*
* @return An int32_t containing an error code from <code>pp_errors.h</code>.
*/
int32_t QueryStatus(
[in] PP_Resource resource,
[out] uint32_t link_mask,
[out] uint32_t protection_mask,
[in] PP_CompletionCallback callback);
/**
* Set desired protection methods.
*
* When the desired protection method(s) have been applied to all applicable
* output links, the relevant bit(s) of the protection_mask returned by
* QueryStatus() will be set. Otherwise, the relevant bit(s) of
* protection_mask will not be set; there is no separate error code or
* callback.
*
* Protections will be disabled if no longer desired by all instances.
*
* @param[in] resource A <code>PP_Resource</code> corresponding to a
* <code>PPB_OutputProtection_Private</code>.
* @param[in] desired_protection_mask The desired protection methods, which
* is a bit-mask of the <code>PP_OutputProtectionMethod_Private</code>
* values.
* @param[in] callback A <code>PP_CompletionCallback</code> to be called with
* <code>PP_OK</code> when the protection request has been made. This may be
* before the protection have actually been applied. Call QueryStatus to get
* protection status. If it failed to make the protection request, the
* callback is called with <code>PP_ERROR_FAILED</code> and there is no need
* to call QueryStatus().
*
* @return An int32_t containing an error code from <code>pp_errors.h</code>.
*/
int32_t EnableProtection(
[in] PP_Resource resource,
[in] uint32_t desired_protection_mask,
[in] PP_CompletionCallback callback);
};

@ -137,7 +137,6 @@ source_set("c") {
"private/ppb_instance_private.h",
"private/ppb_isolated_file_system_private.h",
"private/ppb_net_address_private.h",
"private/ppb_output_protection_private.h",
"private/ppb_pdf.h",
"private/ppb_platform_verification_private.h",
"private/ppb_proxy_private.h",

@ -1,172 +0,0 @@
/* Copyright 2013 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* From private/ppb_output_protection_private.idl,
* modified Tue Oct 8 13:22:13 2013.
*/
#ifndef PPAPI_C_PRIVATE_PPB_OUTPUT_PROTECTION_PRIVATE_H_
#define PPAPI_C_PRIVATE_PPB_OUTPUT_PROTECTION_PRIVATE_H_
#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_stdint.h"
#define PPB_OUTPUTPROTECTION_PRIVATE_INTERFACE_0_1 \
"PPB_OutputProtection_Private;0.1"
#define PPB_OUTPUTPROTECTION_PRIVATE_INTERFACE \
PPB_OUTPUTPROTECTION_PRIVATE_INTERFACE_0_1
/**
* @file
* This file defines the API for output protection. Currently, it only supports
* Chrome OS.
*/
/**
* @addtogroup Enums
* @{
*/
/**
* Content protection methods applied on video output link.
*/
typedef enum {
PP_OUTPUT_PROTECTION_METHOD_PRIVATE_NONE = 0,
PP_OUTPUT_PROTECTION_METHOD_PRIVATE_HDCP = 1 << 0
} PP_OutputProtectionMethod_Private;
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_OutputProtectionMethod_Private, 4);
/**
* Video output link types.
*/
typedef enum {
PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_NONE = 0,
PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_UNKNOWN = 1 << 0,
PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_INTERNAL = 1 << 1,
PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_VGA = 1 << 2,
PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_HDMI = 1 << 3,
PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_DVI = 1 << 4,
PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_DISPLAYPORT = 1 << 5,
PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_NETWORK = 1 << 6
} PP_OutputProtectionLinkType_Private;
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_OutputProtectionLinkType_Private, 4);
/**
* @}
*/
/**
* @addtogroup Interfaces
* @{
*/
/**
* The <code>PPB_OutputProtection_Private</code> interface allows controlling
* output protection.
*
* <strong>Example:</strong>
*
* @code
* op = output_protection->Create(instance);
* output_protection->QueryStatus(op, &link_mask, &protection_mask,
* done_callback);
* @endcode
*
* In this example, the plugin wants to enforce HDCP for HDMI link.
* @code
* if (link_mask & PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_HDMI) {
* output_protection->EnableProtection(
* op, PP_OUTPUT_PROTECTION_METHOD_PRIVATE_HDCP, done_callback);
* }
* @endcode
*
* After EnableProtection() completes, the plugin has to query protection
* status periodically to make sure the protection is enabled and remains
* enabled.
*/
struct PPB_OutputProtection_Private_0_1 {
/**
* Create() creates a new <code>PPB_OutputProtection_Private</code> object.
*
* @pram[in] instance A <code>PP_Instance</code> identifying one instance of
* a module.
*
* @return A <code>PP_Resource</code> corresponding to a
* <code>PPB_OutputProtection_Private</code> if successful, 0 if creation
* failed.
*/
PP_Resource (*Create)(PP_Instance instance);
/**
* IsOutputProtection() determines if the provided resource is a
* <code>PPB_OutputProtection_Private</code>.
*
* @param[in] resource A <code>PP_Resource</code> corresponding to a
* <code>PPB_OutputProtection_Private</code>.
*
* @return <code>PP_TRUE</code> if the resource is a
* <code>PPB_OutputProtection_Private</code>, <code>PP_FALSE</code> if the
* resource is invalid or some type other than
* <code>PPB_OutputProtection_Private</code>.
*/
PP_Bool (*IsOutputProtection)(PP_Resource resource);
/**
* Query link status and protection status.
* Clients have to query status periodically in order to detect changes.
*
* @param[in] resource A <code>PP_Resource</code> corresponding to a
* <code>PPB_OutputProtection_Private</code>.
* @param[out] link_mask The type of connected output links, which is a
* bit-mask of the <code>PP_OutputProtectionLinkType_Private</code> values.
* @param[out] protection_mask Enabled protection methods, which is a
* bit-mask of the <code>PP_OutputProtectionMethod_Private</code> values.
* @param[in] callback A <code>PP_CompletionCallback</code> to run on
* asynchronous completion of QueryStatus(). This callback will only run if
* QueryStatus() returns <code>PP_OK_COMPLETIONPENDING</code>.
*
* @return An int32_t containing an error code from <code>pp_errors.h</code>.
*/
int32_t (*QueryStatus)(PP_Resource resource,
uint32_t* link_mask,
uint32_t* protection_mask,
struct PP_CompletionCallback callback);
/**
* Set desired protection methods.
*
* When the desired protection method(s) have been applied to all applicable
* output links, the relevant bit(s) of the protection_mask returned by
* QueryStatus() will be set. Otherwise, the relevant bit(s) of
* protection_mask will not be set; there is no separate error code or
* callback.
*
* Protections will be disabled if no longer desired by all instances.
*
* @param[in] resource A <code>PP_Resource</code> corresponding to a
* <code>PPB_OutputProtection_Private</code>.
* @param[in] desired_protection_mask The desired protection methods, which
* is a bit-mask of the <code>PP_OutputProtectionMethod_Private</code>
* values.
* @param[in] callback A <code>PP_CompletionCallback</code> to be called with
* <code>PP_OK</code> when the protection request has been made. This may be
* before the protection have actually been applied. Call QueryStatus to get
* protection status. If it failed to make the protection request, the
* callback is called with <code>PP_ERROR_FAILED</code> and there is no need
* to call QueryStatus().
*
* @return An int32_t containing an error code from <code>pp_errors.h</code>.
*/
int32_t (*EnableProtection)(PP_Resource resource,
uint32_t desired_protection_mask,
struct PP_CompletionCallback callback);
};
typedef struct PPB_OutputProtection_Private_0_1 PPB_OutputProtection_Private;
/**
* @}
*/
#endif /* PPAPI_C_PRIVATE_PPB_OUTPUT_PROTECTION_PRIVATE_H_ */

@ -238,8 +238,6 @@ source_set("objects") {
"private/isolated_file_system_private.h",
"private/net_address_private.cc",
"private/net_address_private.h",
"private/output_protection_private.cc",
"private/output_protection_private.h",
"private/pass_file_handle.cc",
"private/pass_file_handle.h",
"private/pdf.cc",

@ -1,59 +0,0 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ppapi/cpp/private/output_protection_private.h"
#include <stdio.h>
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/private/ppb_output_protection_private.h"
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/instance_handle.h"
#include "ppapi/cpp/module_impl.h"
namespace pp {
namespace {
template <> const char* interface_name<PPB_OutputProtection_Private_0_1>() {
return PPB_OUTPUTPROTECTION_PRIVATE_INTERFACE_0_1;
}
} // namespace
OutputProtection_Private::OutputProtection_Private(
const InstanceHandle& instance) {
if (has_interface<PPB_OutputProtection_Private_0_1>()) {
PassRefFromConstructor(
get_interface<PPB_OutputProtection_Private_0_1>()->Create(
instance.pp_instance()));
}
}
OutputProtection_Private::~OutputProtection_Private() {
}
int32_t OutputProtection_Private::QueryStatus(
uint32_t* link_mask,
uint32_t* protection_mask,
const CompletionCallback& callback) {
if (has_interface<PPB_OutputProtection_Private_0_1>()) {
return get_interface<PPB_OutputProtection_Private_0_1>()->QueryStatus(
pp_resource(), link_mask, protection_mask,
callback.pp_completion_callback());
}
return callback.MayForce(PP_ERROR_NOINTERFACE);
}
int32_t OutputProtection_Private::EnableProtection(
uint32_t desired_method_mask,
const CompletionCallback& callback) {
if (has_interface<PPB_OutputProtection_Private_0_1>()) {
return get_interface<PPB_OutputProtection_Private_0_1>()->EnableProtection(
pp_resource(), desired_method_mask,
callback.pp_completion_callback());
}
return callback.MayForce(PP_ERROR_NOINTERFACE);
}
} // namespace pp

@ -1,30 +0,0 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PPAPI_CPP_PRIVATE_OUTPUT_PROTECTION_PRIVATE_H_
#define PPAPI_CPP_PRIVATE_OUTPUT_PROTECTION_PRIVATE_H_
#include <stdint.h>
#include "ppapi/c/private/ppb_output_protection_private.h"
#include "ppapi/cpp/completion_callback.h"
#include "ppapi/cpp/resource.h"
namespace pp {
class OutputProtection_Private : public Resource {
public:
explicit OutputProtection_Private(const InstanceHandle& instance);
virtual ~OutputProtection_Private();
// PPB_OutputProtection_Private implementation.
int32_t QueryStatus(uint32_t* link_mask, uint32_t* protection_mask,
const CompletionCallback& callback);
int32_t EnableProtection(uint32_t desired_method_mask,
const CompletionCallback& callback);
};
} // namespace pp
#endif // PPAPI_CPP_PRIVATE_OUTPUT_PROTECTION_PRIVATE_H_

@ -67,7 +67,6 @@
#include "ppapi/c/private/ppb_instance_private.h"
#include "ppapi/c/private/ppb_isolated_file_system_private.h"
#include "ppapi/c/private/ppb_net_address_private.h"
#include "ppapi/c/private/ppb_output_protection_private.h"
#include "ppapi/c/private/ppb_platform_verification_private.h"
#include "ppapi/c/private/ppb_tcp_server_socket_private.h"
#include "ppapi/c/private/ppb_tcp_socket_private.h"
@ -190,7 +189,6 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_IsolatedFileSystem_Privat
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetAddress_Private_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetAddress_Private_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetAddress_Private_1_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_OutputProtection_Private_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_PlatformVerification_Private_0_3;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TCPServerSocket_Private_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TCPServerSocket_Private_0_2;
@ -4011,30 +4009,6 @@ static void Pnacl_M19_1_PPB_NetAddress_Private_CreateFromIPv6Address(const uint8
/* End wrapper methods for PPB_NetAddress_Private_1_1 */
/* Begin wrapper methods for PPB_OutputProtection_Private_0_1 */
static PP_Resource Pnacl_M31_PPB_OutputProtection_Private_Create(PP_Instance instance) {
const struct PPB_OutputProtection_Private_0_1 *iface = Pnacl_WrapperInfo_PPB_OutputProtection_Private_0_1.real_iface;
return iface->Create(instance);
}
static PP_Bool Pnacl_M31_PPB_OutputProtection_Private_IsOutputProtection(PP_Resource resource) {
const struct PPB_OutputProtection_Private_0_1 *iface = Pnacl_WrapperInfo_PPB_OutputProtection_Private_0_1.real_iface;
return iface->IsOutputProtection(resource);
}
static int32_t Pnacl_M31_PPB_OutputProtection_Private_QueryStatus(PP_Resource resource, uint32_t* link_mask, uint32_t* protection_mask, struct PP_CompletionCallback* callback) {
const struct PPB_OutputProtection_Private_0_1 *iface = Pnacl_WrapperInfo_PPB_OutputProtection_Private_0_1.real_iface;
return iface->QueryStatus(resource, link_mask, protection_mask, *callback);
}
static int32_t Pnacl_M31_PPB_OutputProtection_Private_EnableProtection(PP_Resource resource, uint32_t desired_protection_mask, struct PP_CompletionCallback* callback) {
const struct PPB_OutputProtection_Private_0_1 *iface = Pnacl_WrapperInfo_PPB_OutputProtection_Private_0_1.real_iface;
return iface->EnableProtection(resource, desired_protection_mask, *callback);
}
/* End wrapper methods for PPB_OutputProtection_Private_0_1 */
/* Begin wrapper methods for PPB_PlatformVerification_Private_0_3 */
static PP_Resource Pnacl_M61_PPB_PlatformVerification_Private_Create(PP_Instance instance) {
@ -5702,13 +5676,6 @@ static const struct PPB_NetAddress_Private_1_1 Pnacl_Wrappers_PPB_NetAddress_Pri
.CreateFromIPv6Address = (void (*)(const uint8_t ip[16], uint32_t scope_id, uint16_t port, struct PP_NetAddress_Private* addr_out))&Pnacl_M19_1_PPB_NetAddress_Private_CreateFromIPv6Address
};
static const struct PPB_OutputProtection_Private_0_1 Pnacl_Wrappers_PPB_OutputProtection_Private_0_1 = {
.Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M31_PPB_OutputProtection_Private_Create,
.IsOutputProtection = (PP_Bool (*)(PP_Resource resource))&Pnacl_M31_PPB_OutputProtection_Private_IsOutputProtection,
.QueryStatus = (int32_t (*)(PP_Resource resource, uint32_t* link_mask, uint32_t* protection_mask, struct PP_CompletionCallback callback))&Pnacl_M31_PPB_OutputProtection_Private_QueryStatus,
.EnableProtection = (int32_t (*)(PP_Resource resource, uint32_t desired_protection_mask, struct PP_CompletionCallback callback))&Pnacl_M31_PPB_OutputProtection_Private_EnableProtection
};
static const struct PPB_PlatformVerification_Private_0_3 Pnacl_Wrappers_PPB_PlatformVerification_Private_0_3 = {
.Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M61_PPB_PlatformVerification_Private_Create,
.IsPlatformVerification = (PP_Bool (*)(PP_Resource resource))&Pnacl_M61_PPB_PlatformVerification_Private_IsPlatformVerification,
@ -6451,12 +6418,6 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetAddress_Private_1_1 =
.real_iface = NULL
};
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_OutputProtection_Private_0_1 = {
.iface_macro = PPB_OUTPUTPROTECTION_PRIVATE_INTERFACE_0_1,
.wrapped_iface = (const void *) &Pnacl_Wrappers_PPB_OutputProtection_Private_0_1,
.real_iface = NULL
};
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_PlatformVerification_Private_0_3 = {
.iface_macro = PPB_PLATFORMVERIFICATION_PRIVATE_INTERFACE_0_3,
.wrapped_iface = (const void *) &Pnacl_Wrappers_PPB_PlatformVerification_Private_0_3,
@ -6644,7 +6605,6 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = {
&Pnacl_WrapperInfo_PPB_NetAddress_Private_0_1,
&Pnacl_WrapperInfo_PPB_NetAddress_Private_1_0,
&Pnacl_WrapperInfo_PPB_NetAddress_Private_1_1,
&Pnacl_WrapperInfo_PPB_OutputProtection_Private_0_1,
&Pnacl_WrapperInfo_PPB_PlatformVerification_Private_0_3,
&Pnacl_WrapperInfo_PPB_TCPServerSocket_Private_0_1,
&Pnacl_WrapperInfo_PPB_TCPServerSocket_Private_0_2,

@ -80,8 +80,6 @@ component("proxy") {
"network_monitor_resource.h",
"network_proxy_resource.cc",
"network_proxy_resource.h",
"output_protection_resource.cc",
"output_protection_resource.h",
"plugin_array_buffer_var.cc",
"plugin_array_buffer_var.h",
"plugin_dispatcher.cc",

@ -93,7 +93,6 @@
#include "ppapi/c/private/ppb_host_resolver_private.h"
#include "ppapi/c/private/ppb_isolated_file_system_private.h"
#include "ppapi/c/private/ppb_net_address_private.h"
#include "ppapi/c/private/ppb_output_protection_private.h"
#include "ppapi/c/private/ppb_pdf.h"
#include "ppapi/c/private/ppb_platform_verification_private.h"
#include "ppapi/c/private/ppb_tcp_server_socket_private.h"

@ -1,105 +0,0 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ppapi/proxy/output_protection_resource.h"
#include "base/logging.h"
#include "ppapi/proxy/plugin_globals.h"
#include "ppapi/proxy/plugin_resource_tracker.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/shared_impl/proxy_lock.h"
#include "ppapi/shared_impl/resource_tracker.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_output_protection_api.h"
namespace ppapi {
namespace proxy {
OutputProtectionResource::OutputProtectionResource(
Connection connection,
PP_Instance instance)
: PluginResource(connection, instance) {
SendCreate(BROWSER, PpapiHostMsg_OutputProtection_Create());
}
OutputProtectionResource::~OutputProtectionResource() {
if (TrackedCallback::IsPending(query_status_callback_))
query_status_callback_->PostAbort();
if (TrackedCallback::IsPending(enable_protection_callback_))
enable_protection_callback_->PostAbort();
}
thunk::PPB_OutputProtection_API*
OutputProtectionResource::AsPPB_OutputProtection_API() {
return this;
}
int32_t OutputProtectionResource::QueryStatus(
uint32_t* link_mask,
uint32_t* protection_mask,
const scoped_refptr<TrackedCallback>& callback) {
if (!link_mask || !protection_mask)
return PP_ERROR_BADARGUMENT;
if (TrackedCallback::IsPending(query_status_callback_))
return PP_ERROR_INPROGRESS;
query_status_callback_ = callback;
Call<PpapiPluginMsg_OutputProtection_QueryStatusReply>(
BROWSER,
PpapiHostMsg_OutputProtection_QueryStatus(),
base::Bind(&OutputProtectionResource::OnPluginMsgQueryStatusReply,
base::Unretained(this),
link_mask,
protection_mask));
return PP_OK_COMPLETIONPENDING;
}
void OutputProtectionResource::OnPluginMsgQueryStatusReply(
uint32_t* out_link_mask,
uint32_t* out_protection_mask,
const ResourceMessageReplyParams& params,
uint32_t link_mask,
uint32_t protection_mask) {
// The callback may have been aborted.
if (!TrackedCallback::IsPending(query_status_callback_))
return;
int32_t result = params.result();
if (result == PP_OK) {
DCHECK(out_link_mask);
DCHECK(out_protection_mask);
*out_link_mask = link_mask;
*out_protection_mask = protection_mask;
}
query_status_callback_->Run(result);
}
int32_t OutputProtectionResource::EnableProtection(
uint32_t desired_method_mask,
const scoped_refptr<TrackedCallback>& callback) {
if (TrackedCallback::IsPending(enable_protection_callback_))
return PP_ERROR_INPROGRESS;
enable_protection_callback_ = callback;
Call<PpapiPluginMsg_OutputProtection_EnableProtectionReply>(
BROWSER,
PpapiHostMsg_OutputProtection_EnableProtection(desired_method_mask),
base::Bind(&OutputProtectionResource::OnPluginMsgEnableProtectionReply,
base::Unretained(this)));
return PP_OK_COMPLETIONPENDING;
}
void OutputProtectionResource::OnPluginMsgEnableProtectionReply(
const ResourceMessageReplyParams& params) {
// The callback may have been aborted.
if (TrackedCallback::IsPending(enable_protection_callback_))
enable_protection_callback_->Run(params.result());
}
} // namespace proxy
} // namespace ppapi

@ -1,60 +0,0 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PPAPI_PROXY_OUTPUT_PROTECTION_RESOURCE_H_
#define PPAPI_PROXY_OUTPUT_PROTECTION_RESOURCE_H_
#include <stdint.h>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "ppapi/c/private/ppb_output_protection_private.h"
#include "ppapi/proxy/device_enumeration_resource_helper.h"
#include "ppapi/proxy/plugin_resource.h"
#include "ppapi/thunk/ppb_output_protection_api.h"
namespace ppapi {
namespace proxy {
class OutputProtectionResource
: public PluginResource,
public ::ppapi::thunk::PPB_OutputProtection_API {
public:
OutputProtectionResource(Connection connection,
PP_Instance instance);
private:
~OutputProtectionResource() override;
// PluginResource overrides.
thunk::PPB_OutputProtection_API* AsPPB_OutputProtection_API() override;
// PPB_OutputProtection_API implementation.
int32_t QueryStatus(
uint32_t* link_mask,
uint32_t* protection_mask,
const scoped_refptr<TrackedCallback>& callback) override;
int32_t EnableProtection(
uint32_t desired_method_mask,
const scoped_refptr<TrackedCallback>& callback) override;
void OnPluginMsgQueryStatusReply(
uint32_t* out_link_mask,
uint32_t* out_protection_mask,
const ResourceMessageReplyParams& params,
uint32_t link_mask,
uint32_t protection_mask);
void OnPluginMsgEnableProtectionReply(
const ResourceMessageReplyParams& params);
scoped_refptr<TrackedCallback> query_status_callback_;
scoped_refptr<TrackedCallback> enable_protection_callback_;
DISALLOW_COPY_AND_ASSIGN(OutputProtectionResource);
};
} // namespace proxy
} // namespace ppapi
#endif // PPAPI_PROXY_OUTPUT_PROTECTION_RESOURCE_H_

@ -2048,17 +2048,6 @@ IPC_MESSAGE_CONTROL4(PpapiPluginMsg_WebSocket_ClosedReply,
uint16_t /* code */,
std::string /* reason */)
// OutputProtection -----------------------------------------------------------
IPC_MESSAGE_CONTROL0(PpapiHostMsg_OutputProtection_Create)
IPC_MESSAGE_CONTROL1(PpapiHostMsg_OutputProtection_EnableProtection,
uint32_t /* desired_method_mask */)
IPC_MESSAGE_CONTROL0(PpapiPluginMsg_OutputProtection_EnableProtectionReply)
IPC_MESSAGE_CONTROL0(PpapiHostMsg_OutputProtection_QueryStatus)
IPC_MESSAGE_CONTROL2(PpapiPluginMsg_OutputProtection_QueryStatusReply,
uint32_t /* link_mask */,
uint32_t /* protection_mask */)
// VideoDecoder ------------------------------------------------------
IPC_MESSAGE_CONTROL0(PpapiHostMsg_VideoDecoder_Create)

@ -26,7 +26,6 @@
#include "ppapi/proxy/media_stream_video_track_resource.h"
#include "ppapi/proxy/net_address_resource.h"
#include "ppapi/proxy/network_monitor_resource.h"
#include "ppapi/proxy/output_protection_resource.h"
#include "ppapi/proxy/platform_verification_private_resource.h"
#include "ppapi/proxy/plugin_dispatcher.h"
#include "ppapi/proxy/plugin_globals.h"
@ -347,12 +346,6 @@ PP_Resource ResourceCreationProxy::CreateNetworkMonitor(
GetReference();
}
PP_Resource ResourceCreationProxy::CreateOutputProtectionPrivate(
PP_Instance instance) {
return (new OutputProtectionResource(GetConnection(), instance))->
GetReference();
}
PP_Resource ResourceCreationProxy::CreatePrinting(PP_Instance instance) {
return (new PrintingResource(GetConnection(), instance))->GetReference();
}

@ -146,7 +146,6 @@ class ResourceCreationProxy : public InterfaceProxy,
PP_Instance instance,
const PP_NetAddress_Private& private_addr) override;
PP_Resource CreateNetworkMonitor(PP_Instance instance) override;
PP_Resource CreateOutputProtectionPrivate(PP_Instance instance) override;
PP_Resource CreatePrinting(PP_Instance) override;
PP_Resource CreateTCPServerSocketPrivate(PP_Instance instance) override;
PP_Resource CreateTCPSocket1_0(PP_Instance instance) override;

@ -65,7 +65,6 @@
F(PPB_NetworkList_API) \
F(PPB_NetworkMonitor_API) \
F(PPB_NetworkProxy_API) \
F(PPB_OutputProtection_API) \
F(PPB_PDF_API) \
F(PPB_PlatformVerification_API) \
F(PPB_Printing_API) \

@ -111,7 +111,6 @@
#include "ppapi/c/private/ppb_host_resolver_private.h"
#include "ppapi/c/private/ppb_instance_private.h"
#include "ppapi/c/private/ppb_net_address_private.h"
#include "ppapi/c/private/ppb_output_protection_private.h"
#include "ppapi/c/private/ppb_pdf.h"
#include "ppapi/c/private/ppb_platform_verification_private.h"
#include "ppapi/c/private/ppb_proxy_private.h"

@ -1,62 +0,0 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ppapi/tests/test_output_protection_private.h"
#include <stdint.h>
#include "ppapi/tests/testing_instance.h"
REGISTER_TEST_CASE(OutputProtectionPrivate);
TestOutputProtectionPrivate::TestOutputProtectionPrivate(
TestingInstance* instance)
: TestCase(instance) {
}
bool TestOutputProtectionPrivate::Init() {
output_protection_interface_ =
static_cast<const PPB_OutputProtection_Private*>(
pp::Module::Get()->GetBrowserInterface(
PPB_OUTPUTPROTECTION_PRIVATE_INTERFACE_0_1));
return output_protection_interface_ && CheckTestingInterface();
}
void TestOutputProtectionPrivate::RunTests(const std::string& filter) {
RUN_TEST(QueryStatus, filter);
RUN_TEST(EnableProtection, filter);
}
std::string TestOutputProtectionPrivate::TestQueryStatus() {
TestCompletionCallback callback(instance_->pp_instance(), callback_type());
PP_Resource output_protection_resource = output_protection_interface_->
Create(instance_->pp_instance());
uint32_t link_mask;
uint32_t protection_mask;
callback.WaitForResult(
output_protection_interface_->QueryStatus(
output_protection_resource,
&link_mask,
&protection_mask,
callback.GetCallback().pp_completion_callback()));
CHECK_CALLBACK_BEHAVIOR(callback);
PASS();
}
std::string TestOutputProtectionPrivate::TestEnableProtection() {
TestCompletionCallback callback(instance_->pp_instance(), callback_type());
PP_Resource output_protection_resource = output_protection_interface_->
Create(instance_->pp_instance());
callback.WaitForResult(
output_protection_interface_->EnableProtection(
output_protection_resource,
PP_OUTPUT_PROTECTION_METHOD_PRIVATE_NONE,
callback.GetCallback().pp_completion_callback()));
CHECK_CALLBACK_BEHAVIOR(callback);
PASS();
}

@ -1,29 +0,0 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PPAPI_TESTS_TEST_OUTPUT_PROTECTION_PRIVATE_H_
#define PPAPI_TESTS_TEST_OUTPUT_PROTECTION_PRIVATE_H_
#include <string>
#include "ppapi/cpp/private/output_protection_private.h"
#include "ppapi/tests/test_case.h"
#include "ppapi/tests/test_utils.h"
class TestOutputProtectionPrivate: public TestCase {
public:
explicit TestOutputProtectionPrivate(TestingInstance* instance);
private:
// TestCase implementation.
virtual bool Init();
virtual void RunTests(const std::string& filter);
std::string TestQueryStatus();
std::string TestEnableProtection();
const PPB_OutputProtection_Private* output_protection_interface_;
};
#endif // PPAPI_TESTS_TEST_OUTPUT_PROTECTION_PRIVATE_H_

@ -105,8 +105,6 @@ source_set("thunk") {
"ppb_network_monitor_thunk.cc",
"ppb_network_proxy_api.h",
"ppb_network_proxy_thunk.cc",
"ppb_output_protection_api.h",
"ppb_output_protection_private_thunk.cc",
"ppb_pdf_api.h",
"ppb_platform_verification_api.h",
"ppb_printing_api.h",

@ -37,8 +37,6 @@ PROXIED_IFACE(PPB_FLASHFULLSCREEN_INTERFACE_0_1,
PPB_FlashFullscreen_0_1)
PROXIED_IFACE(PPB_FLASHFULLSCREEN_INTERFACE_1_0,
PPB_FlashFullscreen_0_1)
PROXIED_IFACE(PPB_OUTPUTPROTECTION_PRIVATE_INTERFACE_0_1,
PPB_OutputProtection_Private_0_1)
PROXIED_IFACE(PPB_PLATFORMVERIFICATION_PRIVATE_INTERFACE_0_3,
PPB_PlatformVerification_Private_0_3)
#endif // !defined(OS_NACL)

@ -1,34 +0,0 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PPAPI_THUNK_OUTPUT_PROTECTION_API_H_
#define PPAPI_THUNK_OUTPUT_PROTECTION_API_H_
#include <stdint.h>
#include "ppapi/c/private/ppb_output_protection_private.h"
namespace ppapi {
class TrackedCallback;
namespace thunk {
class PPB_OutputProtection_API {
public:
virtual ~PPB_OutputProtection_API() {}
virtual int32_t QueryStatus(
uint32_t* link_mask,
uint32_t* protection_mask,
const scoped_refptr<TrackedCallback>& callback) = 0;
virtual int32_t EnableProtection(
uint32_t desired_method_mask,
const scoped_refptr<TrackedCallback>& callback) = 0;
};
} // namespace thunk
} // namespace ppapi
#endif // PPAPI_THUNK_OUTPUT_PROTECTION_API_H_

@ -1,72 +0,0 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// From private/ppb_output_protection_private.idl modified Wed Jan 27 17:10:16
// 2016.
#include <stdint.h>
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/private/ppb_output_protection_private.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppapi_thunk_export.h"
#include "ppapi/thunk/ppb_output_protection_api.h"
namespace ppapi {
namespace thunk {
namespace {
PP_Resource Create(PP_Instance instance) {
VLOG(4) << "PPB_OutputProtection_Private::Create()";
EnterResourceCreation enter(instance);
if (enter.failed())
return 0;
return enter.functions()->CreateOutputProtectionPrivate(instance);
}
PP_Bool IsOutputProtection(PP_Resource resource) {
VLOG(4) << "PPB_OutputProtection_Private::IsOutputProtection()";
EnterResource<PPB_OutputProtection_API> enter(resource, false);
return PP_FromBool(enter.succeeded());
}
int32_t QueryStatus(PP_Resource resource,
uint32_t* link_mask,
uint32_t* protection_mask,
struct PP_CompletionCallback callback) {
VLOG(4) << "PPB_OutputProtection_Private::QueryStatus()";
EnterResource<PPB_OutputProtection_API> enter(resource, callback, true);
if (enter.failed())
return enter.retval();
return enter.SetResult(enter.object()->QueryStatus(link_mask, protection_mask,
enter.callback()));
}
int32_t EnableProtection(PP_Resource resource,
uint32_t desired_protection_mask,
struct PP_CompletionCallback callback) {
VLOG(4) << "PPB_OutputProtection_Private::EnableProtection()";
EnterResource<PPB_OutputProtection_API> enter(resource, callback, true);
if (enter.failed())
return enter.retval();
return enter.SetResult(enter.object()->EnableProtection(
desired_protection_mask, enter.callback()));
}
const PPB_OutputProtection_Private_0_1
g_ppb_outputprotection_private_thunk_0_1 = {
&Create, &IsOutputProtection, &QueryStatus, &EnableProtection};
} // namespace
PPAPI_THUNK_EXPORT const PPB_OutputProtection_Private_0_1*
GetPPB_OutputProtection_Private_0_1_Thunk() {
return &g_ppb_outputprotection_private_thunk_0_1;
}
} // namespace thunk
} // namespace ppapi

@ -171,7 +171,6 @@ class ResourceCreationAPI {
PP_Instance instance,
const PP_NetAddress_Private& private_addr) = 0;
virtual PP_Resource CreateNetworkMonitor(PP_Instance instance) = 0;
virtual PP_Resource CreateOutputProtectionPrivate(PP_Instance instance) = 0;
virtual PP_Resource CreatePrinting(PP_Instance instance) = 0;
virtual PP_Resource CreateTCPServerSocketPrivate(PP_Instance instance) = 0;
virtual PP_Resource CreateTCPSocket1_0(PP_Instance instace) = 0;