OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_HOST_PLUGIN_HOST_PLUGIN_UTILS_H_ | 5 #ifndef REMOTING_HOST_PLUGIN_HOST_PLUGIN_UTILS_H_ |
6 #define REMOTING_HOST_PLUGIN_HOST_PLUGIN_UTILS_H_ | 6 #define REMOTING_HOST_PLUGIN_HOST_PLUGIN_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "third_party/npapi/bindings/npapi.h" | 10 #include "third_party/npapi/bindings/npapi.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 NPVariant NPVariantFromString(const std::string& val); | 28 NPVariant NPVariantFromString(const std::string& val); |
29 | 29 |
30 // Convert an NPVariant into an NSPObject. | 30 // Convert an NPVariant into an NSPObject. |
31 NPObject* ObjectFromNPVariant(const NPVariant& variant); | 31 NPObject* ObjectFromNPVariant(const NPVariant& variant); |
32 | 32 |
33 // Scoped reference pointer for NPObjects. All objects using this class | 33 // Scoped reference pointer for NPObjects. All objects using this class |
34 // must be owned by g_npnetscape_funcs. | 34 // must be owned by g_npnetscape_funcs. |
35 class ScopedRefNPObject { | 35 class ScopedRefNPObject { |
36 public: | 36 public: |
37 ScopedRefNPObject(); | 37 ScopedRefNPObject(); |
38 explicit ScopedRefNPObject(NPObject* object); | |
Sergey Ulanov
2011/08/30 02:30:16
Do we still need this constructor?
| |
38 ~ScopedRefNPObject(); | 39 ~ScopedRefNPObject(); |
39 | 40 |
40 // Release the held reference and replace it with |object|, incrementing | 41 // Release the held reference and replace it with |object|, incrementing |
41 // its reference count. | 42 // its reference count. |
42 ScopedRefNPObject& operator=(NPObject* object); | 43 ScopedRefNPObject& operator=(NPObject* object); |
43 | 44 |
44 NPObject* get() { return object_; } | 45 NPObject* get() { return object_; } |
45 | 46 |
46 private: | 47 private: |
47 NPObject* object_; | 48 NPObject* object_; |
48 | 49 |
49 DISALLOW_COPY_AND_ASSIGN(ScopedRefNPObject); | 50 DISALLOW_COPY_AND_ASSIGN(ScopedRefNPObject); |
50 }; | 51 }; |
51 | 52 |
52 } // namespace remoting | 53 } // namespace remoting |
53 | 54 |
54 #endif // REMOTING_HOST_PLUGIN_HOST_PLUGIN_UTILS_H_ | 55 #endif // REMOTING_HOST_PLUGIN_HOST_PLUGIN_UTILS_H_ |
OLD | NEW |