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()) { | 314 ASSERT(!m_document->isActive()); |
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 | 315 |
324 // FIXME: This should be part of ActiveDOMObject shutdown | 316 // FIXME: This should be part of ActiveDOMObject shutdown |
325 clearEventQueue(); | 317 clearEventQueue(); |
326 | 318 |
327 m_document->clearDOMWindow(); | 319 m_document->clearDOMWindow(); |
328 m_document = nullptr; | 320 m_document = nullptr; |
329 } | 321 } |
330 | 322 |
331 void LocalDOMWindow::clearEventQueue() | 323 void LocalDOMWindow::clearEventQueue() |
332 { | 324 { |
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 return m_frameObserver->frame(); | 1651 return m_frameObserver->frame(); |
1660 } | 1652 } |
1661 | 1653 |
1662 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte
xt, v8::Isolate* isolate) | 1654 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte
xt, v8::Isolate* isolate) |
1663 { | 1655 { |
1664 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8]. | 1656 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8]. |
1665 return v8::Handle<v8::Object>(); | 1657 return v8::Handle<v8::Object>(); |
1666 } | 1658 } |
1667 | 1659 |
1668 } // namespace blink | 1660 } // namespace blink |
OLD | NEW |