Revert 285458 "Disable exceptions on Windows in all builds (take 3)"
[chromium-blink-merge.git] / ppapi / shared_impl / ppb_device_ref_shared.h
blob294093fe871ba388f7760b7f2edc303231a0c571
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef PPAPI_SHARED_IMPL_PPB_DEVICE_REF_SHARED_H_
6 #define PPAPI_SHARED_IMPL_PPB_DEVICE_REF_SHARED_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "ppapi/shared_impl/resource.h"
13 #include "ppapi/thunk/ppb_device_ref_api.h"
15 namespace ppapi {
17 // IF YOU ADD STUFF TO THIS CLASS
18 // ==============================
19 // Be sure to add it to the STRUCT_TRAITS at the top of ppapi_messages.h.
20 struct PPAPI_SHARED_EXPORT DeviceRefData {
21 DeviceRefData();
23 bool operator==(const DeviceRefData& other) const {
24 return type == other.type && name == other.name && id == other.id;
27 PP_DeviceType_Dev type;
28 std::string name;
29 std::string id;
32 class PPAPI_SHARED_EXPORT PPB_DeviceRef_Shared
33 : public Resource,
34 public thunk::PPB_DeviceRef_API {
35 public:
36 PPB_DeviceRef_Shared(ResourceObjectType type,
37 PP_Instance instance,
38 const DeviceRefData& data);
40 // Resource overrides.
41 virtual PPB_DeviceRef_API* AsPPB_DeviceRef_API() OVERRIDE;
43 // PPB_DeviceRef_API implementation.
44 virtual const DeviceRefData& GetDeviceRefData() const OVERRIDE;
45 virtual PP_DeviceType_Dev GetType() OVERRIDE;
46 virtual PP_Var GetName() OVERRIDE;
48 private:
49 DeviceRefData data_;
51 DISALLOW_IMPLICIT_CONSTRUCTORS(PPB_DeviceRef_Shared);
54 } // namespace ppapi
56 #endif // PPAPI_SHARED_IMPL_PPB_DEVICE_REF_SHARED_H_