Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(748)

Unified Diff: ppapi/cpp/private/output_protection_private.cc

Issue 24039002: Pepper API implementation for output protection. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: avoid PostTask methods in dtor Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/cpp/private/output_protection_private.cc
diff --git a/ppapi/cpp/private/output_protection_private.cc b/ppapi/cpp/private/output_protection_private.cc
new file mode 100644
index 0000000000000000000000000000000000000000..39d01c54928c5c9dd54b8c346edfcff818c1dffc
--- /dev/null
+++ b/ppapi/cpp/private/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/cpp/private/output_protection_private.h"
+
+#include <stdio.h>
+#include "ppapi/c/pp_errors.h"
+#include "ppapi/c/ppb_var.h"
dmichael (off chromium) 2013/09/09 20:37:15 ^^ You don't appear to use this
kcwu 2013/09/10 12:50:21 Done.
+#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

Powered by Google App Engine
This is Rietveld 408576698