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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/OnStackObjectChecker.h

Issue 1999343002: Unify and provide one IsGarbageCollectedType<T> implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit test Created 4 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/OnStackObjectChecker.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 OnStackObjectChecker_h 5 #ifndef OnStackObjectChecker_h
6 #define OnStackObjectChecker_h 6 #define OnStackObjectChecker_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "wtf/HashSet.h" 9 #include "wtf/HashSet.h"
10 #include "wtf/Noncopyable.h" 10 #include "wtf/Noncopyable.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 #if ENABLE(ASSERT) 14 #if ENABLE(ASSERT)
15 class Dictionary; 15 class Dictionary;
16 16
17 // A lifetime checker for C++ objects which must not outlive the owner of an 17 // A lifetime checker for C++ objects which must not outlive the owner of an
18 // instance of this class. In general, we should rely on Oilpan or RefCounted 18 // instance of this class. In general, we should rely on Oilpan or RefCounted
19 // to manage object lifetime. However, we don't use them for some objects 19 // to manage object lifetime. However, we don't use them for some objects
20 // (e.g. Dictionary) for performance reason. This checker is for such objects. 20 // (e.g. Dictionary) for performance reason. This checker is for such objects.
21 // The C++ objects to be checked must call add() on creation, and remove() on 21 // The C++ objects to be checked must call add() on creation, and remove() on
22 // destruction, respectively. 22 // destruction, respectively.
23 class CORE_EXPORT OnStackObjectChecker final { 23 class CORE_EXPORT OnStackObjectChecker final {
24 WTF_MAKE_NONCOPYABLE(OnStackObjectChecker); 24 WTF_MAKE_NONCOPYABLE(OnStackObjectChecker);
25 public: 25 public:
26 OnStackObjectChecker() { } 26 OnStackObjectChecker();
27 ~OnStackObjectChecker(); 27 ~OnStackObjectChecker();
28 28
29 void add(Dictionary*); 29 void add(Dictionary*);
30 void remove(Dictionary*); 30 void remove(Dictionary*);
31 31
32 private: 32 private:
33 HashSet<Dictionary*> m_dictionaries; 33 HashSet<Dictionary*> m_dictionaries;
34 }; 34 };
35 #endif 35 #endif
36 36
37 } // namespace blink 37 } // namespace blink
38 38
39 #endif // OnStackObjectChecker_h 39 #endif // OnStackObjectChecker_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/OnStackObjectChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698