OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 PPAPI_SHARED_IMPL_VAR_TRACKER_H_ | 5 #ifndef PPAPI_SHARED_IMPL_VAR_TRACKER_H_ |
6 #define PPAPI_SHARED_IMPL_VAR_TRACKER_H_ | 6 #define PPAPI_SHARED_IMPL_VAR_TRACKER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // necessary in the plugin side of the proxy when running out of process. A | 26 // necessary in the plugin side of the proxy when running out of process. A |
27 // tracked object is one that the plugin is aware of, but doesn't hold a | 27 // tracked object is one that the plugin is aware of, but doesn't hold a |
28 // reference to. This will happen when the plugin is passed an object as an | 28 // reference to. This will happen when the plugin is passed an object as an |
29 // argument from the host (renderer) as an input argument to a sync function, | 29 // argument from the host (renderer) as an input argument to a sync function, |
30 // but where ownership is not passed. | 30 // but where ownership is not passed. |
31 // | 31 // |
32 // This class maintains the "track_with_no_reference_count" but doesn't do | 32 // This class maintains the "track_with_no_reference_count" but doesn't do |
33 // anything with it other than call virtual functions. The interesting parts | 33 // anything with it other than call virtual functions. The interesting parts |
34 // are added by the PluginObjectVar derived from this class. | 34 // are added by the PluginObjectVar derived from this class. |
35 class PPAPI_SHARED_EXPORT VarTracker | 35 class PPAPI_SHARED_EXPORT VarTracker |
| 36 #ifdef ENABLE_PEPPER_THREADING |
| 37 : NON_EXPORTED_BASE(public base::NonThreadSafeDoNothing) { |
| 38 #else |
| 39 // TODO(dmichael): Remove the thread checking when calls are allowed off the |
| 40 // main thread (crbug.com/92909). |
36 : NON_EXPORTED_BASE(public base::NonThreadSafe) { | 41 : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| 42 #endif |
37 public: | 43 public: |
38 VarTracker(); | 44 VarTracker(); |
39 virtual ~VarTracker(); | 45 virtual ~VarTracker(); |
40 | 46 |
41 // Called by the Var object to add a new var to the tracker. | 47 // Called by the Var object to add a new var to the tracker. |
42 int32 AddVar(Var* var); | 48 int32 AddVar(Var* var); |
43 | 49 |
44 // Looks up a given var and returns a reference to the Var if it exists. | 50 // Looks up a given var and returns a reference to the Var if it exists. |
45 // Returns NULL if the var type is not an object we track (POD) or is | 51 // Returns NULL if the var type is not an object we track (POD) or is |
46 // invalid. | 52 // invalid. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // implemented by the Host and Plugin tracker separately, so that it can be | 161 // implemented by the Host and Plugin tracker separately, so that it can be |
156 // a real WebKit ArrayBuffer on the host side. | 162 // a real WebKit ArrayBuffer on the host side. |
157 virtual ArrayBufferVar* CreateArrayBuffer(uint32 size_in_bytes) = 0; | 163 virtual ArrayBufferVar* CreateArrayBuffer(uint32 size_in_bytes) = 0; |
158 | 164 |
159 DISALLOW_COPY_AND_ASSIGN(VarTracker); | 165 DISALLOW_COPY_AND_ASSIGN(VarTracker); |
160 }; | 166 }; |
161 | 167 |
162 } // namespace ppapi | 168 } // namespace ppapi |
163 | 169 |
164 #endif // PPAPI_SHARED_IMPL_VAR_TRACKER_H_ | 170 #endif // PPAPI_SHARED_IMPL_VAR_TRACKER_H_ |
OLD | NEW |