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

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

Issue 2272313003: binding: Makes ExceptionState STACK_ALLOCATED(). (Closed)
Patch Set: Synced. Created 4 years, 3 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef OnStackObjectChecker_h
6 #define OnStackObjectChecker_h
7
8 #include "core/CoreExport.h"
9 #include "wtf/HashSet.h"
10 #include "wtf/Noncopyable.h"
11
12 namespace blink {
13
14 #if ENABLE(ASSERT)
15 class Dictionary;
16
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
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.
21 // The C++ objects to be checked must call add() on creation, and remove() on
22 // destruction, respectively.
23 class CORE_EXPORT OnStackObjectChecker final {
24 WTF_MAKE_NONCOPYABLE(OnStackObjectChecker);
25 public:
26 OnStackObjectChecker();
27 ~OnStackObjectChecker();
28
29 void add(Dictionary*);
30 void remove(Dictionary*);
31
32 private:
33 HashSet<Dictionary*> m_dictionaries;
34 };
35 #endif
36
37 } // namespace blink
38
39 #endif // OnStackObjectChecker_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698