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

Side by Side Diff: Source/WebCore/bindings/dart/DartDOMData.h

Issue 9837116: DOM wrappers that are not retained from Dart should be collected. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Address comments. 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef DartDOMData_h 31 #ifndef DartDOMData_h
32 #define DartDOMData_h 32 #define DartDOMData_h
33 33
34 #include <dart_api.h> 34 #include <dart_api.h>
35 #include <wtf/HashMap.h> 35 #include <wtf/HashMap.h>
36 #include <wtf/HashSet.h>
36 #include <wtf/RefPtr.h> 37 #include <wtf/RefPtr.h>
37 #include <wtf/Vector.h> 38 #include <wtf/Vector.h>
38 39
39 namespace WebCore { 40 namespace WebCore {
40 41
42 class DOMWindow;
41 class DartApplicationLoader; 43 class DartApplicationLoader;
42 class DartEventListener; 44 class DartEventListener;
43 class ScriptExecutionContext; 45 class ScriptExecutionContext;
44 class DOMWindow; 46 class WeakCallbackData;
45 47
46 typedef HashMap<void*, Dart_Handle> DartDOMMap; 48 typedef HashMap<void*, Dart_Handle> DartDOMMap;
47 typedef Vector< RefPtr<DartEventListener> > DartEventListenerList; 49 typedef Vector< RefPtr<DartEventListener> > DartEventListenerList;
50 typedef HashSet<DartWeakCallback*> DartWeakCallbacks;
48 51
49 class DartDOMData { 52 class DartDOMData {
50 public: 53 public:
51 DartDOMData(PassRefPtr<DartApplicationLoader> applicationLoader, ScriptExecu tionContext* context); 54 DartDOMData(PassRefPtr<DartApplicationLoader> applicationLoader, ScriptExecu tionContext* context);
55 ~DartDOMData();
52 56
53 PassRefPtr<DartApplicationLoader> applicationLoader(); 57 PassRefPtr<DartApplicationLoader> applicationLoader();
54 ScriptExecutionContext* scriptExecutionContext() { return m_scriptExecutionC ontext; } 58 ScriptExecutionContext* scriptExecutionContext() { return m_scriptExecutionC ontext; }
55 DOMWindow* domWindow() { return m_domWindow; } 59 DOMWindow* domWindow() { return m_domWindow; }
56 DartDOMMap* domMap() { return &m_domMap; } 60 DartDOMMap* domMap() { return &m_domMap; }
57 DartEventListenerList* eventListeners() { return &m_eventListeners; } 61 DartEventListenerList* eventListeners() { return &m_eventListeners; }
62 DartWeakCallbacks* weakCallbacks() { return &m_weakCallbacks; }
58 int* recursion() { return &m_recursion; } 63 int* recursion() { return &m_recursion; }
59 64
60 private: 65 private:
61 RefPtr<DartApplicationLoader> m_applicationLoader; 66 RefPtr<DartApplicationLoader> m_applicationLoader;
62 ScriptExecutionContext* m_scriptExecutionContext; 67 ScriptExecutionContext* m_scriptExecutionContext;
63 DOMWindow* m_domWindow; 68 DOMWindow* m_domWindow;
64 DartDOMMap m_domMap; 69 DartDOMMap m_domMap;
65 DartEventListenerList m_eventListeners; 70 DartEventListenerList m_eventListeners;
71 DartWeakCallbacks m_weakCallbacks;
66 int m_recursion; 72 int m_recursion;
67 }; 73 };
68 74
69 } 75 }
70 76
71 #endif // DartDOMData_h 77 #endif // DartDOMData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698