Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 304 #if ENABLE(OILPAN) | 304 #if ENABLE(OILPAN) |
| 305 ThreadState::current()->registerPreFinalizer(*this); | 305 ThreadState::current()->registerPreFinalizer(*this); |
| 306 #endif | 306 #endif |
| 307 } | 307 } |
| 308 | 308 |
| 309 void LocalDOMWindow::clearDocument() | 309 void LocalDOMWindow::clearDocument() |
| 310 { | 310 { |
| 311 if (!m_document) | 311 if (!m_document) |
| 312 return; | 312 return; |
| 313 | 313 |
| 314 if (m_document->isActive()) { | |
|
dcheng
2015/04/03 14:35:45
I moved this directly into the XSLT code so we don
| |
| 315 // FIXME: We don't call willRemove here. Why is that OK? | |
| 316 // This detach() call is also mostly redundant. Most of the calls to | |
| 317 // this function come via DocumentLoader::createWriterFor, which | |
| 318 // always detaches the previous Document first. Only XSLTProcessor | |
| 319 // depends on this detach() call, so it seems like there's some room | |
| 320 // for cleanup. | |
| 321 m_document->detach(); | |
| 322 } | |
| 323 | |
| 324 // FIXME: This should be part of ActiveDOMObject shutdown | 314 // FIXME: This should be part of ActiveDOMObject shutdown |
| 325 clearEventQueue(); | 315 clearEventQueue(); |
| 326 | 316 |
| 327 m_document->clearDOMWindow(); | 317 m_document->clearDOMWindow(); |
| 328 m_document = nullptr; | 318 m_document = nullptr; |
| 329 } | 319 } |
| 330 | 320 |
| 331 void LocalDOMWindow::clearEventQueue() | 321 void LocalDOMWindow::clearEventQueue() |
| 332 { | 322 { |
| 333 if (!m_eventQueue) | 323 if (!m_eventQueue) |
| (...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1659 return m_frameObserver->frame(); | 1649 return m_frameObserver->frame(); |
| 1660 } | 1650 } |
| 1661 | 1651 |
| 1662 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte xt, v8::Isolate* isolate) | 1652 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte xt, v8::Isolate* isolate) |
| 1663 { | 1653 { |
| 1664 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8]. | 1654 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8]. |
| 1665 return v8::Handle<v8::Object>(); | 1655 return v8::Handle<v8::Object>(); |
| 1666 } | 1656 } |
| 1667 | 1657 |
| 1668 } // namespace blink | 1658 } // namespace blink |
| OLD | NEW |