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

Unified Diff: ppapi/cpp/dev/device_ref_dev.cc

Issue 9192019: Implement PPB_DeviceRef_Dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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/dev/device_ref_dev.cc
diff --git a/ppapi/cpp/dev/device_ref_dev.cc b/ppapi/cpp/dev/device_ref_dev.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4513699d82b71359fa6f65a074fcc928d0d921c6
--- /dev/null
+++ b/ppapi/cpp/dev/device_ref_dev.cc
@@ -0,0 +1,48 @@
+// Copyright (c) 2012 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/dev/device_ref_dev.h"
+
+#include "ppapi/cpp/module_impl.h"
+
+namespace pp {
+
+namespace {
+
+template <> const char* interface_name<PPB_DeviceRef_Dev>() {
+ return PPB_DEVICEREF_DEV_INTERFACE;
+}
+
+} // namespace
+
+DeviceRef_Dev::DeviceRef_Dev() {
+}
+
+DeviceRef_Dev::DeviceRef_Dev(PP_Resource resource) : Resource(resource) {
+}
+
+DeviceRef_Dev::DeviceRef_Dev(PassRef, PP_Resource resource) {
+ PassRefFromConstructor(resource);
+}
+
+DeviceRef_Dev::DeviceRef_Dev(const DeviceRef_Dev& other) : Resource(other) {
+}
+
+DeviceRef_Dev::~DeviceRef_Dev() {
+}
+
+PP_DeviceType_Dev DeviceRef_Dev::GetType() const {
+ if (!has_interface<PPB_DeviceRef_Dev>())
+ return PP_DEVICETYPE_INVALID;
+ return get_interface<PPB_DeviceRef_Dev>()->GetType(pp_resource());
+}
+
+Var DeviceRef_Dev::GetName() const {
+ if (!has_interface<PPB_DeviceRef_Dev>())
+ return Var();
+ return Var(Var::PassRef(),
+ get_interface<PPB_DeviceRef_Dev>()->GetName(pp_resource()));
+}
+
+} // namespace pp

Powered by Google App Engine
This is Rietveld 408576698