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

Side by Side Diff: ppapi/shared_impl/var_tracker.h

Issue 10069032: PPAPI: Compile out thread checks when pepper threading is turned on. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 14 matching lines...) Expand all
25 // The tricky part is the concept of a "tracked object". These are only 25 // The tricky part is the concept of a "tracked object". These are only
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 #ifdef ENABLE_PEPPER_THREADING
36 class PPAPI_SHARED_EXPORT VarTracker {
37 #else
35 class PPAPI_SHARED_EXPORT VarTracker 38 class PPAPI_SHARED_EXPORT VarTracker
36 : NON_EXPORTED_BASE(public base::NonThreadSafe) { 39 : NON_EXPORTED_BASE(public base::NonThreadSafe) {
40 #endif
37 public: 41 public:
38 VarTracker(); 42 VarTracker();
39 virtual ~VarTracker(); 43 virtual ~VarTracker();
40 44
41 // Called by the Var object to add a new var to the tracker. 45 // Called by the Var object to add a new var to the tracker.
42 int32 AddVar(Var* var); 46 int32 AddVar(Var* var);
43 47
44 // Looks up a given var and returns a reference to the Var if it exists. 48 // 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 49 // Returns NULL if the var type is not an object we track (POD) or is
46 // invalid. 50 // invalid.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // implemented by the Host and Plugin tracker separately, so that it can be 159 // implemented by the Host and Plugin tracker separately, so that it can be
156 // a real WebKit ArrayBuffer on the host side. 160 // a real WebKit ArrayBuffer on the host side.
157 virtual ArrayBufferVar* CreateArrayBuffer(uint32 size_in_bytes) = 0; 161 virtual ArrayBufferVar* CreateArrayBuffer(uint32 size_in_bytes) = 0;
158 162
159 DISALLOW_COPY_AND_ASSIGN(VarTracker); 163 DISALLOW_COPY_AND_ASSIGN(VarTracker);
160 }; 164 };
161 165
162 } // namespace ppapi 166 } // namespace ppapi
163 167
164 #endif // PPAPI_SHARED_IMPL_VAR_TRACKER_H_ 168 #endif // PPAPI_SHARED_IMPL_VAR_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698