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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 return settings && settings->getJavaScriptCanOpenWindowsAutomatically(); | 267 return settings && settings->getJavaScriptCanOpenWindowsAutomatically(); |
268 } | 268 } |
269 | 269 |
270 bool LocalDOMWindow::allowPopUp() { | 270 bool LocalDOMWindow::allowPopUp() { |
271 return frame() && allowPopUp(*frame()); | 271 return frame() && allowPopUp(*frame()); |
272 } | 272 } |
273 | 273 |
274 LocalDOMWindow::LocalDOMWindow(LocalFrame& frame) | 274 LocalDOMWindow::LocalDOMWindow(LocalFrame& frame) |
275 : m_frame(&frame), | 275 : m_frame(&frame), |
276 m_visualViewport(DOMVisualViewport::create(this)), | 276 m_visualViewport(DOMVisualViewport::create(this)), |
277 m_unusedPreloadsTimer(this, &LocalDOMWindow::warnUnusedPreloads), | 277 m_unusedPreloadsTimer( |
| 278 TaskRunnerHelper::get(TaskType::UnspecedTimer, &frame), |
| 279 this, |
| 280 &LocalDOMWindow::warnUnusedPreloads), |
278 m_shouldPrintWhenFinishedLoading(false), | 281 m_shouldPrintWhenFinishedLoading(false), |
279 m_customElements(this, nullptr) {} | 282 m_customElements(this, nullptr) {} |
280 | 283 |
281 void LocalDOMWindow::clearDocument() { | 284 void LocalDOMWindow::clearDocument() { |
282 if (!m_document) | 285 if (!m_document) |
283 return; | 286 return; |
284 | 287 |
285 ASSERT(!m_document->isActive()); | 288 ASSERT(!m_document->isActive()); |
286 | 289 |
287 // FIXME: This should be part of SuspendableObject shutdown | 290 // FIXME: This should be part of SuspendableObject shutdown |
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1634 | 1637 |
1635 LocalFrame* LocalDOMWindow::frame() const { | 1638 LocalFrame* LocalDOMWindow::frame() const { |
1636 // If the LocalDOMWindow still has a frame reference, that frame must point | 1639 // If the LocalDOMWindow still has a frame reference, that frame must point |
1637 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation | 1640 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation |
1638 // where script execution leaks between different LocalDOMWindows. | 1641 // where script execution leaks between different LocalDOMWindows. |
1639 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this); | 1642 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this); |
1640 return m_frame; | 1643 return m_frame; |
1641 } | 1644 } |
1642 | 1645 |
1643 } // namespace blink | 1646 } // namespace blink |
OLD | NEW |