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

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: rebase 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
« no previous file with comments | « Source/core/frame/DOMWindow.h ('k') | Source/core/html/ime/InputMethodContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 // the DOM. 1602 // the DOM.
1603 FrameOwner* owner = m_frame ? m_frame->owner() : 0; 1603 FrameOwner* owner = m_frame ? m_frame->owner() : 0;
1604 if (owner) 1604 if (owner)
1605 owner->dispatchLoad(); 1605 owner->dispatchLoad();
1606 1606
1607 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "MarkLo ad", "data", InspectorMarkLoadEvent::data(frame())); 1607 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "MarkLo ad", "data", InspectorMarkLoadEvent::data(frame()));
1608 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing. 1608 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing.
1609 InspectorInstrumentation::loadEventFired(frame()); 1609 InspectorInstrumentation::loadEventFired(frame());
1610 } 1610 }
1611 1611
1612 bool DOMWindow::dispatchEvent(PassRefPtrWillBeRawPtr<Event> prpEvent, PassRefPtr <EventTarget> prpTarget) 1612 bool DOMWindow::dispatchEvent(PassRefPtrWillBeRawPtr<Event> prpEvent, PassRefPtr WillBeRawPtr<EventTarget> prpTarget)
1613 { 1613 {
1614 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); 1614 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
1615 1615
1616 RefPtr<EventTarget> protect = this; 1616 RefPtrWillBeRawPtr<EventTarget> protect(this);
1617 RefPtrWillBeRawPtr<Event> event = prpEvent; 1617 RefPtrWillBeRawPtr<Event> event = prpEvent;
1618 1618
1619 event->setTarget(prpTarget ? prpTarget : this); 1619 event->setTarget(prpTarget ? prpTarget : this);
1620 event->setCurrentTarget(this); 1620 event->setCurrentTarget(this);
1621 event->setEventPhase(Event::AT_TARGET); 1621 event->setEventPhase(Event::AT_TARGET);
1622 1622
1623 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "EventDispatch" , "type", event->type().ascii()); 1623 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "EventDispatch" , "type", event->type().ascii());
1624 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing. 1624 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing.
1625 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispat chEventOnWindow(frame(), *event, this); 1625 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispat chEventOnWindow(frame(), *event, this);
1626 1626
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1917 visitor->trace(m_sessionStorage); 1917 visitor->trace(m_sessionStorage);
1918 visitor->trace(m_localStorage); 1918 visitor->trace(m_localStorage);
1919 visitor->trace(m_applicationCache); 1919 visitor->trace(m_applicationCache);
1920 visitor->trace(m_performance); 1920 visitor->trace(m_performance);
1921 visitor->trace(m_css); 1921 visitor->trace(m_css);
1922 WillBeHeapSupplementable<DOMWindow>::trace(visitor); 1922 WillBeHeapSupplementable<DOMWindow>::trace(visitor);
1923 EventTargetWithInlineData::trace(visitor); 1923 EventTargetWithInlineData::trace(visitor);
1924 } 1924 }
1925 1925
1926 } // namespace WebCore 1926 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/DOMWindow.h ('k') | Source/core/html/ime/InputMethodContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698