| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |