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

Unified Diff: ppapi/shared_impl/ppb_device_ref_shared.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
« no previous file with comments | « ppapi/shared_impl/ppb_device_ref_shared.h ('k') | ppapi/shared_impl/resource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/ppb_device_ref_shared.cc
diff --git a/ppapi/shared_impl/ppb_device_ref_shared.cc b/ppapi/shared_impl/ppb_device_ref_shared.cc
new file mode 100644
index 0000000000000000000000000000000000000000..edd01f2ce9051739f8f9be8cc5b4b6b997f59661
--- /dev/null
+++ b/ppapi/shared_impl/ppb_device_ref_shared.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/shared_impl/ppb_device_ref_shared.h"
+
+#include "ppapi/shared_impl/host_resource.h"
+#include "ppapi/shared_impl/var.h"
+
+using ppapi::thunk::PPB_DeviceRef_API;
+
+namespace ppapi {
+
+DeviceRefData::DeviceRefData()
+ : type(PP_DEVICETYPE_DEV_INVALID) {
+}
+
+PPB_DeviceRef_Shared::PPB_DeviceRef_Shared(const InitAsImpl&,
+ PP_Instance instance,
+ const DeviceRefData& data)
+ : Resource(instance),
+ data_(data) {
+}
+
+PPB_DeviceRef_Shared::PPB_DeviceRef_Shared(const InitAsProxy&,
+ PP_Instance instance,
+ const DeviceRefData& data)
+ : Resource(HostResource::MakeInstanceOnly(instance)),
+ data_(data) {
+}
+
+PPB_DeviceRef_API* PPB_DeviceRef_Shared::AsPPB_DeviceRef_API() {
+ return this;
+}
+
+const DeviceRefData& PPB_DeviceRef_Shared::GetDeviceRefData() const {
+ return data_;
+}
+
+PP_DeviceType_Dev PPB_DeviceRef_Shared::GetType() {
+ return data_.type;
+}
+
+PP_Var PPB_DeviceRef_Shared::GetName() {
+ return StringVar::StringToPPVar(data_.name);
+}
+
+} // namespace ppapi
« no previous file with comments | « ppapi/shared_impl/ppb_device_ref_shared.h ('k') | ppapi/shared_impl/resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698