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

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

Issue 1916283003: [K6] Replace bind() + GCed pointers with retainedRef() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_5c
Patch Set: Rebase Created 4 years, 7 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 m_eventQueue->enqueueEvent(event); 387 m_eventQueue->enqueueEvent(event);
388 } 388 }
389 389
390 void LocalDOMWindow::dispatchWindowLoadEvent() 390 void LocalDOMWindow::dispatchWindowLoadEvent()
391 { 391 {
392 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); 392 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden());
393 // Delay 'load' event if we are in EventQueueScope. This is a short-term 393 // Delay 'load' event if we are in EventQueueScope. This is a short-term
394 // workaround to avoid Editing code crashes. We should always dispatch 394 // workaround to avoid Editing code crashes. We should always dispatch
395 // 'load' event asynchronously. crbug.com/569511. 395 // 'load' event asynchronously. crbug.com/569511.
396 if (ScopedEventQueue::instance()->shouldQueueEvents() && m_document) { 396 if (ScopedEventQueue::instance()->shouldQueueEvents() && m_document) {
397 m_document->postTask(BLINK_FROM_HERE, createSameThreadTask(&LocalDOMWind ow::dispatchLoadEvent, this)); 397 m_document->postTask(BLINK_FROM_HERE, createSameThreadTask(&LocalDOMWind ow::dispatchLoadEvent, retainedRef(this)));
398 return; 398 return;
399 } 399 }
400 dispatchLoadEvent(); 400 dispatchLoadEvent();
401 } 401 }
402 402
403 void LocalDOMWindow::documentWasClosed() 403 void LocalDOMWindow::documentWasClosed()
404 { 404 {
405 dispatchWindowLoadEvent(); 405 dispatchWindowLoadEvent();
406 enqueuePageshowEvent(PageshowEventNotPersisted); 406 enqueuePageshowEvent(PageshowEventNotPersisted);
407 if (m_pendingStateObject) 407 if (m_pendingStateObject)
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 { 1497 {
1498 // If the LocalDOMWindow still has a frame reference, that frame must point 1498 // If the LocalDOMWindow still has a frame reference, that frame must point
1499 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation 1499 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation
1500 // where script execution leaks between different LocalDOMWindows. 1500 // where script execution leaks between different LocalDOMWindows.
1501 if (m_frameObserver->frame()) 1501 if (m_frameObserver->frame())
1502 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this); 1502 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this);
1503 return m_frameObserver->frame(); 1503 return m_frameObserver->frame();
1504 } 1504 }
1505 1505
1506 } // namespace blink 1506 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fileapi/FileReader.cpp ('k') | third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698