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

Side by Side Diff: Source/WebCore/bindings/dart/DartController.cpp

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: Rebased with proper shutdown semantics. 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) 2009, Google Inc. 1 // Copyright (c) 2009, Google Inc.
2 // All rights reserved. 2 // 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 { 128 {
129 clearWindowShell(); 129 clearWindowShell();
130 } 130 }
131 131
132 void DartController::clearWindowShell() 132 void DartController::clearWindowShell()
133 { 133 {
134 m_scriptsLoaded = false; 134 m_scriptsLoaded = false;
135 135
136 for (size_t i = 0; i < m_isolates.size(); ++i) { 136 for (size_t i = 0; i < m_isolates.size(); ++i) {
137 DartIsolate::Scope scope(m_isolates[i]); 137 DartIsolate::Scope scope(m_isolates[i]);
138 DartDOMMap* domMap = DartUtilities::domMapForCurrentIsolate(); 138 DartUtilities::disposeWeakPersistentHandles();
139 for (DartDOMMap::iterator it = domMap->begin(); it != domMap->end(); ++i t)
140 DartDOMWrapper::derefDOMObject(it->second, it->first);
141 } 139 }
142 140
143 for (size_t i = 0; i < m_isolates.size(); ++i) { 141 for (size_t i = 0; i < m_isolates.size(); ++i) {
144 DartIsolate::Scope scope(m_isolates[i]); 142 DartIsolate::Scope scope(m_isolates[i]);
145 DartEventListenerList* eventListeners = DartUtilities::domDataForCurrent Isolate()->eventListeners(); 143 DartEventListenerList* eventListeners = DartUtilities::domDataForCurrent Isolate()->eventListeners();
146 #ifndef NDEBUG 144 #ifndef NDEBUG
147 for (unsigned i = 0; i < eventListeners->size(); ++i) 145 for (unsigned i = 0; i < eventListeners->size(); ++i)
148 ASSERT((*eventListeners)[i]->refCount() == 1); 146 ASSERT((*eventListeners)[i]->refCount() == 1);
149 #endif 147 #endif
150 eventListeners->clear(); 148 eventListeners->clear();
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 } 606 }
609 607
610 DartController* DartController::retrieve(ScriptExecutionContext* context) 608 DartController* DartController::retrieve(ScriptExecutionContext* context)
611 { 609 {
612 if (!context || !context->isDocument()) 610 if (!context || !context->isDocument())
613 return 0; 611 return 0;
614 return retrieve(static_cast<Document*>(context)->frame()); 612 return retrieve(static_cast<Document*>(context)->frame());
615 } 613 }
616 614
617 } 615 }
OLDNEW
« no previous file with comments | « no previous file | Source/WebCore/bindings/dart/DartDOMData.h » ('j') | Source/WebCore/bindings/dart/DartDOMData.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698