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

Side by Side Diff: Source/core/frame/DOMWindow.cpp

Issue 316443004: Oilpan: Remove ref counting from EventTarget and all uses of Pass/RefPtr<EventTarget>. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: dbl trace Created 6 years, 6 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 | Annotate | Revision Log
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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 if (!m_eventQueue) 435 if (!m_eventQueue)
436 return; 436 return;
437 event->setTarget(this); 437 event->setTarget(this);
438 m_eventQueue->enqueueEvent(event); 438 m_eventQueue->enqueueEvent(event);
439 } 439 }
440 440
441 void DOMWindow::enqueueDocumentEvent(PassRefPtrWillBeRawPtr<Event> event) 441 void DOMWindow::enqueueDocumentEvent(PassRefPtrWillBeRawPtr<Event> event)
442 { 442 {
443 if (!m_eventQueue) 443 if (!m_eventQueue)
444 return; 444 return;
445 event->setTarget(m_document); 445 event->setTarget(m_document.get());
446 m_eventQueue->enqueueEvent(event); 446 m_eventQueue->enqueueEvent(event);
447 } 447 }
448 448
449 void DOMWindow::dispatchWindowLoadEvent() 449 void DOMWindow::dispatchWindowLoadEvent()
450 { 450 {
451 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); 451 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
452 dispatchLoadEvent(); 452 dispatchLoadEvent();
453 } 453 }
454 454
455 void DOMWindow::documentWasClosed() 455 void DOMWindow::documentWasClosed()
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1600 // the DOM. 1600 // the DOM.
1601 Element* ownerElement = m_frame ? m_frame->ownerElement() : 0; 1601 Element* ownerElement = m_frame ? m_frame->ownerElement() : 0;
1602 if (ownerElement) 1602 if (ownerElement)
1603 ownerElement->dispatchEvent(Event::create(EventTypeNames::load)); 1603 ownerElement->dispatchEvent(Event::create(EventTypeNames::load));
1604 1604
1605 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "MarkLo ad", "data", InspectorMarkLoadEvent::data(frame())); 1605 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "MarkLo ad", "data", InspectorMarkLoadEvent::data(frame()));
1606 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing. 1606 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing.
1607 InspectorInstrumentation::loadEventFired(frame()); 1607 InspectorInstrumentation::loadEventFired(frame());
1608 } 1608 }
1609 1609
1610 bool DOMWindow::dispatchEvent(PassRefPtrWillBeRawPtr<Event> prpEvent, PassRefPtr <EventTarget> prpTarget) 1610 bool DOMWindow::dispatchEvent(PassRefPtrWillBeRawPtr<Event> prpEvent, PassRefPtr WillBeRawPtr<EventTarget> prpTarget)
1611 { 1611 {
1612 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); 1612 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
1613 1613
1614 RefPtr<EventTarget> protect = this; 1614 RefPtrWillBeRawPtr<EventTarget> protect(this);
1615 RefPtrWillBeRawPtr<Event> event = prpEvent; 1615 RefPtrWillBeRawPtr<Event> event = prpEvent;
1616 1616
1617 event->setTarget(prpTarget ? prpTarget : this); 1617 event->setTarget(prpTarget ? prpTarget : this);
1618 event->setCurrentTarget(this); 1618 event->setCurrentTarget(this);
1619 event->setEventPhase(Event::AT_TARGET); 1619 event->setEventPhase(Event::AT_TARGET);
1620 1620
1621 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "EventDispatch" , "type", event->type().ascii()); 1621 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "EventDispatch" , "type", event->type().ascii());
1622 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing. 1622 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing.
1623 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispat chEventOnWindow(frame(), *event, this); 1623 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispat chEventOnWindow(frame(), *event, this);
1624 1624
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1915 visitor->trace(m_sessionStorage); 1915 visitor->trace(m_sessionStorage);
1916 visitor->trace(m_localStorage); 1916 visitor->trace(m_localStorage);
1917 visitor->trace(m_applicationCache); 1917 visitor->trace(m_applicationCache);
1918 visitor->trace(m_performance); 1918 visitor->trace(m_performance);
1919 visitor->trace(m_css); 1919 visitor->trace(m_css);
1920 WillBeHeapSupplementable<DOMWindow>::trace(visitor); 1920 WillBeHeapSupplementable<DOMWindow>::trace(visitor);
1921 EventTargetWithInlineData::trace(visitor); 1921 EventTargetWithInlineData::trace(visitor);
1922 } 1922 }
1923 1923
1924 } // namespace WebCore 1924 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698