summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorkcwu@chromium.org <kcwu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-28 13:49:54 +0000
committerkcwu@chromium.org <kcwu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-28 13:49:54 +0000
commita1ab6d8994a202ce7fd45fb72edbf67e51657746 (patch)
treefaa5855b40b36e70992a1191fc6f1077a6f0f4c5 /ppapi
parent633b1ea1cd6e46531f45cc087cd6e280f322daaa (diff)
downloadchromium_src-a1ab6d8994a202ce7fd45fb72edbf67e51657746.zip
chromium_src-a1ab6d8994a202ce7fd45fb72edbf67e51657746.tar.gz
chromium_src-a1ab6d8994a202ce7fd45fb72edbf67e51657746.tar.bz2
Pepper API implementation for output protection.
BUG=256538 R=cpu@chromium.org, dalecurtis@chromium.org, dmichael@chromium.org, marcheu@chromium.org, wuchengli@chromium.org Review URL: https://codereview.chromium.org/24039002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225849 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/cpp/private/output_protection_private.cc59
-rw-r--r--ppapi/cpp/private/output_protection_private.h28
-rw-r--r--ppapi/ppapi_proxy.gypi2
-rw-r--r--ppapi/ppapi_shared.gypi2
-rw-r--r--ppapi/ppapi_sources.gypi5
-rw-r--r--ppapi/proxy/interface_list.cc1
-rw-r--r--ppapi/proxy/output_protection_resource.cc105
-rw-r--r--ppapi/proxy/output_protection_resource.h58
-rw-r--r--ppapi/proxy/ppapi_messages.h11
-rw-r--r--ppapi/proxy/resource_creation_proxy.cc7
-rw-r--r--ppapi/proxy/resource_creation_proxy.h2
-rw-r--r--ppapi/shared_impl/resource.h1
-rw-r--r--ppapi/tests/all_c_includes.h1
-rw-r--r--ppapi/tests/test_output_protection_private.cc60
-rw-r--r--ppapi/tests/test_output_protection_private.h29
-rw-r--r--ppapi/thunk/interfaces_ppb_private.h3
-rw-r--r--ppapi/thunk/ppb_output_protection_api.h32
-rw-r--r--ppapi/thunk/resource_creation_api.h1
18 files changed, 407 insertions, 0 deletions
diff --git a/ppapi/cpp/private/output_protection_private.cc b/ppapi/cpp/private/output_protection_private.cc
new file mode 100644
index 0000000..9b244fe
--- /dev/null
+++ b/ppapi/cpp/private/output_protection_private.cc
@@ -0,0 +1,59 @@
+// 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
diff --git a/ppapi/cpp/private/output_protection_private.h b/ppapi/cpp/private/output_protection_private.h
new file mode 100644
index 0000000..6b543ea
--- /dev/null
+++ b/ppapi/cpp/private/output_protection_private.h
@@ -0,0 +1,28 @@
+// 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 "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_
diff --git a/ppapi/ppapi_proxy.gypi b/ppapi/ppapi_proxy.gypi
index 267402d..c078ef1 100644
--- a/ppapi/ppapi_proxy.gypi
+++ b/ppapi/ppapi_proxy.gypi
@@ -88,6 +88,8 @@
'proxy/network_monitor_resource.h',
'proxy/network_proxy_resource.cc',
'proxy/network_proxy_resource.h',
+ 'proxy/output_protection_resource.cc',
+ 'proxy/output_protection_resource.h',
'proxy/pdf_resource.cc',
'proxy/pdf_resource.h',
'proxy/platform_verification_private_resource.cc',
diff --git a/ppapi/ppapi_shared.gypi b/ppapi/ppapi_shared.gypi
index 7edeb2f..b861a34 100644
--- a/ppapi/ppapi_shared.gypi
+++ b/ppapi/ppapi_shared.gypi
@@ -213,6 +213,8 @@
'thunk/ppb_network_monitor_thunk.cc',
'thunk/ppb_network_proxy_api.h',
'thunk/ppb_network_proxy_thunk.cc',
+ 'thunk/ppb_output_protection_api.h',
+ 'thunk/ppb_output_protection_private_thunk.cc',
'thunk/ppb_pdf_api.h',
'thunk/ppb_pdf_thunk.cc',
'thunk/ppb_platform_verification_api.h',
diff --git a/ppapi/ppapi_sources.gypi b/ppapi/ppapi_sources.gypi
index 6ec54b7..64219de 100644
--- a/ppapi/ppapi_sources.gypi
+++ b/ppapi/ppapi_sources.gypi
@@ -115,6 +115,7 @@
'c/private/ppb_instance_private.h',
'c/private/ppb_nacl_private.h',
'c/private/ppb_net_address_private.h',
+ 'c/private/ppb_output_protection_private.h',
'c/private/ppb_pdf.h',
'c/private/ppb_platform_verification_private.h',
'c/private/ppb_proxy_private.h',
@@ -321,6 +322,8 @@
'cpp/private/instance_private.h',
'cpp/private/net_address_private.cc',
'cpp/private/net_address_private.h',
+ 'cpp/private/output_protection_private.cc',
+ 'cpp/private/output_protection_private.h',
'cpp/private/pass_file_handle.cc',
'cpp/private/pass_file_handle.h',
'cpp/private/pdf.cc',
@@ -450,6 +453,8 @@
'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',
diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc
index 9c810a3..447d025f 100644
--- a/ppapi/proxy/interface_list.cc
+++ b/ppapi/proxy/interface_list.cc
@@ -81,6 +81,7 @@
#include "ppapi/c/private/ppb_flash_print.h"
#include "ppapi/c/private/ppb_host_resolver_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_talk_private.h"
diff --git a/ppapi/proxy/output_protection_resource.cc b/ppapi/proxy/output_protection_resource.cc
new file mode 100644
index 0000000..8f601de
--- /dev/null
+++ b/ppapi/proxy/output_protection_resource.cc
@@ -0,0 +1,105 @@
+// 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
diff --git a/ppapi/proxy/output_protection_resource.h b/ppapi/proxy/output_protection_resource.h
new file mode 100644
index 0000000..b56a33d
--- /dev/null
+++ b/ppapi/proxy/output_protection_resource.h
@@ -0,0 +1,58 @@
+// 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 "base/compiler_specific.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:
+ virtual ~OutputProtectionResource();
+
+ // PluginResource overrides.
+ virtual thunk::PPB_OutputProtection_API* AsPPB_OutputProtection_API()
+ OVERRIDE;
+
+ // PPB_OutputProtection_API implementation.
+ virtual int32_t QueryStatus(
+ uint32_t* link_mask,
+ uint32_t* protection_mask,
+ const scoped_refptr<TrackedCallback>& callback) OVERRIDE;
+ virtual 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_
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index c308873..046dbea 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -1702,6 +1702,17 @@ 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 */)
+
#if !defined(OS_NACL) && !defined(NACL_WIN64)
// Audio input.
diff --git a/ppapi/proxy/resource_creation_proxy.cc b/ppapi/proxy/resource_creation_proxy.cc
index d1b99ec..7ee761b 100644
--- a/ppapi/proxy/resource_creation_proxy.cc
+++ b/ppapi/proxy/resource_creation_proxy.cc
@@ -21,6 +21,7 @@
#include "ppapi/proxy/host_resolver_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"
@@ -313,6 +314,12 @@ 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();
}
diff --git a/ppapi/proxy/resource_creation_proxy.h b/ppapi/proxy/resource_creation_proxy.h
index 1507dc8..df564da 100644
--- a/ppapi/proxy/resource_creation_proxy.h
+++ b/ppapi/proxy/resource_creation_proxy.h
@@ -134,6 +134,8 @@ class ResourceCreationProxy : public InterfaceProxy,
PP_Instance instance,
const PP_NetAddress_Private& private_addr) OVERRIDE;
virtual PP_Resource CreateNetworkMonitor(PP_Instance instance) OVERRIDE;
+ virtual PP_Resource CreateOutputProtectionPrivate(
+ PP_Instance instance) OVERRIDE;
virtual PP_Resource CreatePrinting(PP_Instance) OVERRIDE;
virtual PP_Resource CreateTCPServerSocketPrivate(
PP_Instance instance) OVERRIDE;
diff --git a/ppapi/shared_impl/resource.h b/ppapi/shared_impl/resource.h
index 15ce142..d364b44 100644
--- a/ppapi/shared_impl/resource.h
+++ b/ppapi/shared_impl/resource.h
@@ -57,6 +57,7 @@
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) \
diff --git a/ppapi/tests/all_c_includes.h b/ppapi/tests/all_c_includes.h
index f6e3de0..be825ac 100644
--- a/ppapi/tests/all_c_includes.h
+++ b/ppapi/tests/all_c_includes.h
@@ -117,6 +117,7 @@
#include "ppapi/c/private/ppb_instance_private.h"
#include "ppapi/c/private/ppb_nacl_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"
diff --git a/ppapi/tests/test_output_protection_private.cc b/ppapi/tests/test_output_protection_private.cc
new file mode 100644
index 0000000..49a44ae
--- /dev/null
+++ b/ppapi/tests/test_output_protection_private.cc
@@ -0,0 +1,60 @@
+// 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 "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();
+}
diff --git a/ppapi/tests/test_output_protection_private.h b/ppapi/tests/test_output_protection_private.h
new file mode 100644
index 0000000..a7a341e
--- /dev/null
+++ b/ppapi/tests/test_output_protection_private.h
@@ -0,0 +1,29 @@
+// 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_
diff --git a/ppapi/thunk/interfaces_ppb_private.h b/ppapi/thunk/interfaces_ppb_private.h
index 038d5c5..94a1793 100644
--- a/ppapi/thunk/interfaces_ppb_private.h
+++ b/ppapi/thunk/interfaces_ppb_private.h
@@ -58,6 +58,9 @@ PROXIED_IFACE(NoAPIName, PPB_FILEIOTRUSTED_INTERFACE_0_4, PPB_FileIOTrusted_0_4)
PROXIED_IFACE(NoAPIName, PPB_URLLOADERTRUSTED_INTERFACE_0_3,
PPB_URLLoaderTrusted_0_3)
+PROXIED_IFACE(NoAPIName, PPB_OUTPUTPROTECTION_PRIVATE_INTERFACE_0_1,
+ PPB_OutputProtection_Private_0_1)
+
// Hack to keep font working. The Font 0.6 API is binary compatible with
// BrowserFont 1.0, so just map the string to the same thing.
// TODO(brettw) remove support for the old Font API.
diff --git a/ppapi/thunk/ppb_output_protection_api.h b/ppapi/thunk/ppb_output_protection_api.h
new file mode 100644
index 0000000..8a12090
--- /dev/null
+++ b/ppapi/thunk/ppb_output_protection_api.h
@@ -0,0 +1,32 @@
+// 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 "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_
diff --git a/ppapi/thunk/resource_creation_api.h b/ppapi/thunk/resource_creation_api.h
index aa731cf..61eaa97 100644
--- a/ppapi/thunk/resource_creation_api.h
+++ b/ppapi/thunk/resource_creation_api.h
@@ -146,6 +146,7 @@ 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;