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

Side by Side Diff: Source/web/OpenedFrameTracker.h

Issue 1328773002: Make classes and structures in web fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« no previous file with comments | « Source/web/NotificationPermissionClientImpl.h ('k') | Source/web/PageOverlay.h » ('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 OpenedFrameTracker_h 5 #ifndef OpenedFrameTracker_h
6 #define OpenedFrameTracker_h 6 #define OpenedFrameTracker_h
7 7
8 #include "wtf/FastAllocBase.h"
8 #include "wtf/HashSet.h" 9 #include "wtf/HashSet.h"
9 #include "wtf/Noncopyable.h" 10 #include "wtf/Noncopyable.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 class Visitor; 14 class Visitor;
14 class InlinedGlobalMarkingVisitor; 15 class InlinedGlobalMarkingVisitor;
15 class WebFrame; 16 class WebFrame;
16 17
17 // Small helper class to track the set of frames that a WebFrame has opened. 18 // Small helper class to track the set of frames that a WebFrame has opened.
18 // Due to layering restrictions, we need to hide the implementation, since 19 // Due to layering restrictions, we need to hide the implementation, since
19 // public/web/ cannot depend on wtf/. 20 // public/web/ cannot depend on wtf/.
20 class OpenedFrameTracker { 21 class OpenedFrameTracker {
22 WTF_MAKE_FAST_ALLOCATED(OpenedFrameTracker);
21 WTF_MAKE_NONCOPYABLE(OpenedFrameTracker); 23 WTF_MAKE_NONCOPYABLE(OpenedFrameTracker);
22 public: 24 public:
23 OpenedFrameTracker(); 25 OpenedFrameTracker();
24 ~OpenedFrameTracker(); 26 ~OpenedFrameTracker();
25 27
26 bool isEmpty() const; 28 bool isEmpty() const;
27 void add(WebFrame*); 29 void add(WebFrame*);
28 void remove(WebFrame*); 30 void remove(WebFrame*);
29 31
30 // Updates the opener for all tracked frames. 32 // Updates the opener for all tracked frames.
31 void updateOpener(WebFrame*); 33 void updateOpener(WebFrame*);
32 34
33 void traceFrames(Visitor*); 35 void traceFrames(Visitor*);
34 void traceFrames(InlinedGlobalMarkingVisitor); 36 void traceFrames(InlinedGlobalMarkingVisitor);
35 37
36 private: 38 private:
37 template <typename VisitorDispatcher> 39 template <typename VisitorDispatcher>
38 void traceFramesImpl(VisitorDispatcher); 40 void traceFramesImpl(VisitorDispatcher);
39 41
40 WTF::HashSet<WebFrame*> m_openedFrames; 42 WTF::HashSet<WebFrame*> m_openedFrames;
41 }; 43 };
42 44
43 } // namespace blink 45 } // namespace blink
44 46
45 #endif // WebFramePrivate_h 47 #endif // WebFramePrivate_h
OLDNEW
« no previous file with comments | « Source/web/NotificationPermissionClientImpl.h ('k') | Source/web/PageOverlay.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698