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

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

Issue 2513893002: Make ifdefs consistent in WebKit/Source/core/ (Closed)
Patch Set: Fix build. Update after review. 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 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); 379 DCHECK(!EventDispatchForbiddenScope::isEventDispatchForbidden());
Alexander Alekseev 2016/11/18 22:32:15 isEventDispatchForbidden() is defined only if DCHE
380 // Delay 'load' event if we are in EventQueueScope. This is a short-term 380 // Delay 'load' event if we are in EventQueueScope. This is a short-term
381 // workaround to avoid Editing code crashes. We should always dispatch 381 // workaround to avoid Editing code crashes. We should always dispatch
382 // 'load' event asynchronously. crbug.com/569511. 382 // 'load' event asynchronously. crbug.com/569511.
383 if (ScopedEventQueue::instance()->shouldQueueEvents() && m_document) { 383 if (ScopedEventQueue::instance()->shouldQueueEvents() && m_document) {
384 m_document->postTask( 384 m_document->postTask(
385 BLINK_FROM_HERE, 385 BLINK_FROM_HERE,
386 createSameThreadTask(&LocalDOMWindow::dispatchLoadEvent, 386 createSameThreadTask(&LocalDOMWindow::dispatchLoadEvent,
387 wrapPersistent(this))); 387 wrapPersistent(this)));
388 return; 388 return;
389 } 389 }
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 owner->dispatchLoad(); 1412 owner->dispatchLoad();
1413 1413
1414 TRACE_EVENT_INSTANT1("devtools.timeline", "MarkLoad", 1414 TRACE_EVENT_INSTANT1("devtools.timeline", "MarkLoad",
1415 TRACE_EVENT_SCOPE_THREAD, "data", 1415 TRACE_EVENT_SCOPE_THREAD, "data",
1416 InspectorMarkLoadEvent::data(frame())); 1416 InspectorMarkLoadEvent::data(frame()));
1417 InspectorInstrumentation::loadEventFired(frame()); 1417 InspectorInstrumentation::loadEventFired(frame());
1418 } 1418 }
1419 1419
1420 DispatchEventResult LocalDOMWindow::dispatchEvent(Event* event, 1420 DispatchEventResult LocalDOMWindow::dispatchEvent(Event* event,
1421 EventTarget* target) { 1421 EventTarget* target) {
1422 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); 1422 DCHECK(!EventDispatchForbiddenScope::isEventDispatchForbidden());
1423 1423
1424 event->setTrusted(true); 1424 event->setTrusted(true);
1425 event->setTarget(target ? target : this); 1425 event->setTarget(target ? target : this);
1426 event->setCurrentTarget(this); 1426 event->setCurrentTarget(this);
1427 event->setEventPhase(Event::kAtTarget); 1427 event->setEventPhase(Event::kAtTarget);
1428 1428
1429 TRACE_EVENT1("devtools.timeline", "EventDispatch", "data", 1429 TRACE_EVENT1("devtools.timeline", "EventDispatch", "data",
1430 InspectorEventDispatchEvent::data(*event)); 1430 InspectorEventDispatchEvent::data(*event));
1431 return fireEventListeners(event); 1431 return fireEventListeners(event);
1432 } 1432 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1554 1554
1555 LocalFrame* LocalDOMWindow::frame() const { 1555 LocalFrame* LocalDOMWindow::frame() const {
1556 // If the LocalDOMWindow still has a frame reference, that frame must point 1556 // 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 1557 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation
1558 // where script execution leaks between different LocalDOMWindows. 1558 // where script execution leaks between different LocalDOMWindows.
1559 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this); 1559 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this);
1560 return m_frame; 1560 return m_frame;
1561 } 1561 }
1562 1562
1563 } // namespace blink 1563 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698