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

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

Issue 2513893002: Make ifdefs consistent in WebKit/Source/core/ (Closed)
Patch Set: Created 4 years, 1 month 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 } 369 }
370 370
371 void LocalDOMWindow::enqueueDocumentEvent(Event* event) { 371 void LocalDOMWindow::enqueueDocumentEvent(Event* event) {
372 if (!m_eventQueue) 372 if (!m_eventQueue)
373 return; 373 return;
374 event->setTarget(m_document.get()); 374 event->setTarget(m_document.get());
375 m_eventQueue->enqueueEvent(event); 375 m_eventQueue->enqueueEvent(event);
376 } 376 }
377 377
378 void LocalDOMWindow::dispatchWindowLoadEvent() { 378 void LocalDOMWindow::dispatchWindowLoadEvent() {
379 #if DCHECK_IS_ON()
379 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); 380 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden());
mstensho (USE GERRIT) 2016/11/18 08:45:54 Just use DCHECK() instead?
Alexander Alekseev 2016/11/18 22:32:14 Done.
381 #endif
380 // Delay 'load' event if we are in EventQueueScope. This is a short-term 382 // Delay 'load' event if we are in EventQueueScope. This is a short-term
381 // workaround to avoid Editing code crashes. We should always dispatch 383 // workaround to avoid Editing code crashes. We should always dispatch
382 // 'load' event asynchronously. crbug.com/569511. 384 // 'load' event asynchronously. crbug.com/569511.
383 if (ScopedEventQueue::instance()->shouldQueueEvents() && m_document) { 385 if (ScopedEventQueue::instance()->shouldQueueEvents() && m_document) {
384 m_document->postTask( 386 m_document->postTask(
385 BLINK_FROM_HERE, 387 BLINK_FROM_HERE,
386 createSameThreadTask(&LocalDOMWindow::dispatchLoadEvent, 388 createSameThreadTask(&LocalDOMWindow::dispatchLoadEvent,
387 wrapPersistent(this))); 389 wrapPersistent(this)));
388 return; 390 return;
389 } 391 }
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 owner->dispatchLoad(); 1414 owner->dispatchLoad();
1413 1415
1414 TRACE_EVENT_INSTANT1("devtools.timeline", "MarkLoad", 1416 TRACE_EVENT_INSTANT1("devtools.timeline", "MarkLoad",
1415 TRACE_EVENT_SCOPE_THREAD, "data", 1417 TRACE_EVENT_SCOPE_THREAD, "data",
1416 InspectorMarkLoadEvent::data(frame())); 1418 InspectorMarkLoadEvent::data(frame()));
1417 InspectorInstrumentation::loadEventFired(frame()); 1419 InspectorInstrumentation::loadEventFired(frame());
1418 } 1420 }
1419 1421
1420 DispatchEventResult LocalDOMWindow::dispatchEvent(Event* event, 1422 DispatchEventResult LocalDOMWindow::dispatchEvent(Event* event,
1421 EventTarget* target) { 1423 EventTarget* target) {
1424 #if DCHECK_IS_ON()
1422 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); 1425 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden());
1426 #endif
1423 1427
1424 event->setTrusted(true); 1428 event->setTrusted(true);
1425 event->setTarget(target ? target : this); 1429 event->setTarget(target ? target : this);
1426 event->setCurrentTarget(this); 1430 event->setCurrentTarget(this);
1427 event->setEventPhase(Event::kAtTarget); 1431 event->setEventPhase(Event::kAtTarget);
1428 1432
1429 TRACE_EVENT1("devtools.timeline", "EventDispatch", "data", 1433 TRACE_EVENT1("devtools.timeline", "EventDispatch", "data",
1430 InspectorEventDispatchEvent::data(*event)); 1434 InspectorEventDispatchEvent::data(*event));
1431 return fireEventListeners(event); 1435 return fireEventListeners(event);
1432 } 1436 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1554 1558
1555 LocalFrame* LocalDOMWindow::frame() const { 1559 LocalFrame* LocalDOMWindow::frame() const {
1556 // If the LocalDOMWindow still has a frame reference, that frame must point 1560 // If the LocalDOMWindow still has a frame reference, that frame must point
1557 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation 1561 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation
1558 // where script execution leaks between different LocalDOMWindows. 1562 // where script execution leaks between different LocalDOMWindows.
1559 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this); 1563 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this);
1560 return m_frame; 1564 return m_frame;
1561 } 1565 }
1562 1566
1563 } // namespace blink 1567 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | third_party/WebKit/Source/platform/Timer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698