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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp

Issue 2688473005: Replace Document::postTask with WebTaskRunner::postTask (Closed)
Patch Set: remove extra null-check: context on addConsoleMessage is now persistent Created 3 years, 10 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
OLDNEW
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 20 matching lines...) Expand all
31 #include "bindings/core/v8/WindowProxy.h" 31 #include "bindings/core/v8/WindowProxy.h"
32 #include "core/css/CSSComputedStyleDeclaration.h" 32 #include "core/css/CSSComputedStyleDeclaration.h"
33 #include "core/css/CSSRuleList.h" 33 #include "core/css/CSSRuleList.h"
34 #include "core/css/DOMWindowCSS.h" 34 #include "core/css/DOMWindowCSS.h"
35 #include "core/css/MediaQueryList.h" 35 #include "core/css/MediaQueryList.h"
36 #include "core/css/MediaQueryMatcher.h" 36 #include "core/css/MediaQueryMatcher.h"
37 #include "core/css/StyleMedia.h" 37 #include "core/css/StyleMedia.h"
38 #include "core/css/resolver/StyleResolver.h" 38 #include "core/css/resolver/StyleResolver.h"
39 #include "core/dom/DOMImplementation.h" 39 #include "core/dom/DOMImplementation.h"
40 #include "core/dom/DocumentUserGestureToken.h" 40 #include "core/dom/DocumentUserGestureToken.h"
41 #include "core/dom/ExecutionContextTask.h"
42 #include "core/dom/FrameRequestCallback.h" 41 #include "core/dom/FrameRequestCallback.h"
43 #include "core/dom/SandboxFlags.h" 42 #include "core/dom/SandboxFlags.h"
44 #include "core/dom/TaskRunnerHelper.h" 43 #include "core/dom/TaskRunnerHelper.h"
45 #include "core/dom/custom/CustomElementRegistry.h" 44 #include "core/dom/custom/CustomElementRegistry.h"
46 #include "core/editing/Editor.h" 45 #include "core/editing/Editor.h"
47 #include "core/events/DOMWindowEventQueue.h" 46 #include "core/events/DOMWindowEventQueue.h"
48 #include "core/events/HashChangeEvent.h" 47 #include "core/events/HashChangeEvent.h"
49 #include "core/events/MessageEvent.h" 48 #include "core/events/MessageEvent.h"
50 #include "core/events/PageTransitionEvent.h" 49 #include "core/events/PageTransitionEvent.h"
51 #include "core/events/PopStateEvent.h" 50 #include "core/events/PopStateEvent.h"
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 } 384 }
386 385
387 void LocalDOMWindow::dispatchWindowLoadEvent() { 386 void LocalDOMWindow::dispatchWindowLoadEvent() {
388 #if DCHECK_IS_ON() 387 #if DCHECK_IS_ON()
389 DCHECK(!EventDispatchForbiddenScope::isEventDispatchForbidden()); 388 DCHECK(!EventDispatchForbiddenScope::isEventDispatchForbidden());
390 #endif 389 #endif
391 // Delay 'load' event if we are in EventQueueScope. This is a short-term 390 // Delay 'load' event if we are in EventQueueScope. This is a short-term
392 // workaround to avoid Editing code crashes. We should always dispatch 391 // workaround to avoid Editing code crashes. We should always dispatch
393 // 'load' event asynchronously. crbug.com/569511. 392 // 'load' event asynchronously. crbug.com/569511.
394 if (ScopedEventQueue::instance()->shouldQueueEvents() && m_document) { 393 if (ScopedEventQueue::instance()->shouldQueueEvents() && m_document) {
395 m_document->postTask( 394 TaskRunnerHelper::get(TaskType::Networking, m_document)
396 TaskType::Networking, BLINK_FROM_HERE, 395 ->postTask(BLINK_FROM_HERE,
397 createSameThreadTask(&LocalDOMWindow::dispatchLoadEvent, 396 WTF::bind(&LocalDOMWindow::dispatchLoadEvent,
398 wrapPersistent(this))); 397 wrapPersistent(this)));
399 return; 398 return;
400 } 399 }
401 dispatchLoadEvent(); 400 dispatchLoadEvent();
402 } 401 }
403 402
404 void LocalDOMWindow::documentWasClosed() { 403 void LocalDOMWindow::documentWasClosed() {
405 dispatchWindowLoadEvent(); 404 dispatchWindowLoadEvent();
406 enqueuePageshowEvent(PageshowEventNotPersisted); 405 enqueuePageshowEvent(PageshowEventNotPersisted);
407 if (m_pendingStateObject) 406 if (m_pendingStateObject)
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1633 DOMWindow::trace(visitor); 1632 DOMWindow::trace(visitor);
1634 Supplementable<LocalDOMWindow>::trace(visitor); 1633 Supplementable<LocalDOMWindow>::trace(visitor);
1635 } 1634 }
1636 1635
1637 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { 1636 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) {
1638 visitor->traceWrappers(m_customElements); 1637 visitor->traceWrappers(m_customElements);
1639 DOMWindow::traceWrappers(visitor); 1638 DOMWindow::traceWrappers(visitor);
1640 } 1639 }
1641 1640
1642 } // namespace blink 1641 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/html/HTMLInputElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698