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

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

Issue 2815803003: Make Pageshow event asynchronous in EventQueueScope (Closed)
Patch Set: Delete unnecessary change Created 3 years, 8 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 void LocalDOMWindow::DocumentWasClosed() { 417 void LocalDOMWindow::DocumentWasClosed() {
418 DispatchWindowLoadEvent(); 418 DispatchWindowLoadEvent();
419 EnqueuePageshowEvent(kPageshowEventNotPersisted); 419 EnqueuePageshowEvent(kPageshowEventNotPersisted);
420 if (pending_state_object_) 420 if (pending_state_object_)
421 EnqueuePopstateEvent(std::move(pending_state_object_)); 421 EnqueuePopstateEvent(std::move(pending_state_object_));
422 } 422 }
423 423
424 void LocalDOMWindow::EnqueuePageshowEvent(PageshowEventPersistence persisted) { 424 void LocalDOMWindow::EnqueuePageshowEvent(PageshowEventPersistence persisted) {
425 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=36334 Pageshow event needs 425 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=36334 Pageshow event needs
426 // to fire asynchronously. As per spec pageshow must be triggered 426 // to fire asynchronously. As per spec pageshow must be triggered
427 // asynchronously. However to be compatible with other browsers blink fires 427 // asynchronously. However to be compatible with other browsers blink fires
tkent 2017/04/13 01:26:16 Did you check behavior of latest versions of other
tkent 2017/04/13 06:19:14 We had offline discussion. It's too difficult to r
428 // pageshow synchronously. 428 // pageshow synchronously unless we are in EventQueueScope.
429 if (ScopedEventQueue::Instance()->ShouldQueueEvents() && document_) {
yosin_UTC9 2017/04/12 10:08:03 Nice finding. I've not known |(ScopedEventQueue::I
430 EnqueueWindowEvent(
431 PageTransitionEvent::Create(EventTypeNames::pageshow, persisted));
432 return;
433 }
429 DispatchEvent( 434 DispatchEvent(
430 PageTransitionEvent::Create(EventTypeNames::pageshow, persisted), 435 PageTransitionEvent::Create(EventTypeNames::pageshow, persisted),
431 document_.Get()); 436 document_.Get());
432 } 437 }
433 438
434 void LocalDOMWindow::EnqueueHashchangeEvent(const String& old_url, 439 void LocalDOMWindow::EnqueueHashchangeEvent(const String& old_url,
435 const String& new_url) { 440 const String& new_url) {
436 EnqueueWindowEvent(HashChangeEvent::Create(old_url, new_url)); 441 EnqueueWindowEvent(HashChangeEvent::Create(old_url, new_url));
437 } 442 }
438 443
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 DOMWindow::Trace(visitor); 1684 DOMWindow::Trace(visitor);
1680 Supplementable<LocalDOMWindow>::Trace(visitor); 1685 Supplementable<LocalDOMWindow>::Trace(visitor);
1681 } 1686 }
1682 1687
1683 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { 1688 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) {
1684 visitor->TraceWrappers(custom_elements_); 1689 visitor->TraceWrappers(custom_elements_);
1685 DOMWindow::TraceWrappers(visitor); 1690 DOMWindow::TraceWrappers(visitor);
1686 } 1691 }
1687 1692
1688 } // namespace blink 1693 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698