diff options
author | haraken@chromium.org <haraken@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2014-04-03 12:05:04 +0000 |
---|---|---|
committer | haraken@chromium.org <haraken@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2014-04-03 12:05:04 +0000 |
commit | c7a1cf6da51680df07cc2bf9a728c723260295e0 (patch) | |
tree | 199fad0c63db6c0ab9e970910c803c3a1285723f | |
parent | 1bf7d74887fba1e0b6cd79dca424bf759a3abef4 (diff) | |
download | chromium_src-c7a1cf6da51680df07cc2bf9a728c723260295e0.zip chromium_src-c7a1cf6da51680df07cc2bf9a728c723260295e0.tar.gz chromium_src-c7a1cf6da51680df07cc2bf9a728c723260295e0.tar.bz2 |
Oilpan: Replace most of RefPtrs of Event objects with oilpan's transition types
- Basically, this CL does the following three things:
(1) Replace PassRefPtr<xxxEvent> with PassRefPtrWillBeRawPtr<xxxEvent>.
(2) Replace RefPtr<xxxEvent> in on-heap objects with RefPtrWillBeMember<xxxEvent>.
(3) Replace RefPtr<xxxEvent> in off-heap objects with RefPtrWillBePersistent<xxxEvent>.
- This CL is not replacing any raw pointers with Members/Persistents, so it won't produce new memory leaks.
- This CL uses ListHashSet<Persistent<Event>> for DOMWindowEventQueue::m_queuedEvents, because HeapListHashSet is not yet implemented.
- This CL uses Deque<Persistent<Event>> for WebSocket::m_events, because HeapDeque is not yet implemented.
- In follow-up CLs, I will move more Event related objects to the heap and reduce Persistent handles introduced in this CL.
BUG=340522
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170733
Review URL: https://codereview.chromium.org/216523002
git-svn-id: svn://svn.chromium.org/blink/trunk@170769 bbb929c8-8fbe-4397-9dbb-9b2b20218538
129 files changed, 324 insertions, 284 deletions
diff --git a/third_party/WebKit/Source/bindings/v8/V8Initializer.cpp b/third_party/WebKit/Source/bindings/v8/V8Initializer.cpp index 1cd0262..b0f4dba 100644 --- a/third_party/WebKit/Source/bindings/v8/V8Initializer.cpp +++ b/third_party/WebKit/Source/bindings/v8/V8Initializer.cpp @@ -112,7 +112,7 @@ static void messageHandlerInMainThread(v8::Handle<v8::Message> message, v8::Hand AccessControlStatus corsStatus = message->IsSharedCrossOrigin() ? SharableCrossOrigin : NotSharableCrossOrigin; DOMWrapperWorld& world = DOMWrapperWorld::current(isolate); - RefPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, resource, message->GetLineNumber(), message->GetStartColumn() + 1, &world); + RefPtrWillBeRawPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, resource, message->GetLineNumber(), message->GetStartColumn() + 1, &world); if (V8DOMWrapper::isDOMWrapper(data)) { v8::Handle<v8::Object> obj = v8::Handle<v8::Object>::Cast(data); const WrapperTypeInfo* type = toWrapperTypeInfo(obj); @@ -219,7 +219,7 @@ static void messageHandlerInWorker(v8::Handle<v8::Message> message, v8::Handle<v String errorMessage = toCoreString(message->Get()); V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, sourceURL, message->GetScriptResourceName()); - RefPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, sourceURL, message->GetLineNumber(), message->GetStartColumn() + 1, &DOMWrapperWorld::current(isolate)); + RefPtrWillBeRawPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, sourceURL, message->GetLineNumber(), message->GetStartColumn() + 1, &DOMWrapperWorld::current(isolate)); AccessControlStatus corsStatus = message->IsSharedCrossOrigin() ? SharableCrossOrigin : NotSharableCrossOrigin; V8ErrorHandler::storeExceptionOnErrorEventWrapper(event.get(), data, isolate); diff --git a/third_party/WebKit/Source/bindings/v8/WorkerScriptController.cpp b/third_party/WebKit/Source/bindings/v8/WorkerScriptController.cpp index 537edf8..834484e3 100644 --- a/third_party/WebKit/Source/bindings/v8/WorkerScriptController.cpp +++ b/third_party/WebKit/Source/bindings/v8/WorkerScriptController.cpp @@ -197,7 +197,7 @@ ScriptValue WorkerScriptController::evaluate(const String& script, const String& return ScriptValue(result, m_isolate); } -void WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode, RefPtr<ErrorEvent>* errorEvent) +void WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode, RefPtrWillBeRawPtr<ErrorEvent>* errorEvent) { if (isExecutionForbidden()) return; @@ -211,7 +211,12 @@ void WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode, RefPtr V8ErrorHandler::storeExceptionOnErrorEventWrapper(errorEvent->get(), state.exception.v8Value(), m_isolate); } else { ASSERT(!m_workerGlobalScope.shouldSanitizeScriptError(state.sourceURL, NotSharableCrossOrigin)); - RefPtr<ErrorEvent> event = m_errorEventFromImportedScript ? m_errorEventFromImportedScript.release() : ErrorEvent::create(state.errorMessage, state.sourceURL, state.lineNumber, state.columnNumber, m_world.get()); + RefPtrWillBeRawPtr<ErrorEvent> event = nullptr; + if (m_errorEventFromImportedScript) { + event = m_errorEventFromImportedScript.release(); + } else { + event = ErrorEvent::create(state.errorMessage, state.sourceURL, state.lineNumber, state.columnNumber, m_world.get()); + } m_workerGlobalScope.reportException(event, nullptr, NotSharableCrossOrigin); } } @@ -253,7 +258,7 @@ void WorkerScriptController::disableEval(const String& errorMessage) m_disableEvalPending = errorMessage; } -void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtr<ErrorEvent> errorEvent) +void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtrWillBeRawPtr<ErrorEvent> errorEvent) { m_errorEventFromImportedScript = errorEvent; throwError(V8ThrowException::createError(v8GeneralError, m_errorEventFromImportedScript->message(), m_isolate), m_isolate); diff --git a/third_party/WebKit/Source/bindings/v8/WorkerScriptController.h b/third_party/WebKit/Source/bindings/v8/WorkerScriptController.h index 23ea6d5..40b03df 100644 --- a/third_party/WebKit/Source/bindings/v8/WorkerScriptController.h +++ b/third_party/WebKit/Source/bindings/v8/WorkerScriptController.h @@ -68,9 +68,9 @@ namespace WebCore { WorkerGlobalScope& workerGlobalScope() { return m_workerGlobalScope; } - void evaluate(const ScriptSourceCode&, RefPtr<ErrorEvent>* = 0); + void evaluate(const ScriptSourceCode&, RefPtrWillBeRawPtr<ErrorEvent>* = 0); - void rethrowExceptionFromImportedScript(PassRefPtr<ErrorEvent>); + void rethrowExceptionFromImportedScript(PassRefPtrWillBeRawPtr<ErrorEvent>); // Async request to terminate a future JS execution. Eventually causes termination // exception raised during JS execution, if the worker thread happens to run JS. @@ -111,7 +111,7 @@ namespace WebCore { bool m_executionForbidden; bool m_executionScheduledToTerminate; mutable Mutex m_scheduledTerminationMutex; - RefPtr<ErrorEvent> m_errorEventFromImportedScript; + RefPtrWillBePersistent<ErrorEvent> m_errorEventFromImportedScript; OwnPtr<V8IsolateInterruptor> m_interruptor; }; diff --git a/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp b/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp index 734aeb8..52ad82f 100644 --- a/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp +++ b/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp @@ -646,7 +646,7 @@ void CSSAnimations::calculateTransitionActiveInterpolations(CSSAnimationUpdate* void CSSAnimations::AnimationEventDelegate::maybeDispatch(Document::ListenerType listenerType, const AtomicString& eventName, double elapsedTime) { if (m_target->document().hasListenerType(listenerType)) { - RefPtr<WebKitAnimationEvent> event = WebKitAnimationEvent::create(eventName, m_name, elapsedTime); + RefPtrWillBeRawPtr<WebKitAnimationEvent> event = WebKitAnimationEvent::create(eventName, m_name, elapsedTime); event->setTarget(m_target); m_target->document().enqueueAnimationFrameEvent(event); } @@ -690,7 +690,7 @@ void CSSAnimations::TransitionEventDelegate::onEventCondition(const TimedItem* t double elapsedTime = timing.iterationDuration; const AtomicString& eventType = EventTypeNames::transitionend; String pseudoElement = PseudoElement::pseudoElementNameForEvents(m_target->pseudoId()); - RefPtr<TransitionEvent> event = TransitionEvent::create(eventType, propertyName, elapsedTime, pseudoElement); + RefPtrWillBeRawPtr<TransitionEvent> event = TransitionEvent::create(eventType, propertyName, elapsedTime, pseudoElement); event->setTarget(m_target); m_target->document().enqueueAnimationFrameEvent(event); } diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceLoadEvent.h b/third_party/WebKit/Source/core/css/CSSFontFaceLoadEvent.h index 41ad457..755977e 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFaceLoadEvent.h +++ b/third_party/WebKit/Source/core/css/CSSFontFaceLoadEvent.h @@ -55,7 +55,7 @@ public: return adoptRefWillBeRefCountedGarbageCollected(new CSSFontFaceLoadEvent(type, initializer)); } - static PassRefPtr<CSSFontFaceLoadEvent> createForFontFaces(const AtomicString& type, const FontFaceArray& fontfaces = FontFaceArray()) + static PassRefPtrWillBeRawPtr<CSSFontFaceLoadEvent> createForFontFaces(const AtomicString& type, const FontFaceArray& fontfaces = FontFaceArray()) { return adoptRefWillBeRefCountedGarbageCollected(new CSSFontFaceLoadEvent(type, fontfaces)); } diff --git a/third_party/WebKit/Source/core/css/FontFaceSet.cpp b/third_party/WebKit/Source/core/css/FontFaceSet.cpp index f147f91..975dfcc 100644 --- a/third_party/WebKit/Source/core/css/FontFaceSet.cpp +++ b/third_party/WebKit/Source/core/css/FontFaceSet.cpp @@ -407,8 +407,8 @@ void FontFaceSet::fireDoneEventIfPossible() return; if (hasLoadedFonts()) { - RefPtr<CSSFontFaceLoadEvent> doneEvent; - RefPtr<CSSFontFaceLoadEvent> errorEvent; + RefPtrWillBeRawPtr<CSSFontFaceLoadEvent> doneEvent = nullptr; + RefPtrWillBeRawPtr<CSSFontFaceLoadEvent> errorEvent = nullptr; doneEvent = CSSFontFaceLoadEvent::createForFontFaces(EventTypeNames::loadingdone, m_loadedFonts); m_loadedFonts.clear(); if (!m_failedFonts.isEmpty()) { diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index 7289c58..9bf2eb2 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp @@ -2541,7 +2541,7 @@ bool Document::dispatchBeforeUnloadEvent(Chrome& chrome, bool& didAllowNavigatio RefPtr<Document> protect(this); - RefPtr<BeforeUnloadEvent> beforeUnloadEvent = BeforeUnloadEvent::create(); + RefPtrWillBeRawPtr<BeforeUnloadEvent> beforeUnloadEvent = BeforeUnloadEvent::create(); m_loadEventProgress = BeforeUnloadEventInProgress; m_domWindow->dispatchEvent(beforeUnloadEvent.get(), this); m_loadEventProgress = BeforeUnloadEventCompleted; @@ -2585,7 +2585,7 @@ void Document::dispatchUnloadEvents() // time into freed memory. RefPtr<DocumentLoader> documentLoader = m_frame->loader().provisionalDocumentLoader(); m_loadEventProgress = UnloadEventInProgress; - RefPtr<Event> unloadEvent(Event::create(EventTypeNames::unload)); + RefPtrWillBeRawPtr<Event> unloadEvent(Event::create(EventTypeNames::unload)); if (documentLoader && !documentLoader->timing()->unloadEventStart() && !documentLoader->timing()->unloadEventEnd()) { DocumentLoadTiming* timing = documentLoader->timing(); ASSERT(timing->navigationStart()); @@ -3756,7 +3756,7 @@ EventQueue* Document::eventQueue() const return m_domWindow->eventQueue(); } -void Document::enqueueAnimationFrameEvent(PassRefPtr<Event> event) +void Document::enqueueAnimationFrameEvent(PassRefPtrWillBeRawPtr<Event> event) { ensureScriptedAnimationController().enqueueEvent(event); } @@ -3764,14 +3764,14 @@ void Document::enqueueAnimationFrameEvent(PassRefPtr<Event> event) void Document::enqueueScrollEventForNode(Node* target) { // Per the W3C CSSOM View Module only scroll events fired at the document should bubble. - RefPtr<Event> scrollEvent = target->isDocumentNode() ? Event::createBubble(EventTypeNames::scroll) : Event::create(EventTypeNames::scroll); + RefPtrWillBeRawPtr<Event> scrollEvent = target->isDocumentNode() ? Event::createBubble(EventTypeNames::scroll) : Event::create(EventTypeNames::scroll); scrollEvent->setTarget(target); ensureScriptedAnimationController().enqueuePerFrameEvent(scrollEvent.release()); } void Document::enqueueResizeEvent() { - RefPtr<Event> event = Event::create(EventTypeNames::resize); + RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::resize); event->setTarget(domWindow()); ensureScriptedAnimationController().enqueuePerFrameEvent(event.release()); } diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h index 4565f2c..5174e20 100644 --- a/third_party/WebKit/Source/core/dom/Document.h +++ b/third_party/WebKit/Source/core/dom/Document.h @@ -926,7 +926,7 @@ public: void enqueueResizeEvent(); void enqueueScrollEventForNode(Node*); - void enqueueAnimationFrameEvent(PassRefPtr<Event>); + void enqueueAnimationFrameEvent(PassRefPtrWillBeRawPtr<Event>); bool hasFullscreenElementStack() const { return m_hasFullscreenElementStack; } void setHasFullscreenElementStack() { m_hasFullscreenElementStack = true; } diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp index 2e5e190..5e25313 100644 --- a/third_party/WebKit/Source/core/dom/Element.cpp +++ b/third_party/WebKit/Source/core/dom/Element.cpp @@ -2209,13 +2209,13 @@ bool Element::isMouseFocusable() const void Element::dispatchFocusEvent(Element* oldFocusedElement, FocusType) { - RefPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::focus, false, false, document().domWindow(), 0, oldFocusedElement); + RefPtrWillBeRawPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::focus, false, false, document().domWindow(), 0, oldFocusedElement); EventDispatcher::dispatchEvent(this, FocusEventDispatchMediator::create(event.release())); } void Element::dispatchBlurEvent(Element* newFocusedElement) { - RefPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::blur, false, false, document().domWindow(), 0, newFocusedElement); + RefPtrWillBeRawPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::blur, false, false, document().domWindow(), 0, newFocusedElement); EventDispatcher::dispatchEvent(this, BlurEventDispatchMediator::create(event.release())); } diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp index a0b8914..26f8f98 100644 --- a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp +++ b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp @@ -128,9 +128,9 @@ bool ExecutionContext::shouldSanitizeScriptError(const String& sourceURL, Access return !(securityOrigin()->canRequest(completeURL(sourceURL)) || corsStatus == SharableCrossOrigin); } -void ExecutionContext::reportException(PassRefPtr<ErrorEvent> event, PassRefPtr<ScriptCallStack> callStack, AccessControlStatus corsStatus) +void ExecutionContext::reportException(PassRefPtrWillBeRawPtr<ErrorEvent> event, PassRefPtr<ScriptCallStack> callStack, AccessControlStatus corsStatus) { - RefPtr<ErrorEvent> errorEvent = event; + RefPtrWillBeRawPtr<ErrorEvent> errorEvent = event; if (m_inDispatchErrorEvent) { if (!m_pendingExceptions) m_pendingExceptions = adoptPtr(new Vector<OwnPtr<PendingException> >()); @@ -167,7 +167,7 @@ void ExecutionContext::addConsoleMessage(MessageSource source, MessageLevel leve m_client->addMessage(source, level, message, String(), 0, state); } -bool ExecutionContext::dispatchErrorEvent(PassRefPtr<ErrorEvent> event, AccessControlStatus corsStatus) +bool ExecutionContext::dispatchErrorEvent(PassRefPtrWillBeRawPtr<ErrorEvent> event, AccessControlStatus corsStatus) { if (!m_client) return false; @@ -175,7 +175,7 @@ bool ExecutionContext::dispatchErrorEvent(PassRefPtr<ErrorEvent> event, AccessCo if (!target) return false; - RefPtr<ErrorEvent> errorEvent = event; + RefPtrWillBeRawPtr<ErrorEvent> errorEvent = event; if (shouldSanitizeScriptError(errorEvent->filename(), corsStatus)) errorEvent = ErrorEvent::createSanitizedError(errorEvent->world()); diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.h b/third_party/WebKit/Source/core/dom/ExecutionContext.h index 9cc3926..39a5bc3 100644 --- a/third_party/WebKit/Source/core/dom/ExecutionContext.h +++ b/third_party/WebKit/Source/core/dom/ExecutionContext.h @@ -82,7 +82,7 @@ public: double timerAlignmentInterval() const; bool shouldSanitizeScriptError(const String& sourceURL, AccessControlStatus); - void reportException(PassRefPtr<ErrorEvent>, PassRefPtr<ScriptCallStack>, AccessControlStatus); + void reportException(PassRefPtrWillBeRawPtr<ErrorEvent>, PassRefPtr<ScriptCallStack>, AccessControlStatus); void addConsoleMessage(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber); void addConsoleMessage(MessageSource, MessageLevel, const String& message, ScriptState* = 0); @@ -131,7 +131,7 @@ protected: private: friend class DOMTimer; // For installNewTimeout() and removeTimeoutByID() below. - bool dispatchErrorEvent(PassRefPtr<ErrorEvent>, AccessControlStatus); + bool dispatchErrorEvent(PassRefPtrWillBeRawPtr<ErrorEvent>, AccessControlStatus); virtual void refExecutionContext() = 0; virtual void derefExecutionContext() = 0; diff --git a/third_party/WebKit/Source/core/dom/MainThreadTaskRunnerTest.cpp b/third_party/WebKit/Source/core/dom/MainThreadTaskRunnerTest.cpp index ca17799..67a445d 100644 --- a/third_party/WebKit/Source/core/dom/MainThreadTaskRunnerTest.cpp +++ b/third_party/WebKit/Source/core/dom/MainThreadTaskRunnerTest.cpp @@ -42,7 +42,7 @@ class NullEventQueue : public EventQueue { public: NullEventQueue() { } virtual ~NullEventQueue() { } - virtual bool enqueueEvent(PassRefPtr<Event>) OVERRIDE { return true; } + virtual bool enqueueEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE { return true; } virtual bool cancelEvent(Event*) OVERRIDE { return true; } virtual void close() OVERRIDE { } }; diff --git a/third_party/WebKit/Source/core/dom/MessagePort.cpp b/third_party/WebKit/Source/core/dom/MessagePort.cpp index 0cb6ed60..4ecd86d 100644 --- a/third_party/WebKit/Source/core/dom/MessagePort.cpp +++ b/third_party/WebKit/Source/core/dom/MessagePort.cpp @@ -197,7 +197,7 @@ void MessagePort::dispatchMessages() return; OwnPtr<MessagePortArray> ports = MessagePort::entanglePorts(*executionContext(), channels.release()); - RefPtr<Event> evt = MessageEvent::create(ports.release(), message.release()); + RefPtrWillBeRawPtr<Event> evt = MessageEvent::create(ports.release(), message.release()); dispatchEvent(evt.release(), ASSERT_NO_EXCEPTION); } diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp index a35aace..1e142c6 100644 --- a/third_party/WebKit/Source/core/dom/Node.cpp +++ b/third_party/WebKit/Source/core/dom/Node.cpp @@ -2166,7 +2166,7 @@ void Node::handleLocalEvents(Event* event) fireEventListeners(event); } -void Node::dispatchScopedEvent(PassRefPtr<Event> event) +void Node::dispatchScopedEvent(PassRefPtrWillBeRawPtr<Event> event) { dispatchScopedEventDispatchMediator(EventDispatchMediator::create(event)); } @@ -2176,7 +2176,7 @@ void Node::dispatchScopedEventDispatchMediator(PassRefPtr<EventDispatchMediator> EventDispatcher::dispatchScopedEvent(this, eventDispatchMediator); } -bool Node::dispatchEvent(PassRefPtr<Event> event) +bool Node::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) { if (event->isMouseEvent()) return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator::create(static_pointer_cast<MouseEvent>(event), MouseEventDispatchMediator::SyntheticMouseEvent)); @@ -2198,10 +2198,10 @@ void Node::dispatchSubtreeModifiedEvent() dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMSubtreeModified, true)); } -bool Node::dispatchDOMActivateEvent(int detail, PassRefPtr<Event> underlyingEvent) +bool Node::dispatchDOMActivateEvent(int detail, PassRefPtrWillBeRawPtr<Event> underlyingEvent) { ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); - RefPtr<UIEvent> event = UIEvent::create(EventTypeNames::DOMActivate, true, true, document().domWindow(), detail); + RefPtrWillBeRawPtr<UIEvent> event = UIEvent::create(EventTypeNames::DOMActivate, true, true, document().domWindow(), detail); event->setUnderlyingEvent(underlyingEvent); dispatchScopedEvent(event); return event->defaultHandled(); @@ -2220,13 +2220,13 @@ bool Node::dispatchMouseEvent(const PlatformMouseEvent& event, const AtomicStrin bool Node::dispatchGestureEvent(const PlatformGestureEvent& event) { - RefPtr<GestureEvent> gestureEvent = GestureEvent::create(document().domWindow(), event); + RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(document().domWindow(), event); if (!gestureEvent.get()) return false; return EventDispatcher::dispatchEvent(this, GestureEventDispatchMediator::create(gestureEvent)); } -bool Node::dispatchTouchEvent(PassRefPtr<TouchEvent> event) +bool Node::dispatchTouchEvent(PassRefPtrWillBeRawPtr<TouchEvent> event) { return EventDispatcher::dispatchEvent(this, TouchEventDispatchMediator::create(event)); } diff --git a/third_party/WebKit/Source/core/dom/Node.h b/third_party/WebKit/Source/core/dom/Node.h index a143750..f6822f5 100644 --- a/third_party/WebKit/Source/core/dom/Node.h +++ b/third_party/WebKit/Source/core/dom/Node.h @@ -619,21 +619,21 @@ public: virtual void postDispatchEventHandler(Event*, void* /*dataFromPreDispatch*/) { } using EventTarget::dispatchEvent; - virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE; + virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE; - void dispatchScopedEvent(PassRefPtr<Event>); + void dispatchScopedEvent(PassRefPtrWillBeRawPtr<Event>); void dispatchScopedEventDispatchMediator(PassRefPtr<EventDispatchMediator>); virtual void handleLocalEvents(Event*); void dispatchSubtreeModifiedEvent(); - bool dispatchDOMActivateEvent(int detail, PassRefPtr<Event> underlyingEvent); + bool dispatchDOMActivateEvent(int detail, PassRefPtrWillBeRawPtr<Event> underlyingEvent); bool dispatchKeyEvent(const PlatformKeyboardEvent&); bool dispatchWheelEvent(const PlatformWheelEvent&); bool dispatchMouseEvent(const PlatformMouseEvent&, const AtomicString& eventType, int clickCount = 0, Node* relatedTarget = 0); bool dispatchGestureEvent(const PlatformGestureEvent&); - bool dispatchTouchEvent(PassRefPtr<TouchEvent>); + bool dispatchTouchEvent(PassRefPtrWillBeRawPtr<TouchEvent>); void dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEventOptions = SendNoEvents); diff --git a/third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp b/third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp index 29ed5b8..05744c1 100644 --- a/third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp @@ -100,7 +100,7 @@ void ScriptedAnimationController::cancelCallback(CallbackId id) void ScriptedAnimationController::dispatchEvents() { - Vector<RefPtr<Event> > events; + WillBeHeapVector<RefPtrWillBeMember<Event> > events; events.swap(m_eventQueue); m_perFrameEvents.clear(); @@ -161,13 +161,13 @@ void ScriptedAnimationController::serviceScriptedAnimations(double monotonicTime scheduleAnimationIfNeeded(); } -void ScriptedAnimationController::enqueueEvent(PassRefPtr<Event> event) +void ScriptedAnimationController::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) { m_eventQueue.append(event); scheduleAnimationIfNeeded(); } -void ScriptedAnimationController::enqueuePerFrameEvent(PassRefPtr<Event> event) +void ScriptedAnimationController::enqueuePerFrameEvent(PassRefPtrWillBeRawPtr<Event> event) { if (!m_perFrameEvents.add(eventTargetKey(event.get())).isNewEntry) return; diff --git a/third_party/WebKit/Source/core/dom/ScriptedAnimationController.h b/third_party/WebKit/Source/core/dom/ScriptedAnimationController.h index 5f7efb8..32ebf3e 100644 --- a/third_party/WebKit/Source/core/dom/ScriptedAnimationController.h +++ b/third_party/WebKit/Source/core/dom/ScriptedAnimationController.h @@ -26,6 +26,7 @@ #ifndef ScriptedAnimationController_h #define ScriptedAnimationController_h +#include "heap/Handle.h" #include "wtf/ListHashSet.h" #include "wtf/RefCounted.h" #include "wtf/RefPtr.h" @@ -54,8 +55,8 @@ public: void cancelCallback(CallbackId); void serviceScriptedAnimations(double monotonicTimeNow); - void enqueueEvent(PassRefPtr<Event>); - void enqueuePerFrameEvent(PassRefPtr<Event>); + void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); + void enqueuePerFrameEvent(PassRefPtrWillBeRawPtr<Event>); void suspend(); void resume(); @@ -75,7 +76,7 @@ private: Document* m_document; CallbackId m_nextCallbackId; int m_suspendCount; - Vector<RefPtr<Event> > m_eventQueue; + WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_eventQueue; ListHashSet<std::pair<const EventTarget*, const StringImpl*> > m_perFrameEvents; }; diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp index d1c30dd..3feef70 100644 --- a/third_party/WebKit/Source/core/editing/Editor.cpp +++ b/third_party/WebKit/Source/core/editing/Editor.cpp @@ -464,7 +464,7 @@ bool Editor::dispatchCPPEvent(const AtomicString &eventType, ClipboardAccessPoli ? DataObject::create() : DataObject::createFromPasteboard(pasteMode)); - RefPtr<Event> evt = ClipboardEvent::create(eventType, true, true, clipboard); + RefPtrWillBeRawPtr<Event> evt = ClipboardEvent::create(eventType, true, true, clipboard); target->dispatchEvent(evt, IGNORE_EXCEPTION); bool noDefaultProcessing = evt->defaultPrevented(); if (noDefaultProcessing && policy == ClipboardWritable) { diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.cpp b/third_party/WebKit/Source/core/editing/InputMethodController.cpp index ca3024a..43840c6 100644 --- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp +++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp @@ -200,7 +200,7 @@ bool InputMethodController::finishComposition(const String& text, FinishComposit underline.endOffset -= baseOffset; underlines.append(underline); } - RefPtr<CompositionEvent> event = CompositionEvent::create(EventTypeNames::compositionend, m_frame.domWindow(), text, underlines); + RefPtrWillBeRawPtr<CompositionEvent> event = CompositionEvent::create(EventTypeNames::compositionend, m_frame.domWindow(), text, underlines); target->dispatchEvent(event, IGNORE_EXCEPTION); } @@ -254,7 +254,7 @@ void InputMethodController::setComposition(const String& text, const Vector<Comp // 3. Canceling the ongoing composition. // Send a compositionend event when function deletes the existing composition node, i.e. // m_compositionNode != 0 && test.isEmpty(). - RefPtr<CompositionEvent> event; + RefPtrWillBeRawPtr<CompositionEvent> event = nullptr; if (!hasComposition()) { // We should send a compositionstart event only when the given text is not empty because this // function doesn't create a composition node when the text is empty. diff --git a/third_party/WebKit/Source/core/editing/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/ReplaceSelectionCommand.cpp index 8b8f99f..0e90ef5 100644 --- a/third_party/WebKit/Source/core/editing/ReplaceSelectionCommand.cpp +++ b/third_party/WebKit/Source/core/editing/ReplaceSelectionCommand.cpp @@ -173,7 +173,7 @@ ReplacementFragment::ReplacementFragment(Document* document, DocumentFragment* f restoreAndRemoveTestRenderingNodesToFragment(holder.get()); // Give the root a chance to change the text. - RefPtr<BeforeTextInsertedEvent> evt = BeforeTextInsertedEvent::create(text); + RefPtrWillBeRawPtr<BeforeTextInsertedEvent> evt = BeforeTextInsertedEvent::create(text); editableRoot->dispatchEvent(evt, ASSERT_NO_EXCEPTION); if (text != evt->text() || !editableRoot->rendererIsRichlyEditable()) { restoreAndRemoveTestRenderingNodesToFragment(holder.get()); diff --git a/third_party/WebKit/Source/core/editing/TextInsertionBaseCommand.cpp b/third_party/WebKit/Source/core/editing/TextInsertionBaseCommand.cpp index 21e2b7d..79f638d 100644 --- a/third_party/WebKit/Source/core/editing/TextInsertionBaseCommand.cpp +++ b/third_party/WebKit/Source/core/editing/TextInsertionBaseCommand.cpp @@ -63,7 +63,7 @@ String dispatchBeforeTextInsertedEvent(const String& text, const VisibleSelectio if (Node* startNode = selectionForInsertion.start().containerNode()) { if (startNode->rootEditableElement()) { // Send BeforeTextInsertedEvent. The event handler will update text if necessary. - RefPtr<BeforeTextInsertedEvent> evt = BeforeTextInsertedEvent::create(text); + RefPtrWillBeRawPtr<BeforeTextInsertedEvent> evt = BeforeTextInsertedEvent::create(text); startNode->rootEditableElement()->dispatchEvent(evt, IGNORE_EXCEPTION); newText = evt->text(); } @@ -77,7 +77,7 @@ bool canAppendNewLineFeedToSelection(const VisibleSelection& selection) if (!node) return false; - RefPtr<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(String("\n")); + RefPtrWillBeRawPtr<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(String("\n")); node->dispatchEvent(event, IGNORE_EXCEPTION); return event->text().length(); } diff --git a/third_party/WebKit/Source/core/events/DOMWindowEventQueue.cpp b/third_party/WebKit/Source/core/events/DOMWindowEventQueue.cpp index 03ed12e..7f9eac1 100644 --- a/third_party/WebKit/Source/core/events/DOMWindowEventQueue.cpp +++ b/third_party/WebKit/Source/core/events/DOMWindowEventQueue.cpp @@ -62,7 +62,7 @@ DOMWindowEventQueue::~DOMWindowEventQueue() { } -bool DOMWindowEventQueue::enqueueEvent(PassRefPtr<Event> event) +bool DOMWindowEventQueue::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) { if (m_isClosed) return false; @@ -79,7 +79,7 @@ bool DOMWindowEventQueue::enqueueEvent(PassRefPtr<Event> event) bool DOMWindowEventQueue::cancelEvent(Event* event) { - ListHashSet<RefPtr<Event>, 16>::iterator it = m_queuedEvents.find(event); + ListHashSet<RefPtrWillBePersistent<Event>, 16>::iterator it = m_queuedEvents.find(event); bool found = it != m_queuedEvents.end(); if (found) m_queuedEvents.remove(it); @@ -108,8 +108,8 @@ void DOMWindowEventQueue::pendingEventTimerFired() RefPtr<DOMWindowEventQueue> protector(this); while (!m_queuedEvents.isEmpty()) { - ListHashSet<RefPtr<Event>, 16>::iterator iter = m_queuedEvents.begin(); - RefPtr<Event> event = *iter; + ListHashSet<RefPtrWillBePersistent<Event>, 16>::iterator iter = m_queuedEvents.begin(); + RefPtrWillBeRawPtr<Event> event = *iter; m_queuedEvents.remove(iter); if (!event) break; @@ -117,7 +117,7 @@ void DOMWindowEventQueue::pendingEventTimerFired() } } -void DOMWindowEventQueue::dispatchEvent(PassRefPtr<Event> event) +void DOMWindowEventQueue::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) { EventTarget* eventTarget = event->target(); if (eventTarget->toDOMWindow()) diff --git a/third_party/WebKit/Source/core/events/DOMWindowEventQueue.h b/third_party/WebKit/Source/core/events/DOMWindowEventQueue.h index 23dbb93..dca7ded 100644 --- a/third_party/WebKit/Source/core/events/DOMWindowEventQueue.h +++ b/third_party/WebKit/Source/core/events/DOMWindowEventQueue.h @@ -47,7 +47,7 @@ public: virtual ~DOMWindowEventQueue(); // EventQueue - virtual bool enqueueEvent(PassRefPtr<Event>) OVERRIDE; + virtual bool enqueueEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE; virtual bool cancelEvent(Event*) OVERRIDE; virtual void close() OVERRIDE; @@ -55,10 +55,11 @@ private: explicit DOMWindowEventQueue(ExecutionContext*); void pendingEventTimerFired(); - void dispatchEvent(PassRefPtr<Event>); + void dispatchEvent(PassRefPtrWillBeRawPtr<Event>); OwnPtr<DOMWindowEventQueueTimer> m_pendingEventTimer; - ListHashSet<RefPtr<Event>, 16> m_queuedEvents; + // FIXME: oilpan: This should be HeapListHashSet once it's implemented. + ListHashSet<RefPtrWillBePersistent<Event>, 16> m_queuedEvents; bool m_isClosed; friend class DOMWindowEventQueueTimer; diff --git a/third_party/WebKit/Source/core/events/Event.cpp b/third_party/WebKit/Source/core/events/Event.cpp index 03756cc..6d27831 100644 --- a/third_party/WebKit/Source/core/events/Event.cpp +++ b/third_party/WebKit/Source/core/events/Event.cpp @@ -180,7 +180,7 @@ void Event::receivedTarget() { } -void Event::setUnderlyingEvent(PassRefPtr<Event> ue) +void Event::setUnderlyingEvent(PassRefPtrWillBeRawPtr<Event> ue) { // Prohibit creation of a cycle -- just do nothing in that case. for (Event* e = ue.get(); e; e = e->underlyingEvent()) @@ -213,8 +213,9 @@ PassRefPtr<NodeList> Event::path() const return StaticNodeList::createEmpty(); } -void Event::trace(Visitor*) +void Event::trace(Visitor* visitor) { + visitor->trace(m_underlyingEvent); } } // namespace WebCore diff --git a/third_party/WebKit/Source/core/events/Event.h b/third_party/WebKit/Source/core/events/Event.h index 19344d8..417d943 100644 --- a/third_party/WebKit/Source/core/events/Event.h +++ b/third_party/WebKit/Source/core/events/Event.h @@ -172,7 +172,7 @@ public: void setCancelBubble(bool cancel) { m_cancelBubble = cancel; } Event* underlyingEvent() const { return m_underlyingEvent.get(); } - void setUnderlyingEvent(PassRefPtr<Event>); + void setUnderlyingEvent(PassRefPtrWillBeRawPtr<Event>); EventPath& eventPath() { ASSERT(m_eventPath); return *m_eventPath; } EventPath& ensureEventPath(); @@ -206,7 +206,7 @@ private: EventTarget* m_currentTarget; RefPtr<EventTarget> m_target; DOMTimeStamp m_createTime; - RefPtr<Event> m_underlyingEvent; + RefPtrWillBeMember<Event> m_underlyingEvent; OwnPtr<EventPath> m_eventPath; }; diff --git a/third_party/WebKit/Source/core/events/EventDispatchMediator.cpp b/third_party/WebKit/Source/core/events/EventDispatchMediator.cpp index 032d0b8..0ee1762 100644 --- a/third_party/WebKit/Source/core/events/EventDispatchMediator.cpp +++ b/third_party/WebKit/Source/core/events/EventDispatchMediator.cpp @@ -36,12 +36,12 @@ namespace WebCore { -PassRefPtr<EventDispatchMediator> EventDispatchMediator::create(PassRefPtr<Event> event) +PassRefPtr<EventDispatchMediator> EventDispatchMediator::create(PassRefPtrWillBeRawPtr<Event> event) { return adoptRef(new EventDispatchMediator(event)); } -EventDispatchMediator::EventDispatchMediator(PassRefPtr<Event> event) +EventDispatchMediator::EventDispatchMediator(PassRefPtrWillBeRawPtr<Event> event) : m_event(event) { } diff --git a/third_party/WebKit/Source/core/events/EventDispatchMediator.h b/third_party/WebKit/Source/core/events/EventDispatchMediator.h index 00ab3276..aea29c6 100644 --- a/third_party/WebKit/Source/core/events/EventDispatchMediator.h +++ b/third_party/WebKit/Source/core/events/EventDispatchMediator.h @@ -31,6 +31,7 @@ #ifndef EventDispatchMediator_h #define EventDispatchMediator_h +#include "heap/Handle.h" #include "wtf/PassRefPtr.h" #include "wtf/RefCounted.h" #include "wtf/RefPtr.h" @@ -43,18 +44,18 @@ class Node; class EventDispatchMediator : public RefCounted<EventDispatchMediator> { public: - static PassRefPtr<EventDispatchMediator> create(PassRefPtr<Event>); + static PassRefPtr<EventDispatchMediator> create(PassRefPtrWillBeRawPtr<Event>); virtual ~EventDispatchMediator() { }; virtual bool dispatchEvent(EventDispatcher*) const; Event* event() const { return m_event.get(); }; protected: - explicit EventDispatchMediator(PassRefPtr<Event>); + explicit EventDispatchMediator(PassRefPtrWillBeRawPtr<Event>); EventDispatchMediator() { }; - void setEvent(PassRefPtr<Event> event) { m_event = event; }; + void setEvent(PassRefPtrWillBeRawPtr<Event> event) { m_event = event; }; private: - RefPtr<Event> m_event; + RefPtrWillBePersistent<Event> m_event; }; } // namespace WebCore diff --git a/third_party/WebKit/Source/core/events/EventDispatcher.cpp b/third_party/WebKit/Source/core/events/EventDispatcher.cpp index 91a351e..b4619c9 100644 --- a/third_party/WebKit/Source/core/events/EventDispatcher.cpp +++ b/third_party/WebKit/Source/core/events/EventDispatcher.cpp @@ -49,7 +49,7 @@ bool EventDispatcher::dispatchEvent(Node* node, PassRefPtr<EventDispatchMediator return mediator->dispatchEvent(&dispatcher); } -EventDispatcher::EventDispatcher(Node* node, PassRefPtr<Event> event) +EventDispatcher::EventDispatcher(Node* node, PassRefPtrWillBeRawPtr<Event> event) : m_node(node) , m_event(event) #ifndef NDEBUG diff --git a/third_party/WebKit/Source/core/events/EventDispatcher.h b/third_party/WebKit/Source/core/events/EventDispatcher.h index 9fac66f..7f672ef 100644 --- a/third_party/WebKit/Source/core/events/EventDispatcher.h +++ b/third_party/WebKit/Source/core/events/EventDispatcher.h @@ -27,6 +27,7 @@ #define EventDispatcher_h #include "core/dom/SimulatedClickOptions.h" +#include "heap/Handle.h" #include "wtf/PassRefPtr.h" #include "wtf/RefPtr.h" @@ -56,7 +57,7 @@ public: Event* event() const { return m_event.get(); } private: - EventDispatcher(Node*, PassRefPtr<Event>); + EventDispatcher(Node*, PassRefPtrWillBeRawPtr<Event>); const NodeEventContext* topNodeEventContext(); EventDispatchContinuation dispatchEventPreProcess(void*& preDispatchEventHandlerResult); @@ -66,7 +67,7 @@ private: void dispatchEventPostProcess(void* preDispatchEventHandlerResult); RefPtr<Node> m_node; - RefPtr<Event> m_event; + RefPtrWillBePersistent<Event> m_event; RefPtr<FrameView> m_view; #ifndef NDEBUG bool m_eventDispatched; diff --git a/third_party/WebKit/Source/core/events/EventQueue.h b/third_party/WebKit/Source/core/events/EventQueue.h index 770ae79..47175c9 100644 --- a/third_party/WebKit/Source/core/events/EventQueue.h +++ b/third_party/WebKit/Source/core/events/EventQueue.h @@ -27,6 +27,7 @@ #ifndef EventQueue_h #define EventQueue_h +#include "heap/Handle.h" #include "wtf/HashMap.h" #include "wtf/HashSet.h" #include "wtf/PassOwnPtr.h" @@ -38,7 +39,7 @@ class Event; class EventQueue { public: virtual ~EventQueue() { } - virtual bool enqueueEvent(PassRefPtr<Event>) = 0; + virtual bool enqueueEvent(PassRefPtrWillBeRawPtr<Event>) = 0; virtual bool cancelEvent(Event*) = 0; // The accumulated and all the future events will be discarded, no events will be dispatched anymore. virtual void close() = 0; diff --git a/third_party/WebKit/Source/core/events/EventTarget.cpp b/third_party/WebKit/Source/core/events/EventTarget.cpp index 30bd252..0b5f43f 100644 --- a/third_party/WebKit/Source/core/events/EventTarget.cpp +++ b/third_party/WebKit/Source/core/events/EventTarget.cpp @@ -154,7 +154,7 @@ bool EventTarget::clearAttributeEventListener(const AtomicString& eventType) return removeEventListener(eventType, listener, false); } -bool EventTarget::dispatchEvent(PassRefPtr<Event> event, ExceptionState& exceptionState) +bool EventTarget::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event, ExceptionState& exceptionState) { if (!event) { exceptionState.throwDOMException(InvalidStateError, "The event provided is null."); @@ -175,7 +175,7 @@ bool EventTarget::dispatchEvent(PassRefPtr<Event> event, ExceptionState& excepti return dispatchEvent(event); } -bool EventTarget::dispatchEvent(PassRefPtr<Event> event) +bool EventTarget::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) { event->setTarget(this); event->setCurrentTarget(this); diff --git a/third_party/WebKit/Source/core/events/EventTarget.h b/third_party/WebKit/Source/core/events/EventTarget.h index c1bf895d..95b00150 100644 --- a/third_party/WebKit/Source/core/events/EventTarget.h +++ b/third_party/WebKit/Source/core/events/EventTarget.h @@ -34,6 +34,7 @@ #include "core/events/EventListenerMap.h" #include "core/events/ThreadLocalEventNames.h" +#include "heap/Handle.h" #include "wtf/Forward.h" namespace WebCore { @@ -117,8 +118,8 @@ public: bool removeEventListener(const AtomicString& eventType) { return false; } virtual bool removeEventListener(const AtomicString& eventType, EventListener*, bool useCapture = false); virtual void removeAllEventListeners(); - virtual bool dispatchEvent(PassRefPtr<Event>); - bool dispatchEvent(PassRefPtr<Event>, ExceptionState&); // DOM API + virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>); + bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>, ExceptionState&); // DOM API virtual void uncaughtExceptionInEventHandler(); // Used for legacy "onEvent" attribute APIs. diff --git a/third_party/WebKit/Source/core/events/FocusEvent.cpp b/third_party/WebKit/Source/core/events/FocusEvent.cpp index 4385fed..04c6247 100644 --- a/third_party/WebKit/Source/core/events/FocusEvent.cpp +++ b/third_party/WebKit/Source/core/events/FocusEvent.cpp @@ -70,12 +70,12 @@ void FocusEvent::trace(Visitor* visitor) UIEvent::trace(visitor); } -PassRefPtr<FocusEventDispatchMediator> FocusEventDispatchMediator::create(PassRefPtr<FocusEvent> focusEvent) +PassRefPtr<FocusEventDispatchMediator> FocusEventDispatchMediator::create(PassRefPtrWillBeRawPtr<FocusEvent> focusEvent) { return adoptRef(new FocusEventDispatchMediator(focusEvent)); } -FocusEventDispatchMediator::FocusEventDispatchMediator(PassRefPtr<FocusEvent> focusEvent) +FocusEventDispatchMediator::FocusEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent> focusEvent) : EventDispatchMediator(focusEvent) { } @@ -86,12 +86,12 @@ bool FocusEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons return EventDispatchMediator::dispatchEvent(dispatcher); } -PassRefPtr<BlurEventDispatchMediator> BlurEventDispatchMediator::create(PassRefPtr<FocusEvent> focusEvent) +PassRefPtr<BlurEventDispatchMediator> BlurEventDispatchMediator::create(PassRefPtrWillBeRawPtr<FocusEvent> focusEvent) { return adoptRef(new BlurEventDispatchMediator(focusEvent)); } -BlurEventDispatchMediator::BlurEventDispatchMediator(PassRefPtr<FocusEvent> focusEvent) +BlurEventDispatchMediator::BlurEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent> focusEvent) : EventDispatchMediator(focusEvent) { } @@ -102,12 +102,12 @@ bool BlurEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const return EventDispatchMediator::dispatchEvent(dispatcher); } -PassRefPtr<FocusInEventDispatchMediator> FocusInEventDispatchMediator::create(PassRefPtr<FocusEvent> focusEvent) +PassRefPtr<FocusInEventDispatchMediator> FocusInEventDispatchMediator::create(PassRefPtrWillBeRawPtr<FocusEvent> focusEvent) { return adoptRef(new FocusInEventDispatchMediator(focusEvent)); } -FocusInEventDispatchMediator::FocusInEventDispatchMediator(PassRefPtr<FocusEvent> focusEvent) +FocusInEventDispatchMediator::FocusInEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent> focusEvent) : EventDispatchMediator(focusEvent) { } @@ -118,12 +118,12 @@ bool FocusInEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) co return EventDispatchMediator::dispatchEvent(dispatcher); } -PassRefPtr<FocusOutEventDispatchMediator> FocusOutEventDispatchMediator::create(PassRefPtr<FocusEvent> focusEvent) +PassRefPtr<FocusOutEventDispatchMediator> FocusOutEventDispatchMediator::create(PassRefPtrWillBeRawPtr<FocusEvent> focusEvent) { return adoptRef(new FocusOutEventDispatchMediator(focusEvent)); } -FocusOutEventDispatchMediator::FocusOutEventDispatchMediator(PassRefPtr<FocusEvent> focusEvent) +FocusOutEventDispatchMediator::FocusOutEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent> focusEvent) : EventDispatchMediator(focusEvent) { } diff --git a/third_party/WebKit/Source/core/events/FocusEvent.h b/third_party/WebKit/Source/core/events/FocusEvent.h index dd4b9d1..2264f39 100644 --- a/third_party/WebKit/Source/core/events/FocusEvent.h +++ b/third_party/WebKit/Source/core/events/FocusEvent.h @@ -77,36 +77,36 @@ DEFINE_EVENT_TYPE_CASTS(FocusEvent); class FocusEventDispatchMediator FINAL : public EventDispatchMediator { public: - static PassRefPtr<FocusEventDispatchMediator> create(PassRefPtr<FocusEvent>); + static PassRefPtr<FocusEventDispatchMediator> create(PassRefPtrWillBeRawPtr<FocusEvent>); private: - explicit FocusEventDispatchMediator(PassRefPtr<FocusEvent>); + explicit FocusEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent>); FocusEvent* event() const { return static_cast<FocusEvent*>(EventDispatchMediator::event()); } virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; }; class BlurEventDispatchMediator FINAL : public EventDispatchMediator { public: - static PassRefPtr<BlurEventDispatchMediator> create(PassRefPtr<FocusEvent>); + static PassRefPtr<BlurEventDispatchMediator> create(PassRefPtrWillBeRawPtr<FocusEvent>); private: - explicit BlurEventDispatchMediator(PassRefPtr<FocusEvent>); + explicit BlurEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent>); FocusEvent* event() const { return static_cast<FocusEvent*>(EventDispatchMediator::event()); } virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; }; class FocusInEventDispatchMediator FINAL : public EventDispatchMediator { public: - static PassRefPtr<FocusInEventDispatchMediator> create(PassRefPtr<FocusEvent>); + static PassRefPtr<FocusInEventDispatchMediator> create(PassRefPtrWillBeRawPtr<FocusEvent>); private: - explicit FocusInEventDispatchMediator(PassRefPtr<FocusEvent>); + explicit FocusInEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent>); FocusEvent* event() const { return static_cast<FocusEvent*>(EventDispatchMediator::event()); } virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; }; class FocusOutEventDispatchMediator FINAL : public EventDispatchMediator { public: - static PassRefPtr<FocusOutEventDispatchMediator> create(PassRefPtr<FocusEvent>); + static PassRefPtr<FocusOutEventDispatchMediator> create(PassRefPtrWillBeRawPtr<FocusEvent>); private: - explicit FocusOutEventDispatchMediator(PassRefPtr<FocusEvent>); + explicit FocusOutEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent>); FocusEvent* event() const { return static_cast<FocusEvent*>(EventDispatchMediator::event()); } virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; }; diff --git a/third_party/WebKit/Source/core/events/GenericEventQueue.cpp b/third_party/WebKit/Source/core/events/GenericEventQueue.cpp index ef3d81a..cc84fc3 100644 --- a/third_party/WebKit/Source/core/events/GenericEventQueue.cpp +++ b/third_party/WebKit/Source/core/events/GenericEventQueue.cpp @@ -48,7 +48,7 @@ GenericEventQueue::~GenericEventQueue() { } -bool GenericEventQueue::enqueueEvent(PassRefPtr<Event> event) +bool GenericEventQueue::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) { if (m_isClosed) return false; @@ -85,7 +85,7 @@ void GenericEventQueue::timerFired(Timer<GenericEventQueue>*) ASSERT(!m_timer.isActive()); ASSERT(!m_pendingEvents.isEmpty()); - Vector<RefPtr<Event> > pendingEvents; + WillBeHeapVector<RefPtrWillBeMember<Event> > pendingEvents; m_pendingEvents.swap(pendingEvents); RefPtr<EventTarget> protect(m_owner); diff --git a/third_party/WebKit/Source/core/events/GenericEventQueue.h b/third_party/WebKit/Source/core/events/GenericEventQueue.h index cf8e8a6..25eadb2 100644 --- a/third_party/WebKit/Source/core/events/GenericEventQueue.h +++ b/third_party/WebKit/Source/core/events/GenericEventQueue.h @@ -43,7 +43,7 @@ public: virtual ~GenericEventQueue(); // EventQueue - virtual bool enqueueEvent(PassRefPtr<Event>) OVERRIDE; + virtual bool enqueueEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE; virtual bool cancelEvent(Event*) OVERRIDE; virtual void close() OVERRIDE; @@ -54,7 +54,7 @@ private: void timerFired(Timer<GenericEventQueue>*); EventTarget* m_owner; - Vector<RefPtr<Event> > m_pendingEvents; + WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_pendingEvents; Timer<GenericEventQueue> m_timer; bool m_isClosed; diff --git a/third_party/WebKit/Source/core/events/GestureEvent.cpp b/third_party/WebKit/Source/core/events/GestureEvent.cpp index 9e0e037..47b4f5b 100644 --- a/third_party/WebKit/Source/core/events/GestureEvent.cpp +++ b/third_party/WebKit/Source/core/events/GestureEvent.cpp @@ -99,7 +99,7 @@ void GestureEvent::trace(Visitor* visitor) MouseRelatedEvent::trace(visitor); } -GestureEventDispatchMediator::GestureEventDispatchMediator(PassRefPtr<GestureEvent> gestureEvent) +GestureEventDispatchMediator::GestureEventDispatchMediator(PassRefPtrWillBeRawPtr<GestureEvent> gestureEvent) : EventDispatchMediator(gestureEvent) { } diff --git a/third_party/WebKit/Source/core/events/GestureEvent.h b/third_party/WebKit/Source/core/events/GestureEvent.h index 0047edb..86f5a5d 100644 --- a/third_party/WebKit/Source/core/events/GestureEvent.h +++ b/third_party/WebKit/Source/core/events/GestureEvent.h @@ -57,13 +57,13 @@ private: class GestureEventDispatchMediator FINAL : public EventDispatchMediator { public: - static PassRefPtr<GestureEventDispatchMediator> create(PassRefPtr<GestureEvent> gestureEvent) + static PassRefPtr<GestureEventDispatchMediator> create(PassRefPtrWillBeRawPtr<GestureEvent> gestureEvent) { return adoptRef(new GestureEventDispatchMediator(gestureEvent)); } private: - explicit GestureEventDispatchMediator(PassRefPtr<GestureEvent>); + explicit GestureEventDispatchMediator(PassRefPtrWillBeRawPtr<GestureEvent>); GestureEvent* event() const; diff --git a/third_party/WebKit/Source/core/events/KeyboardEvent.cpp b/third_party/WebKit/Source/core/events/KeyboardEvent.cpp index fbcf2f9..1a18c41 100644 --- a/third_party/WebKit/Source/core/events/KeyboardEvent.cpp +++ b/third_party/WebKit/Source/core/events/KeyboardEvent.cpp @@ -221,12 +221,12 @@ void KeyboardEvent::trace(Visitor* visitor) UIEventWithKeyState::trace(visitor); } -PassRefPtr<KeyboardEventDispatchMediator> KeyboardEventDispatchMediator::create(PassRefPtr<KeyboardEvent> event) +PassRefPtr<KeyboardEventDispatchMediator> KeyboardEventDispatchMediator::create(PassRefPtrWillBeRawPtr<KeyboardEvent> event) { return adoptRef(new KeyboardEventDispatchMediator(event)); } -KeyboardEventDispatchMediator::KeyboardEventDispatchMediator(PassRefPtr<KeyboardEvent> event) +KeyboardEventDispatchMediator::KeyboardEventDispatchMediator(PassRefPtrWillBeRawPtr<KeyboardEvent> event) : EventDispatchMediator(event) { } diff --git a/third_party/WebKit/Source/core/events/KeyboardEvent.h b/third_party/WebKit/Source/core/events/KeyboardEvent.h index 5bf8c15..c5f956d 100644 --- a/third_party/WebKit/Source/core/events/KeyboardEvent.h +++ b/third_party/WebKit/Source/core/events/KeyboardEvent.h @@ -119,9 +119,9 @@ private: class KeyboardEventDispatchMediator : public EventDispatchMediator { public: - static PassRefPtr<KeyboardEventDispatchMediator> create(PassRefPtr<KeyboardEvent>); + static PassRefPtr<KeyboardEventDispatchMediator> create(PassRefPtrWillBeRawPtr<KeyboardEvent>); private: - explicit KeyboardEventDispatchMediator(PassRefPtr<KeyboardEvent>); + explicit KeyboardEventDispatchMediator(PassRefPtrWillBeRawPtr<KeyboardEvent>); virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; }; diff --git a/third_party/WebKit/Source/core/events/MouseEvent.cpp b/third_party/WebKit/Source/core/events/MouseEvent.cpp index 9bbdf3e..a17d8f7 100644 --- a/third_party/WebKit/Source/core/events/MouseEvent.cpp +++ b/third_party/WebKit/Source/core/events/MouseEvent.cpp @@ -196,7 +196,7 @@ void MouseEvent::trace(Visitor* visitor) MouseRelatedEvent::trace(visitor); } -PassRefPtrWillBeRawPtr<SimulatedMouseEvent> SimulatedMouseEvent::create(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, PassRefPtr<Event> underlyingEvent) +PassRefPtrWillBeRawPtr<SimulatedMouseEvent> SimulatedMouseEvent::create(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, PassRefPtrWillBeRawPtr<Event> underlyingEvent) { return adoptRefWillBeRefCountedGarbageCollected(new SimulatedMouseEvent(eventType, view, underlyingEvent)); } @@ -205,7 +205,7 @@ SimulatedMouseEvent::~SimulatedMouseEvent() { } -SimulatedMouseEvent::SimulatedMouseEvent(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, PassRefPtr<Event> underlyingEvent) +SimulatedMouseEvent::SimulatedMouseEvent(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, PassRefPtrWillBeRawPtr<Event> underlyingEvent) : MouseEvent(eventType, true, true, view, 0, 0, 0, 0, 0, 0, 0, false, false, false, false, 0, nullptr, nullptr, true) @@ -230,12 +230,12 @@ void SimulatedMouseEvent::trace(Visitor* visitor) MouseEvent::trace(visitor); } -PassRefPtr<MouseEventDispatchMediator> MouseEventDispatchMediator::create(PassRefPtr<MouseEvent> mouseEvent, MouseEventType mouseEventType) +PassRefPtr<MouseEventDispatchMediator> MouseEventDispatchMediator::create(PassRefPtrWillBeRawPtr<MouseEvent> mouseEvent, MouseEventType mouseEventType) { return adoptRef(new MouseEventDispatchMediator(mouseEvent, mouseEventType)); } -MouseEventDispatchMediator::MouseEventDispatchMediator(PassRefPtr<MouseEvent> mouseEvent, MouseEventType mouseEventType) +MouseEventDispatchMediator::MouseEventDispatchMediator(PassRefPtrWillBeRawPtr<MouseEvent> mouseEvent, MouseEventType mouseEventType) : EventDispatchMediator(mouseEvent), m_mouseEventType(mouseEventType) { } @@ -272,7 +272,7 @@ bool MouseEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons // Special case: If it's a double click event, we also send the dblclick event. This is not part // of the DOM specs, but is used for compatibility with the ondblclick="" attribute. This is treated // as a separate event in other DOM-compliant browsers like Firefox, and so we do the same. - RefPtr<MouseEvent> doubleClickEvent = MouseEvent::create(); + RefPtrWillBeRawPtr<MouseEvent> doubleClickEvent = MouseEvent::create(); doubleClickEvent->initMouseEvent(EventTypeNames::dblclick, event()->bubbles(), event()->cancelable(), event()->view(), event()->detail(), event()->screenX(), event()->screenY(), event()->clientX(), event()->clientY(), event()->ctrlKey(), event()->altKey(), event()->shiftKey(), event()->metaKey(), diff --git a/third_party/WebKit/Source/core/events/MouseEvent.h b/third_party/WebKit/Source/core/events/MouseEvent.h index 9b3056b..700269b 100644 --- a/third_party/WebKit/Source/core/events/MouseEvent.h +++ b/third_party/WebKit/Source/core/events/MouseEvent.h @@ -113,22 +113,22 @@ private: class SimulatedMouseEvent FINAL : public MouseEvent { public: - static PassRefPtrWillBeRawPtr<SimulatedMouseEvent> create(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView>, PassRefPtr<Event> underlyingEvent); + static PassRefPtrWillBeRawPtr<SimulatedMouseEvent> create(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView>, PassRefPtrWillBeRawPtr<Event> underlyingEvent); virtual ~SimulatedMouseEvent(); virtual void trace(Visitor*) OVERRIDE; private: - SimulatedMouseEvent(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView>, PassRefPtr<Event> underlyingEvent); + SimulatedMouseEvent(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView>, PassRefPtrWillBeRawPtr<Event> underlyingEvent); }; class MouseEventDispatchMediator FINAL : public EventDispatchMediator { public: enum MouseEventType { SyntheticMouseEvent, NonSyntheticMouseEvent}; - static PassRefPtr<MouseEventDispatchMediator> create(PassRefPtr<MouseEvent>, MouseEventType = NonSyntheticMouseEvent); + static PassRefPtr<MouseEventDispatchMediator> create(PassRefPtrWillBeRawPtr<MouseEvent>, MouseEventType = NonSyntheticMouseEvent); private: - explicit MouseEventDispatchMediator(PassRefPtr<MouseEvent>, MouseEventType); + explicit MouseEventDispatchMediator(PassRefPtrWillBeRawPtr<MouseEvent>, MouseEventType); MouseEvent* event() const; virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; diff --git a/third_party/WebKit/Source/core/events/TouchEvent.cpp b/third_party/WebKit/Source/core/events/TouchEvent.cpp index 2ad203e..bdd908c 100644 --- a/third_party/WebKit/Source/core/events/TouchEvent.cpp +++ b/third_party/WebKit/Source/core/events/TouchEvent.cpp @@ -95,12 +95,12 @@ void TouchEvent::trace(Visitor* visitor) MouseRelatedEvent::trace(visitor); } -PassRefPtr<TouchEventDispatchMediator> TouchEventDispatchMediator::create(PassRefPtr<TouchEvent> touchEvent) +PassRefPtr<TouchEventDispatchMediator> TouchEventDispatchMediator::create(PassRefPtrWillBeRawPtr<TouchEvent> touchEvent) { return adoptRef(new TouchEventDispatchMediator(touchEvent)); } -TouchEventDispatchMediator::TouchEventDispatchMediator(PassRefPtr<TouchEvent> touchEvent) +TouchEventDispatchMediator::TouchEventDispatchMediator(PassRefPtrWillBeRawPtr<TouchEvent> touchEvent) : EventDispatchMediator(touchEvent) { } diff --git a/third_party/WebKit/Source/core/events/TouchEvent.h b/third_party/WebKit/Source/core/events/TouchEvent.h index dcdfea9..7938e82 100644 --- a/third_party/WebKit/Source/core/events/TouchEvent.h +++ b/third_party/WebKit/Source/core/events/TouchEvent.h @@ -87,10 +87,10 @@ private: class TouchEventDispatchMediator FINAL : public EventDispatchMediator { public: - static PassRefPtr<TouchEventDispatchMediator> create(PassRefPtr<TouchEvent>); + static PassRefPtr<TouchEventDispatchMediator> create(PassRefPtrWillBeRawPtr<TouchEvent>); private: - explicit TouchEventDispatchMediator(PassRefPtr<TouchEvent>); + explicit TouchEventDispatchMediator(PassRefPtrWillBeRawPtr<TouchEvent>); TouchEvent* event() const; virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; }; diff --git a/third_party/WebKit/Source/core/frame/DOMWindow.cpp b/third_party/WebKit/Source/core/frame/DOMWindow.cpp index 05d1d21..8303f2e 100644 --- a/third_party/WebKit/Source/core/frame/DOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/DOMWindow.cpp @@ -124,7 +124,7 @@ public: { } - PassRefPtr<MessageEvent> event() + PassRefPtrWillBeRawPtr<MessageEvent> event() { return MessageEvent::create(m_channels.release(), m_message, m_origin, String(), m_source.get()); @@ -422,7 +422,7 @@ EventQueue* DOMWindow::eventQueue() const return m_eventQueue.get(); } -void DOMWindow::enqueueWindowEvent(PassRefPtr<Event> event) +void DOMWindow::enqueueWindowEvent(PassRefPtrWillBeRawPtr<Event> event) { if (!m_eventQueue) return; @@ -430,7 +430,7 @@ void DOMWindow::enqueueWindowEvent(PassRefPtr<Event> event) m_eventQueue->enqueueEvent(event); } -void DOMWindow::enqueueDocumentEvent(PassRefPtr<Event> event) +void DOMWindow::enqueueDocumentEvent(PassRefPtrWillBeRawPtr<Event> event) { if (!m_eventQueue) return; @@ -866,7 +866,7 @@ void DOMWindow::postMessageTimerFired(PassOwnPtr<PostMessageTimer> t) if (!isCurrentlyDisplayedInFrame()) return; - RefPtr<MessageEvent> event = timer->event(); + RefPtrWillBeRawPtr<MessageEvent> event = timer->event(); // Give the embedder a chance to intercept this postMessage because this // DOMWindow might be a proxy for another in browsers that support @@ -880,7 +880,7 @@ void DOMWindow::postMessageTimerFired(PassOwnPtr<PostMessageTimer> t) dispatchMessageEventWithOriginCheck(timer->targetOrigin(), event, timer->stackTrace()); } -void DOMWindow::dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTargetOrigin, PassRefPtr<Event> event, PassRefPtr<ScriptCallStack> stackTrace) +void DOMWindow::dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTargetOrigin, PassRefPtrWillBeRawPtr<Event> event, PassRefPtr<ScriptCallStack> stackTrace) { if (intendedTargetOrigin) { // Check target origin now since the target document may have changed since the timer was scheduled. @@ -1571,7 +1571,7 @@ bool DOMWindow::removeEventListener(const AtomicString& eventType, EventListener void DOMWindow::dispatchLoadEvent() { - RefPtr<Event> loadEvent(Event::create(EventTypeNames::load)); + RefPtrWillBeRawPtr<Event> loadEvent(Event::create(EventTypeNames::load)); if (m_frame && m_frame->loader().documentLoader() && !m_frame->loader().documentLoader()->timing()->loadEventStart()) { // The DocumentLoader (and thus its DocumentLoadTiming) might get destroyed while dispatching // the event, so protect it to prevent writing the end time into freed memory. @@ -1593,12 +1593,12 @@ void DOMWindow::dispatchLoadEvent() InspectorInstrumentation::loadEventFired(frame()); } -bool DOMWindow::dispatchEvent(PassRefPtr<Event> prpEvent, PassRefPtr<EventTarget> prpTarget) +bool DOMWindow::dispatchEvent(PassRefPtrWillBeRawPtr<Event> prpEvent, PassRefPtr<EventTarget> prpTarget) { ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); RefPtr<EventTarget> protect = this; - RefPtr<Event> event = prpEvent; + RefPtrWillBeRawPtr<Event> event = prpEvent; event->setTarget(prpTarget ? prpTarget : this); event->setCurrentTarget(this); diff --git a/third_party/WebKit/Source/core/frame/DOMWindow.h b/third_party/WebKit/Source/core/frame/DOMWindow.h index db4865a..8711de6 100644 --- a/third_party/WebKit/Source/core/frame/DOMWindow.h +++ b/third_party/WebKit/Source/core/frame/DOMWindow.h @@ -231,7 +231,7 @@ enum PageshowEventPersistence { void postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePortArray*, const String& targetOrigin, DOMWindow* source, ExceptionState&); void postMessageTimerFired(PassOwnPtr<PostMessageTimer>); - void dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTargetOrigin, PassRefPtr<Event>, PassRefPtr<ScriptCallStack>); + void dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTargetOrigin, PassRefPtrWillBeRawPtr<Event>, PassRefPtr<ScriptCallStack>); void scrollBy(int x, int y, const Dictionary& scrollOptions, ExceptionState&) const; void scrollTo(int x, int y, const Dictionary& scrollOptions, ExceptionState&) const; @@ -257,7 +257,7 @@ enum PageshowEventPersistence { virtual void removeAllEventListeners() OVERRIDE; using EventTarget::dispatchEvent; - bool dispatchEvent(PassRefPtr<Event> prpEvent, PassRefPtr<EventTarget> prpTarget); + bool dispatchEvent(PassRefPtrWillBeRawPtr<Event> prpEvent, PassRefPtr<EventTarget> prpTarget); void dispatchLoadEvent(); @@ -314,8 +314,8 @@ enum PageshowEventPersistence { PassOwnPtr<LifecycleNotifier<DOMWindow> > createLifecycleNotifier(); EventQueue* eventQueue() const; - void enqueueWindowEvent(PassRefPtr<Event>); - void enqueueDocumentEvent(PassRefPtr<Event>); + void enqueueWindowEvent(PassRefPtrWillBeRawPtr<Event>); + void enqueueDocumentEvent(PassRefPtrWillBeRawPtr<Event>); void enqueuePageshowEvent(PageshowEventPersistence); void enqueueHashchangeEvent(const String& oldURL, const String& newURL); void enqueuePopstateEvent(PassRefPtr<SerializedScriptValue>); diff --git a/third_party/WebKit/Source/core/frame/DeviceSensorEventController.cpp b/third_party/WebKit/Source/core/frame/DeviceSensorEventController.cpp index 4046775..912ce1d 100644 --- a/third_party/WebKit/Source/core/frame/DeviceSensorEventController.cpp +++ b/third_party/WebKit/Source/core/frame/DeviceSensorEventController.cpp @@ -56,12 +56,12 @@ void DeviceSensorEventController::fireDeviceEvent(Timer<DeviceSensorEventControl dispatchDeviceEvent(getLastEvent()); } -void DeviceSensorEventController::dispatchDeviceEvent(PassRefPtr<Event> prpEvent) +void DeviceSensorEventController::dispatchDeviceEvent(PassRefPtrWillBeRawPtr<Event> prpEvent) { if (!m_document.domWindow() || m_document.activeDOMObjectsAreSuspended() || m_document.activeDOMObjectsAreStopped()) return; - RefPtr<Event> event = prpEvent; + RefPtrWillBeRawPtr<Event> event = prpEvent; m_document.domWindow()->dispatchEvent(event); if (m_needsCheckingNullEvents) { diff --git a/third_party/WebKit/Source/core/frame/DeviceSensorEventController.h b/third_party/WebKit/Source/core/frame/DeviceSensorEventController.h index 0b0950c..085f1e2 100644 --- a/third_party/WebKit/Source/core/frame/DeviceSensorEventController.h +++ b/third_party/WebKit/Source/core/frame/DeviceSensorEventController.h @@ -44,10 +44,10 @@ protected: explicit DeviceSensorEventController(Document&); virtual ~DeviceSensorEventController(); - void dispatchDeviceEvent(const PassRefPtr<Event>); + void dispatchDeviceEvent(const PassRefPtrWillBeRawPtr<Event>); virtual bool hasLastData() = 0; - virtual PassRefPtr<Event> getLastEvent() = 0; + virtual PassRefPtrWillBeRawPtr<Event> getLastEvent() = 0; virtual void registerWithDispatcher() = 0; virtual void unregisterWithDispatcher() = 0; virtual bool isNullEvent(Event*) = 0; diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp index 0df8bfb..ada21e0 100644 --- a/third_party/WebKit/Source/core/frame/FrameView.cpp +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp @@ -2303,7 +2303,7 @@ void FrameView::updateOverflowStatus(bool horizontalOverflow, bool verticalOverf m_horizontalOverflow = horizontalOverflow; m_verticalOverflow = verticalOverflow; - RefPtr<OverflowEvent> event = OverflowEvent::create(horizontalOverflowChanged, horizontalOverflow, verticalOverflowChanged, verticalOverflow); + RefPtrWillBeRawPtr<OverflowEvent> event = OverflowEvent::create(horizontalOverflowChanged, horizontalOverflow, verticalOverflowChanged, verticalOverflow); event->setTarget(m_viewportRenderer->node()); m_frame->document()->enqueueAnimationFrameEvent(event.release()); } diff --git a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp index 2517a6f..abb17ff 100644 --- a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp @@ -435,7 +435,7 @@ void HTMLFormElement::requestAutocomplete() void HTMLFormElement::finishRequestAutocomplete(AutocompleteResult result) { - RefPtr<Event> event; + RefPtrWillBeRawPtr<Event> event = nullptr; if (result == AutocompleteResultSuccess) event = Event::create(EventTypeNames::autocomplete); else if (result == AutocompleteResultErrorDisabled) @@ -444,6 +444,8 @@ void HTMLFormElement::finishRequestAutocomplete(AutocompleteResult result) event = AutocompleteErrorEvent::create("cancel"); else if (result == AutocompleteResultErrorInvalid) event = AutocompleteErrorEvent::create("invalid"); + else + ASSERT_NOT_REACHED(); event->setTarget(this); m_pendingAutocompleteEvents.append(event.release()); @@ -455,7 +457,7 @@ void HTMLFormElement::finishRequestAutocomplete(AutocompleteResult result) void HTMLFormElement::requestAutocompleteTimerFired(Timer<HTMLFormElement>*) { - Vector<RefPtr<Event> > pendingEvents; + WillBeHeapVector<RefPtrWillBeMember<Event> > pendingEvents; m_pendingAutocompleteEvents.swap(pendingEvents); for (size_t i = 0; i < pendingEvents.size(); ++i) dispatchEvent(pendingEvents[i].release()); diff --git a/third_party/WebKit/Source/core/html/HTMLFormElement.h b/third_party/WebKit/Source/core/html/HTMLFormElement.h index 4af4cfe..bcff831 100644 --- a/third_party/WebKit/Source/core/html/HTMLFormElement.h +++ b/third_party/WebKit/Source/core/html/HTMLFormElement.h @@ -179,7 +179,7 @@ private: void requestAutocompleteTimerFired(Timer<HTMLFormElement>*); - Vector<RefPtr<Event> > m_pendingAutocompleteEvents; + WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_pendingAutocompleteEvents; Timer<HTMLFormElement> m_requestAutocompleteTimer; }; diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp index 5c6291c..cde36bc 100644 --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp @@ -513,7 +513,7 @@ void HTMLMediaElement::scheduleEvent(const AtomicString& eventName) scheduleEvent(Event::createCancelable(eventName)); } -void HTMLMediaElement::scheduleEvent(PassRefPtr<Event> event) +void HTMLMediaElement::scheduleEvent(PassRefPtrWillBeRawPtr<Event> event) { #if LOG_MEDIA_EVENTS WTF_LOG(Media, "HTMLMediaElement::scheduleEvent - scheduling '%s'", event->type().ascii().data()); @@ -1088,7 +1088,7 @@ void HTMLMediaElement::updateActiveTextTrackCues(double movieTime) affectedTracks.append(eventTasks[i].second->track()); // 13 - Queue each task in events, in list order. - RefPtr<Event> event; + RefPtrWillBeRawPtr<Event> event = nullptr; // Each event in eventTasks may be either an enterEvent or an exitEvent, // depending on the time that is associated with the event. This @@ -1120,7 +1120,7 @@ void HTMLMediaElement::updateActiveTextTrackCues(double movieTime) // 15 - For each text track in affected tracks, in the list order, queue a // task to fire a simple event named cuechange at the TextTrack object, and, ... for (size_t i = 0; i < affectedTracks.size(); ++i) { - RefPtr<Event> event = Event::create(EventTypeNames::cuechange); + RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::cuechange); event->setTarget(affectedTracks[i]); m_asyncEventQueue->enqueueEvent(event.release()); @@ -1128,7 +1128,7 @@ void HTMLMediaElement::updateActiveTextTrackCues(double movieTime) // ... if the text track has a corresponding track element, to then fire a // simple event named cuechange at the track element as well. if (affectedTracks[i]->trackType() == TextTrack::TrackElement) { - RefPtr<Event> event = Event::create(EventTypeNames::cuechange); + RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::cuechange); HTMLTrackElement* trackElement = static_cast<LoadableTextTrack*>(affectedTracks[i])->trackElement(); ASSERT(trackElement); event->setTarget(trackElement); diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.h b/third_party/WebKit/Source/core/html/HTMLMediaElement.h index 6b9f538..1f054c9 100644 --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.h +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.h @@ -263,7 +263,7 @@ public: MediaController* controller() const; void setController(PassRefPtr<MediaController>); // Resets the MediaGroup and sets the MediaController. - void scheduleEvent(PassRefPtr<Event>); + void scheduleEvent(PassRefPtrWillBeRawPtr<Event>); // Current volume that should be used by the webMediaPlayer(). This method takes muted state // and m_mediaController multipliers into account. diff --git a/third_party/WebKit/Source/core/html/MediaController.cpp b/third_party/WebKit/Source/core/html/MediaController.cpp index 804b52f..1ea85f7 100644 --- a/third_party/WebKit/Source/core/html/MediaController.cpp +++ b/third_party/WebKit/Source/core/html/MediaController.cpp @@ -599,7 +599,7 @@ void MediaController::scheduleEvent(const AtomicString& eventName) void MediaController::asyncEventTimerFired(Timer<MediaController>*) { - Vector<RefPtr<Event> > pendingEvents; + WillBeHeapVector<RefPtrWillBeMember<Event> > pendingEvents; m_pendingEvents.swap(pendingEvents); size_t count = pendingEvents.size(); diff --git a/third_party/WebKit/Source/core/html/MediaController.h b/third_party/WebKit/Source/core/html/MediaController.h index 19a4598..c1bfe79 100644 --- a/third_party/WebKit/Source/core/html/MediaController.h +++ b/third_party/WebKit/Source/core/html/MediaController.h @@ -117,7 +117,7 @@ private: bool m_muted; ReadyState m_readyState; PlaybackState m_playbackState; - Vector<RefPtr<Event> > m_pendingEvents; + WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_pendingEvents; Timer<MediaController> m_asyncEventTimer; mutable Timer<MediaController> m_clearPositionTimer; OwnPtr<Clock> m_clock; diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.cpp index 633ca4a..84a4294 100644 --- a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.cpp +++ b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.cpp @@ -163,7 +163,7 @@ void CanvasRenderingContext2D::restoreContext() void CanvasRenderingContext2D::dispatchContextLostEvent(Timer<CanvasRenderingContext2D>*) { if (contextLostRestoredEventsEnabled()) { - RefPtr<Event> event(Event::createCancelable(EventTypeNames::contextlost)); + RefPtrWillBeRawPtr<Event> event = Event::createCancelable(EventTypeNames::contextlost); canvas()->dispatchEvent(event); if (event->defaultPrevented()) { m_contextRestorable = false; @@ -208,7 +208,7 @@ void CanvasRenderingContext2D::dispatchContextRestoredEvent(Timer<CanvasRenderin reset(); m_isContextLost = false; if (contextLostRestoredEventsEnabled()) { - RefPtr<Event> event(Event::create(EventTypeNames::contextrestored)); + RefPtrWillBeRawPtr<Event> event(Event::create(EventTypeNames::contextrestored)); canvas()->dispatchEvent(event); } } diff --git a/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContextBase.cpp index f433435..d24a8b3 100644 --- a/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContextBase.cpp +++ b/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContextBase.cpp @@ -5339,7 +5339,7 @@ void WebGLRenderingContextBase::vertexAttribfvImpl(const char* functionName, GLu void WebGLRenderingContextBase::dispatchContextLostEvent(Timer<WebGLRenderingContextBase>*) { - RefPtr<WebGLContextEvent> event = WebGLContextEvent::create(EventTypeNames::webglcontextlost, false, true, ""); + RefPtrWillBeRawPtr<WebGLContextEvent> event = WebGLContextEvent::create(EventTypeNames::webglcontextlost, false, true, ""); canvas()->dispatchEvent(event); m_restoreAllowed = event->defaultPrevented(); deactivateContext(this, m_contextLostMode != RealLostContext && m_restoreAllowed); diff --git a/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp b/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp index a9bc5dc..b56cc13 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp @@ -85,7 +85,7 @@ static KURL documentURLForScriptExecution(Document* document) return document->frame()->document()->url(); } -inline PassRefPtr<Event> createScriptLoadEvent() +inline PassRefPtrWillBeRawPtr<Event> createScriptLoadEvent() { return Event::create(EventTypeNames::load); } diff --git a/third_party/WebKit/Source/core/html/track/TextTrackCue.cpp b/third_party/WebKit/Source/core/html/track/TextTrackCue.cpp index a89b462..ebf262f 100644 --- a/third_party/WebKit/Source/core/html/track/TextTrackCue.cpp +++ b/third_party/WebKit/Source/core/html/track/TextTrackCue.cpp @@ -146,7 +146,7 @@ void TextTrackCue::invalidateCueIndex() m_cueIndex = invalidCueIndex; } -bool TextTrackCue::dispatchEvent(PassRefPtr<Event> event) +bool TextTrackCue::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) { // When a TextTrack's mode is disabled: no cues are active, no events fired. if (!track() || track()->mode() == TextTrack::disabledKeyword()) diff --git a/third_party/WebKit/Source/core/html/track/TextTrackCue.h b/third_party/WebKit/Source/core/html/track/TextTrackCue.h index 6e9da46..fc9f940 100644 --- a/third_party/WebKit/Source/core/html/track/TextTrackCue.h +++ b/third_party/WebKit/Source/core/html/track/TextTrackCue.h @@ -72,7 +72,7 @@ public: void invalidateCueIndex(); using EventTarget::dispatchEvent; - virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE; + virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE; bool isActive(); void setIsActive(bool); diff --git a/third_party/WebKit/Source/core/loader/FormSubmission.cpp b/third_party/WebKit/Source/core/loader/FormSubmission.cpp index f422977..9791951 100644 --- a/third_party/WebKit/Source/core/loader/FormSubmission.cpp +++ b/third_party/WebKit/Source/core/loader/FormSubmission.cpp @@ -143,7 +143,7 @@ void FormSubmission::Attributes::copyFrom(const Attributes& other) m_acceptCharset = other.m_acceptCharset; } -inline FormSubmission::FormSubmission(Method method, const KURL& action, const AtomicString& target, const AtomicString& contentType, PassRefPtr<FormState> state, PassRefPtr<FormData> data, const String& boundary, PassRefPtr<Event> event) +inline FormSubmission::FormSubmission(Method method, const KURL& action, const AtomicString& target, const AtomicString& contentType, PassRefPtr<FormState> state, PassRefPtr<FormData> data, const String& boundary, PassRefPtrWillBeRawPtr<Event> event) : m_method(method) , m_action(action) , m_target(target) @@ -161,7 +161,7 @@ inline FormSubmission::FormSubmission(const String& result) { } -PassRefPtr<FormSubmission> FormSubmission::create(HTMLFormElement* form, const Attributes& attributes, PassRefPtr<Event> event, FormSubmissionTrigger trigger) +PassRefPtr<FormSubmission> FormSubmission::create(HTMLFormElement* form, const Attributes& attributes, PassRefPtrWillBeRawPtr<Event> event, FormSubmissionTrigger trigger) { ASSERT(form); diff --git a/third_party/WebKit/Source/core/loader/FormSubmission.h b/third_party/WebKit/Source/core/loader/FormSubmission.h index 0ed026c..43e41ec 100644 --- a/third_party/WebKit/Source/core/loader/FormSubmission.h +++ b/third_party/WebKit/Source/core/loader/FormSubmission.h @@ -32,6 +32,7 @@ #define FormSubmission_h #include "core/loader/FormState.h" +#include "heap/Handle.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/Referrer.h" @@ -92,7 +93,7 @@ public: String m_acceptCharset; }; - static PassRefPtr<FormSubmission> create(HTMLFormElement*, const Attributes&, PassRefPtr<Event> event, FormSubmissionTrigger); + static PassRefPtr<FormSubmission> create(HTMLFormElement*, const Attributes&, PassRefPtrWillBeRawPtr<Event>, FormSubmissionTrigger); void populateFrameLoadRequest(FrameLoadRequest&); @@ -112,7 +113,7 @@ public: const String& result() const { return m_result; } private: - FormSubmission(Method, const KURL& action, const AtomicString& target, const AtomicString& contentType, PassRefPtr<FormState>, PassRefPtr<FormData>, const String& boundary, PassRefPtr<Event>); + FormSubmission(Method, const KURL& action, const AtomicString& target, const AtomicString& contentType, PassRefPtr<FormState>, PassRefPtr<FormData>, const String& boundary, PassRefPtrWillBeRawPtr<Event>); // FormSubmission for DialogMethod FormSubmission(const String& result); @@ -124,7 +125,7 @@ private: RefPtr<FormState> m_formState; RefPtr<FormData> m_formData; String m_boundary; - RefPtr<Event> m_event; + RefPtrWillBePersistent<Event> m_event; Referrer m_referrer; String m_origin; String m_result; diff --git a/third_party/WebKit/Source/core/loader/FrameLoadRequest.h b/third_party/WebKit/Source/core/loader/FrameLoadRequest.h index 5b29d4d..cce34bc 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoadRequest.h +++ b/third_party/WebKit/Source/core/loader/FrameLoadRequest.h @@ -92,7 +92,7 @@ public: void setClientRedirect(ClientRedirectPolicy clientRedirect) { m_clientRedirect = clientRedirect; } Event* triggeringEvent() const { return m_triggeringEvent.get(); } - void setTriggeringEvent(PassRefPtr<Event> triggeringEvent) { m_triggeringEvent = triggeringEvent; } + void setTriggeringEvent(PassRefPtrWillBeRawPtr<Event> triggeringEvent) { m_triggeringEvent = triggeringEvent; } FormState* formState() const { return m_formState.get(); } void setFormState(PassRefPtr<FormState> formState) { m_formState = formState; } @@ -107,7 +107,7 @@ private: SubstituteData m_substituteData; bool m_lockBackForwardList; ClientRedirectPolicy m_clientRedirect; - RefPtr<Event> m_triggeringEvent; + RefPtrWillBePersistent<Event> m_triggeringEvent; RefPtr<FormState> m_formState; ShouldSendReferrer m_shouldSendReferrer; }; diff --git a/third_party/WebKit/Source/core/loader/NavigationAction.cpp b/third_party/WebKit/Source/core/loader/NavigationAction.cpp index 0785372..c774000 100644 --- a/third_party/WebKit/Source/core/loader/NavigationAction.cpp +++ b/third_party/WebKit/Source/core/loader/NavigationAction.cpp @@ -55,10 +55,10 @@ NavigationAction::NavigationAction() } NavigationAction::NavigationAction(const ResourceRequest& resourceRequest, FrameLoadType frameLoadType, - bool isFormSubmission, PassRefPtr<Event> passEvent) + bool isFormSubmission, PassRefPtrWillBeRawPtr<Event> passEvent) : m_resourceRequest(resourceRequest) { - RefPtr<Event> event = passEvent; + RefPtrWillBeRawPtr<Event> event = passEvent; m_type = navigationType(frameLoadType, isFormSubmission || resourceRequest.httpBody(), event); m_eventTimeStamp = event ? event->timeStamp() : 0; diff --git a/third_party/WebKit/Source/core/loader/NavigationAction.h b/third_party/WebKit/Source/core/loader/NavigationAction.h index 54e6bd7..2b19949 100644 --- a/third_party/WebKit/Source/core/loader/NavigationAction.h +++ b/third_party/WebKit/Source/core/loader/NavigationAction.h @@ -42,7 +42,7 @@ namespace WebCore { class NavigationAction { public: NavigationAction(); - NavigationAction(const ResourceRequest&, FrameLoadType = FrameLoadTypeStandard, bool isFormSubmission = false, PassRefPtr<Event> = nullptr); + NavigationAction(const ResourceRequest&, FrameLoadType = FrameLoadTypeStandard, bool isFormSubmission = false, PassRefPtrWillBeRawPtr<Event> = nullptr); const ResourceRequest& resourceRequest() const { return m_resourceRequest; } NavigationType type() const { return m_type; } diff --git a/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp b/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp index 8db7d24..669eb54 100644 --- a/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp +++ b/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp @@ -216,7 +216,7 @@ void ApplicationCacheHost::dispatchDOMEvent(EventID id, int progressTotal, int p { if (m_domApplicationCache) { const AtomicString& eventType = ApplicationCache::toEventType(id); - RefPtr<Event> event; + RefPtrWillBeRawPtr<Event> event = nullptr; if (id == PROGRESS_EVENT) event = ProgressEvent::create(eventType, true, progressDone, progressTotal); else if (id == ERROR_EVENT) diff --git a/third_party/WebKit/Source/core/page/EventHandler.cpp b/third_party/WebKit/Source/core/page/EventHandler.cpp index 0c406dd..4166b0b 100644 --- a/third_party/WebKit/Source/core/page/EventHandler.cpp +++ b/third_party/WebKit/Source/core/page/EventHandler.cpp @@ -1749,7 +1749,7 @@ bool EventHandler::dispatchDragEvent(const AtomicString& eventType, Node* dragTa if (!view) return false; - RefPtr<MouseEvent> me = MouseEvent::create(eventType, + RefPtrWillBeRawPtr<MouseEvent> me = MouseEvent::create(eventType, true, true, m_frame->document()->domWindow(), 0, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y(), event.movementDelta().x(), event.movementDelta().y(), @@ -3128,7 +3128,7 @@ bool EventHandler::keyEvent(const PlatformKeyboardEvent& initialKeyEvent) PlatformKeyboardEvent keyDownEvent = initialKeyEvent; if (keyDownEvent.type() != PlatformEvent::RawKeyDown) keyDownEvent.disambiguateKeyDownEvent(PlatformEvent::RawKeyDown); - RefPtr<KeyboardEvent> keydown = KeyboardEvent::create(keyDownEvent, m_frame->document()->domWindow()); + RefPtrWillBeRawPtr<KeyboardEvent> keydown = KeyboardEvent::create(keyDownEvent, m_frame->document()->domWindow()); if (matchedAnAccessKey) keydown->setDefaultPrevented(true); keydown->setTarget(node); @@ -3157,7 +3157,7 @@ bool EventHandler::keyEvent(const PlatformKeyboardEvent& initialKeyEvent) keyPressEvent.disambiguateKeyDownEvent(PlatformEvent::Char); if (keyPressEvent.text().isEmpty()) return keydownResult; - RefPtr<KeyboardEvent> keypress = KeyboardEvent::create(keyPressEvent, m_frame->document()->domWindow()); + RefPtrWillBeRawPtr<KeyboardEvent> keypress = KeyboardEvent::create(keyPressEvent, m_frame->document()->domWindow()); keypress->setTarget(node); if (keydownResult) keypress->setDefaultPrevented(true); @@ -3409,7 +3409,7 @@ bool EventHandler::handleTextInputEvent(const String& text, Event* underlyingEve if (!target) return false; - RefPtr<TextEvent> event = TextEvent::create(m_frame->domWindow(), text, inputType); + RefPtrWillBeRawPtr<TextEvent> event = TextEvent::create(m_frame->domWindow(), text, inputType); event->setUnderlyingEvent(underlyingEvent); target->dispatchEvent(event, IGNORE_EXCEPTION); @@ -3784,7 +3784,7 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event) RefPtrWillBeRawPtr<TouchList> targetTouches(isTouchCancelEvent ? emptyList.get() : touchesByTarget.get(touchEventTarget)); ASSERT(targetTouches); - RefPtr<TouchEvent> touchEvent = + RefPtrWillBeRawPtr<TouchEvent> touchEvent = TouchEvent::create(effectiveTouches.get(), targetTouches.get(), changedTouches[state].m_touches.get(), stateName, touchEventTarget->toNode()->document().domWindow(), 0, 0, 0, 0, event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey()); diff --git a/third_party/WebKit/Source/core/page/EventSource.cpp b/third_party/WebKit/Source/core/page/EventSource.cpp index 5d51d01..f76f2fc 100644 --- a/third_party/WebKit/Source/core/page/EventSource.cpp +++ b/third_party/WebKit/Source/core/page/EventSource.cpp @@ -424,9 +424,9 @@ void EventSource::stop() close(); } -PassRefPtr<MessageEvent> EventSource::createMessageEvent() +PassRefPtrWillBeRawPtr<MessageEvent> EventSource::createMessageEvent() { - RefPtr<MessageEvent> event = MessageEvent::create(); + RefPtrWillBeRawPtr<MessageEvent> event = MessageEvent::create(); event->initMessageEvent(m_eventName.isEmpty() ? EventTypeNames::message : m_eventName, false, false, SerializedScriptValue::create(String(m_data)), m_eventStreamOrigin, m_lastEventId, 0, nullptr); m_data.clear(); return event.release(); diff --git a/third_party/WebKit/Source/core/page/EventSource.h b/third_party/WebKit/Source/core/page/EventSource.h index 81e7751..85f6cfc 100644 --- a/third_party/WebKit/Source/core/page/EventSource.h +++ b/third_party/WebKit/Source/core/page/EventSource.h @@ -107,7 +107,7 @@ private: void abortConnectionAttempt(); void parseEventStream(); void parseEventStreamLine(unsigned pos, int fieldLength, int lineLength); - PassRefPtr<MessageEvent> createMessageEvent(); + PassRefPtrWillBeRawPtr<MessageEvent> createMessageEvent(); KURL m_url; bool m_withCredentials; diff --git a/third_party/WebKit/Source/core/rendering/RenderBlock.cpp b/third_party/WebKit/Source/core/rendering/RenderBlock.cpp index 7d61703..82166b8 100644 --- a/third_party/WebKit/Source/core/rendering/RenderBlock.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderBlock.cpp @@ -140,7 +140,7 @@ public: if (!horizontalLayoutOverflowChanged && !verticalLayoutOverflowChanged) return; - RefPtr<OverflowEvent> event = OverflowEvent::create(horizontalLayoutOverflowChanged, hasHorizontalLayoutOverflow, verticalLayoutOverflowChanged, hasVerticalLayoutOverflow); + RefPtrWillBeRawPtr<OverflowEvent> event = OverflowEvent::create(horizontalLayoutOverflowChanged, hasHorizontalLayoutOverflow, verticalLayoutOverflowChanged, hasVerticalLayoutOverflow); event->setTarget(m_block->node()); m_block->document().enqueueAnimationFrameEvent(event.release()); } diff --git a/third_party/WebKit/Source/core/svg/SVGDocument.cpp b/third_party/WebKit/Source/core/svg/SVGDocument.cpp index a32718f..10ac8e6 100644 --- a/third_party/WebKit/Source/core/svg/SVGDocument.cpp +++ b/third_party/WebKit/Source/core/svg/SVGDocument.cpp @@ -51,7 +51,7 @@ SVGSVGElement* SVGDocument::rootElement() const void SVGDocument::dispatchZoomEvent(float prevScale, float newScale) { - RefPtr<SVGZoomEvent> event = SVGZoomEvent::create(); + RefPtrWillBeRawPtr<SVGZoomEvent> event = SVGZoomEvent::create(); event->initEvent(EventTypeNames::zoom, true, false); event->setPreviousScale(prevScale); event->setNewScale(newScale); @@ -60,7 +60,7 @@ void SVGDocument::dispatchZoomEvent(float prevScale, float newScale) void SVGDocument::dispatchScrollEvent() { - RefPtr<Event> event = Event::create(); + RefPtrWillBeRawPtr<Event> event = Event::create(); event->initEvent(EventTypeNames::scroll, true, false); rootElement()->dispatchEvent(event.release(), IGNORE_EXCEPTION); } diff --git a/third_party/WebKit/Source/core/svg/SVGElementInstance.cpp b/third_party/WebKit/Source/core/svg/SVGElementInstance.cpp index 52145a0..c735d82 100644 --- a/third_party/WebKit/Source/core/svg/SVGElementInstance.cpp +++ b/third_party/WebKit/Source/core/svg/SVGElementInstance.cpp @@ -234,7 +234,7 @@ Document* SVGElementInstance::ownerDocument() const return m_element ? m_element->ownerDocument() : 0; } -bool SVGElementInstance::dispatchEvent(PassRefPtr<Event> event) +bool SVGElementInstance::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) { SVGElement* element = shadowTreeElement(); if (!element) diff --git a/third_party/WebKit/Source/core/svg/SVGElementInstance.h b/third_party/WebKit/Source/core/svg/SVGElementInstance.h index d5b08e8..6021106 100644 --- a/third_party/WebKit/Source/core/svg/SVGElementInstance.h +++ b/third_party/WebKit/Source/core/svg/SVGElementInstance.h @@ -55,7 +55,7 @@ public: virtual void removeAllEventListeners() OVERRIDE; using EventTarget::dispatchEvent; - virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE; + virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE; SVGElement* correspondingElement() const { return m_element.get(); } SVGUseElement* correspondingUseElement() const { return m_correspondingUseElement; } diff --git a/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.cpp index b45fe49..0332b1a 100644 --- a/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.cpp +++ b/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.cpp @@ -41,10 +41,10 @@ namespace WebCore { -PassRefPtr<MessageEvent> createConnectEvent(PassRefPtr<MessagePort> prpPort) +PassRefPtrWillBeRawPtr<MessageEvent> createConnectEvent(PassRefPtr<MessagePort> prpPort) { RefPtr<MessagePort> port = prpPort; - RefPtr<MessageEvent> event = MessageEvent::create(adoptPtr(new MessagePortArray(1, port)), String(), String(), port); + RefPtrWillBeRawPtr<MessageEvent> event = MessageEvent::create(adoptPtr(new MessagePortArray(1, port)), String(), String(), port); event->initEvent(EventTypeNames::connect, false, false); return event.release(); } diff --git a/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.h b/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.h index 376d524..e7a47c9 100644 --- a/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.h +++ b/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.h @@ -67,7 +67,7 @@ namespace WebCore { String m_name; }; - PassRefPtr<MessageEvent> createConnectEvent(PassRefPtr<MessagePort>); + PassRefPtrWillBeRawPtr<MessageEvent> createConnectEvent(PassRefPtr<MessagePort>); } // namespace WebCore diff --git a/third_party/WebKit/Source/core/workers/WorkerEventQueue.cpp b/third_party/WebKit/Source/core/workers/WorkerEventQueue.cpp index 6e9d01f..2a54e66 100644 --- a/third_party/WebKit/Source/core/workers/WorkerEventQueue.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerEventQueue.cpp @@ -51,7 +51,7 @@ WorkerEventQueue::~WorkerEventQueue() class WorkerEventQueue::EventDispatcherTask : public ExecutionContextTask { public: - static PassOwnPtr<EventDispatcherTask> create(PassRefPtr<Event> event, WorkerEventQueue* eventQueue) + static PassOwnPtr<EventDispatcherTask> create(PassRefPtrWillBeRawPtr<Event> event, WorkerEventQueue* eventQueue) { return adoptPtr(new EventDispatcherTask(event, eventQueue)); } @@ -62,7 +62,7 @@ public: m_eventQueue->removeEvent(m_event.get()); } - void dispatchEvent(ExecutionContext*, PassRefPtr<Event> event) + void dispatchEvent(ExecutionContext*, PassRefPtrWillBeRawPtr<Event> event) { event->target()->dispatchEvent(event); } @@ -83,14 +83,14 @@ public: } private: - EventDispatcherTask(PassRefPtr<Event> event, WorkerEventQueue* eventQueue) + EventDispatcherTask(PassRefPtrWillBeRawPtr<Event> event, WorkerEventQueue* eventQueue) : m_event(event) , m_eventQueue(eventQueue) , m_isCancelled(false) { } - RefPtr<Event> m_event; + RefPtrWillBeRawPtr<Event> m_event; WorkerEventQueue* m_eventQueue; bool m_isCancelled; }; @@ -100,11 +100,11 @@ void WorkerEventQueue::removeEvent(Event* event) m_eventTaskMap.remove(event); } -bool WorkerEventQueue::enqueueEvent(PassRefPtr<Event> prpEvent) +bool WorkerEventQueue::enqueueEvent(PassRefPtrWillBeRawPtr<Event> prpEvent) { if (m_isClosed) return false; - RefPtr<Event> event = prpEvent; + RefPtrWillBeRawPtr<Event> event = prpEvent; OwnPtr<EventDispatcherTask> task = EventDispatcherTask::create(event, this); m_eventTaskMap.add(event.release(), task.get()); m_executionContext->postTask(task.release()); diff --git a/third_party/WebKit/Source/core/workers/WorkerEventQueue.h b/third_party/WebKit/Source/core/workers/WorkerEventQueue.h index cdbd169..a738f95 100644 --- a/third_party/WebKit/Source/core/workers/WorkerEventQueue.h +++ b/third_party/WebKit/Source/core/workers/WorkerEventQueue.h @@ -47,7 +47,7 @@ public: virtual ~WorkerEventQueue(); // EventQueue - virtual bool enqueueEvent(PassRefPtr<Event>) OVERRIDE; + virtual bool enqueueEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE; virtual bool cancelEvent(Event*) OVERRIDE; virtual void close() OVERRIDE; @@ -59,7 +59,7 @@ private: bool m_isClosed; class EventDispatcherTask; - typedef HashMap<RefPtr<Event>, EventDispatcherTask*> EventTaskMap; + typedef WillBePersistentHeapHashMap<RefPtrWillBeMember<Event>, EventDispatcherTask*> EventTaskMap; EventTaskMap m_eventTaskMap; }; diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp index 7078128..ceb06a0 100644 --- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp @@ -236,7 +236,7 @@ void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState InspectorInstrumentation::scriptImported(executionContext(), scriptLoader->identifier(), scriptLoader->script()); - RefPtr<ErrorEvent> errorEvent; + RefPtrWillBeRawPtr<ErrorEvent> errorEvent = nullptr; m_script->evaluate(ScriptSourceCode(scriptLoader->script(), scriptLoader->responseURL()), &errorEvent); if (errorEvent) { m_script->rethrowExceptionFromImportedScript(errorEvent.release()); diff --git a/third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp b/third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp index be37a1c..a7ee218 100644 --- a/third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp @@ -166,7 +166,7 @@ void WorkerMessagingProxy::reportException(const String& errorMessage, int lineN // We don't bother checking the askedToTerminate() flag here, because exceptions should *always* be reported even if the thread is terminated. // This is intentionally different than the behavior in MessageWorkerTask, because terminated workers no longer deliver messages (section 4.6 of the WebWorker spec), but they do report exceptions. - RefPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, sourceURL, lineNumber, columnNumber, 0); + RefPtrWillBeRawPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, sourceURL, lineNumber, columnNumber, 0); bool errorHandled = !m_workerObject->dispatchEvent(event); if (!errorHandled) m_executionContext->reportException(event, nullptr, NotSharableCrossOrigin); diff --git a/third_party/WebKit/Source/core/xml/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xml/XMLHttpRequest.cpp index 1a7e543..c0cbccd 100644 --- a/third_party/WebKit/Source/core/xml/XMLHttpRequest.cpp +++ b/third_party/WebKit/Source/core/xml/XMLHttpRequest.cpp @@ -1395,6 +1395,7 @@ void XMLHttpRequest::trace(Visitor* visitor) { visitor->trace(m_responseBlob); visitor->trace(m_responseStream); + visitor->trace(m_progressEventThrottle); } } // namespace WebCore diff --git a/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEventThrottle.cpp b/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEventThrottle.cpp index d651dc5..ac12df8 100644 --- a/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEventThrottle.cpp +++ b/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEventThrottle.cpp @@ -75,7 +75,7 @@ void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent(bool lengthCompu m_total = total; } -void XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent(PassRefPtr<Event> event, ProgressEventAction progressEventAction) +void XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent(PassRefPtrWillBeRawPtr<Event> event, ProgressEventAction progressEventAction) { if (progressEventAction == FlushProgressEvent || progressEventAction == FlushDeferredProgressEvent) { if (!flushDeferredProgressEvent() && progressEventAction == FlushProgressEvent) @@ -85,7 +85,7 @@ void XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent(PassRefP dispatchEvent(event); } -void XMLHttpRequestProgressEventThrottle::dispatchEvent(PassRefPtr<Event> event) +void XMLHttpRequestProgressEventThrottle::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) { ASSERT(event); if (m_deferEvents) { @@ -122,7 +122,7 @@ void XMLHttpRequestProgressEventThrottle::deliverProgressEvent() if (!hasEventToDispatch()) return; - PassRefPtr<Event> event = XMLHttpRequestProgressEvent::create(EventTypeNames::progress, m_lengthComputable, m_loaded, m_total); + RefPtrWillBeRawPtr<Event> event = XMLHttpRequestProgressEvent::create(EventTypeNames::progress, m_lengthComputable, m_loaded, m_total); m_loaded = 0; m_total = 0; @@ -139,14 +139,14 @@ void XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents(Timer<XMLHttpRe m_deferEvents = false; // Take over the deferred events before dispatching them which can potentially add more. - Vector<RefPtr<Event> > deferredEvents; + WillBeHeapVector<RefPtrWillBeMember<Event> > deferredEvents; m_deferredEvents.swap(deferredEvents); - RefPtr<Event> deferredProgressEvent = m_deferredProgressEvent; + RefPtrWillBeRawPtr<Event> deferredProgressEvent = m_deferredProgressEvent; m_deferredProgressEvent = nullptr; - Vector<RefPtr<Event> >::const_iterator it = deferredEvents.begin(); - const Vector<RefPtr<Event> >::const_iterator end = deferredEvents.end(); + WillBeHeapVector<RefPtrWillBeMember<Event> >::const_iterator it = deferredEvents.begin(); + const WillBeHeapVector<RefPtrWillBeMember<Event> >::const_iterator end = deferredEvents.end(); for (; it != end; ++it) dispatchEvent(*it); @@ -216,4 +216,10 @@ void XMLHttpRequestProgressEventThrottle::resume() m_dispatchDeferredEventsTimer.startOneShot(0, FROM_HERE); } +void XMLHttpRequestProgressEventThrottle::trace(Visitor* visitor) +{ + visitor->trace(m_deferredProgressEvent); + visitor->trace(m_deferredEvents); +} + } // namespace WebCore diff --git a/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEventThrottle.h b/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEventThrottle.h index 06681eb..1ba3db4 100644 --- a/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEventThrottle.h +++ b/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEventThrottle.h @@ -27,6 +27,7 @@ #ifndef XMLHttpRequestProgressEventThrottle_h #define XMLHttpRequestProgressEventThrottle_h +#include "heap/Handle.h" #include "platform/Timer.h" #include "wtf/PassRefPtr.h" #include "wtf/Vector.h" @@ -46,18 +47,21 @@ enum ProgressEventAction { // This implements the XHR2 progress event dispatching: "dispatch a progress event called progress // about every 50ms or for every byte received, whichever is least frequent". class XMLHttpRequestProgressEventThrottle FINAL : public TimerBase { + DISALLOW_ALLOCATION(); public: explicit XMLHttpRequestProgressEventThrottle(EventTarget*); virtual ~XMLHttpRequestProgressEventThrottle(); void dispatchProgressEvent(bool lengthComputable, unsigned long long loaded, unsigned long long total); - void dispatchReadyStateChangeEvent(PassRefPtr<Event>, ProgressEventAction = DoNotFlushProgressEvent); - void dispatchEvent(PassRefPtr<Event>); + void dispatchReadyStateChangeEvent(PassRefPtrWillBeRawPtr<Event>, ProgressEventAction = DoNotFlushProgressEvent); + void dispatchEvent(PassRefPtrWillBeRawPtr<Event>); void dispatchEventAndLoadEnd(const AtomicString&, bool, unsigned long long, unsigned long long); void suspend(); void resume(); + void trace(Visitor*); + private: static const double minimumProgressEventDispatchingIntervalInSeconds; @@ -76,8 +80,8 @@ private: unsigned long long m_total; bool m_deferEvents; - RefPtr<Event> m_deferredProgressEvent; - Vector<RefPtr<Event> > m_deferredEvents; + RefPtrWillBeMember<Event> m_deferredProgressEvent; + WillBeHeapVector<RefPtrWillBeMember<Event> > m_deferredEvents; Timer<XMLHttpRequestProgressEventThrottle> m_dispatchDeferredEventsTimer; }; diff --git a/third_party/WebKit/Source/heap/Handle.h b/third_party/WebKit/Source/heap/Handle.h index 4025e95..bf88b83 100644 --- a/third_party/WebKit/Source/heap/Handle.h +++ b/third_party/WebKit/Source/heap/Handle.h @@ -35,6 +35,7 @@ #include "heap/ThreadState.h" #include "heap/Visitor.h" +#include "wtf/HashFunctions.h" #include "wtf/Locker.h" #include "wtf/RawPtr.h" #include "wtf/RefCounted.h" @@ -884,6 +885,15 @@ template<typename T> struct PtrHash<WebCore::Member<T> > : PtrHash<T*> { template<typename T> struct PtrHash<WebCore::WeakMember<T> > : PtrHash<WebCore::Member<T> > { }; +template<typename P> struct PtrHash<WebCore::Persistent<P> > : PtrHash<P*> { + using PtrHash<P*>::hash; + static unsigned hash(const RefPtr<P>& key) { return hash(key.get()); } + using PtrHash<P*>::equal; + static bool equal(const RefPtr<P>& a, const RefPtr<P>& b) { return a == b; } + static bool equal(P* a, const RefPtr<P>& b) { return a == b; } + static bool equal(const RefPtr<P>& a, P* b) { return a == b; } +}; + // PtrHash is the default hash for hash tables with members. template<typename T> struct DefaultHash<WebCore::Member<T> > { typedef PtrHash<WebCore::Member<T> > Hash; @@ -893,6 +903,10 @@ template<typename T> struct DefaultHash<WebCore::WeakMember<T> > { typedef PtrHash<WebCore::WeakMember<T> > Hash; }; +template<typename T> struct DefaultHash<WebCore::Persistent<T> > { + typedef PtrHash<WebCore::Persistent<T> > Hash; +}; + template<typename T> struct NeedsTracing<WebCore::Member<T> > { static const bool value = true; diff --git a/third_party/WebKit/Source/modules/battery/BatteryManager.cpp b/third_party/WebKit/Source/modules/battery/BatteryManager.cpp index 3eb3b21..aa47375 100644 --- a/third_party/WebKit/Source/modules/battery/BatteryManager.cpp +++ b/third_party/WebKit/Source/modules/battery/BatteryManager.cpp @@ -60,7 +60,7 @@ double BatteryManager::level() return m_batteryStatus ? m_batteryStatus->level() : 1; } -void BatteryManager::didChangeBatteryStatus(PassRefPtr<Event> event, PassOwnPtr<BatteryStatus> batteryStatus) +void BatteryManager::didChangeBatteryStatus(PassRefPtrWillBeRawPtr<Event> event, PassOwnPtr<BatteryStatus> batteryStatus) { ASSERT(RuntimeEnabledFeatures::batteryStatusEnabled()); diff --git a/third_party/WebKit/Source/modules/battery/BatteryManager.h b/third_party/WebKit/Source/modules/battery/BatteryManager.h index 4df0497..fa7e8dc5 100644 --- a/third_party/WebKit/Source/modules/battery/BatteryManager.h +++ b/third_party/WebKit/Source/modules/battery/BatteryManager.h @@ -35,7 +35,7 @@ public: DEFINE_ATTRIBUTE_EVENT_LISTENER(dischargingtimechange); DEFINE_ATTRIBUTE_EVENT_LISTENER(levelchange); - void didChangeBatteryStatus(PassRefPtr<Event>, PassOwnPtr<BatteryStatus>); + void didChangeBatteryStatus(PassRefPtrWillBeRawPtr<Event>, PassOwnPtr<BatteryStatus>); void trace(Visitor*) { } diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp index 7dbe1cf..3a5e5b9 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp @@ -72,7 +72,7 @@ bool DeviceMotionController::hasLastData() return DeviceMotionDispatcher::instance().latestDeviceMotionData(); } -PassRefPtr<Event> DeviceMotionController::getLastEvent() +PassRefPtrWillBeRawPtr<Event> DeviceMotionController::getLastEvent() { return DeviceMotionEvent::create(EventTypeNames::devicemotion, DeviceMotionDispatcher::instance().latestDeviceMotionData()); } diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.h b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.h index 0498a50..2bfcbdf 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.h +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.h @@ -58,7 +58,7 @@ private: virtual void didRemoveAllEventListeners(DOMWindow*) OVERRIDE; virtual bool hasLastData() OVERRIDE; - virtual PassRefPtr<Event> getLastEvent() OVERRIDE; + virtual PassRefPtrWillBeRawPtr<Event> getLastEvent() OVERRIDE; virtual bool isNullEvent(Event*) OVERRIDE; }; diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.cpp b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.cpp index d78e016..a34d6e2 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.cpp +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.cpp @@ -79,7 +79,7 @@ bool DeviceOrientationController::hasLastData() return lastData(); } -PassRefPtr<Event> DeviceOrientationController::getLastEvent() +PassRefPtrWillBeRawPtr<Event> DeviceOrientationController::getLastEvent() { return DeviceOrientationEvent::create(EventTypeNames::deviceorientation, lastData()); } diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.h b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.h index db55578..e6b4623 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.h +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.h @@ -60,7 +60,7 @@ private: DeviceOrientationData* lastData(); virtual bool hasLastData() OVERRIDE; - virtual PassRefPtr<Event> getLastEvent() OVERRIDE; + virtual PassRefPtrWillBeRawPtr<Event> getLastEvent() OVERRIDE; virtual bool isNullEvent(Event*) OVERRIDE; RefPtrWillBePersistent<DeviceOrientationData> m_overrideOrientationData; diff --git a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp index bd6e2ff..e88ed8b 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp +++ b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp @@ -112,7 +112,7 @@ void HTMLMediaElementEncryptedMedia::setMediaKeys(HTMLMediaElement& element, Med } // Create a MediaKeyNeededEvent for WD EME. -static PassRefPtr<Event> createNeedKeyEvent(const String& contentType, const unsigned char* initData, unsigned initDataLength) +static PassRefPtrWillBeRawPtr<Event> createNeedKeyEvent(const String& contentType, const unsigned char* initData, unsigned initDataLength) { MediaKeyNeededEventInit initializer; initializer.contentType = contentType; @@ -124,7 +124,7 @@ static PassRefPtr<Event> createNeedKeyEvent(const String& contentType, const uns } // Create a 'needkey' MediaKeyEvent for v0.1b EME. -static PassRefPtr<Event> createWebkitNeedKeyEvent(const String& contentType, const unsigned char* initData, unsigned initDataLength) +static PassRefPtrWillBeRawPtr<Event> createWebkitNeedKeyEvent(const String& contentType, const unsigned char* initData, unsigned initDataLength) { MediaKeyEventInit webkitInitializer; webkitInitializer.keySystem = String(); @@ -258,7 +258,7 @@ void HTMLMediaElementEncryptedMedia::keyAdded(HTMLMediaElement& element, const S initializer.bubbles = false; initializer.cancelable = false; - RefPtr<Event> event = MediaKeyEvent::create(EventTypeNames::webkitkeyadded, initializer); + RefPtrWillBeRawPtr<Event> event = MediaKeyEvent::create(EventTypeNames::webkitkeyadded, initializer); event->setTarget(&element); element.scheduleEvent(event.release()); } @@ -297,7 +297,7 @@ void HTMLMediaElementEncryptedMedia::keyError(HTMLMediaElement& element, const S initializer.bubbles = false; initializer.cancelable = false; - RefPtr<Event> event = MediaKeyEvent::create(EventTypeNames::webkitkeyerror, initializer); + RefPtrWillBeRawPtr<Event> event = MediaKeyEvent::create(EventTypeNames::webkitkeyerror, initializer); event->setTarget(&element); element.scheduleEvent(event.release()); } @@ -314,7 +314,7 @@ void HTMLMediaElementEncryptedMedia::keyMessage(HTMLMediaElement& element, const initializer.bubbles = false; initializer.cancelable = false; - RefPtr<Event> event = MediaKeyEvent::create(EventTypeNames::webkitkeymessage, initializer); + RefPtrWillBeRawPtr<Event> event = MediaKeyEvent::create(EventTypeNames::webkitkeymessage, initializer); event->setTarget(&element); element.scheduleEvent(event.release()); } @@ -325,14 +325,14 @@ void HTMLMediaElementEncryptedMedia::keyNeeded(HTMLMediaElement& element, const if (RuntimeEnabledFeatures::encryptedMediaEnabled()) { // Send event for WD EME. - RefPtr<Event> event = createNeedKeyEvent(contentType, initData, initDataLength); + RefPtrWillBeRawPtr<Event> event = createNeedKeyEvent(contentType, initData, initDataLength); event->setTarget(&element); element.scheduleEvent(event.release()); } if (RuntimeEnabledFeatures::prefixedEncryptedMediaEnabled()) { // Send event for v0.1b EME. - RefPtr<Event> event = createWebkitNeedKeyEvent(contentType, initData, initDataLength); + RefPtrWillBeRawPtr<Event> event = createWebkitNeedKeyEvent(contentType, initData, initDataLength); event->setTarget(&element); element.scheduleEvent(event.release()); } diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp index 4a95124..b4949cb 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp @@ -185,7 +185,7 @@ void MediaKeySession::message(const unsigned char* message, size_t messageLength init.message = Uint8Array::create(message, messageLength); init.destinationURL = destinationURL.string(); - RefPtr<MediaKeyMessageEvent> event = MediaKeyMessageEvent::create(EventTypeNames::message, init); + RefPtrWillBeRawPtr<MediaKeyMessageEvent> event = MediaKeyMessageEvent::create(EventTypeNames::message, init); event->setTarget(this); m_asyncEventQueue->enqueueEvent(event.release()); } @@ -194,7 +194,7 @@ void MediaKeySession::ready() { WTF_LOG(Media, "MediaKeySession::ready"); - RefPtr<Event> event = Event::create(EventTypeNames::ready); + RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::ready); event->setTarget(this); m_asyncEventQueue->enqueueEvent(event.release()); } @@ -203,7 +203,7 @@ void MediaKeySession::close() { WTF_LOG(Media, "MediaKeySession::close"); - RefPtr<Event> event = Event::create(EventTypeNames::close); + RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::close); event->setTarget(this); m_asyncEventQueue->enqueueEvent(event.release()); @@ -234,7 +234,7 @@ void MediaKeySession::error(MediaKeyErrorCode errorCode, unsigned long systemCod m_error = MediaKeyError::create(mediaKeyErrorCode, systemCode); // 3. queue a task to fire a simple event named keyerror at the MediaKeySession object. - RefPtr<Event> event = Event::create(EventTypeNames::error); + RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::error); event->setTarget(this); m_asyncEventQueue->enqueueEvent(event.release()); } diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h index 6c141e5..c12fc00 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h @@ -81,7 +81,7 @@ public: void update(Uint8Array* response, ExceptionState&); void release(ExceptionState&); - void enqueueEvent(PassRefPtr<Event>); + void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); // EventTarget virtual const AtomicString& interfaceName() const OVERRIDE; diff --git a/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp b/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp index 4060f0c..49fede3 100644 --- a/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp +++ b/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp @@ -149,7 +149,7 @@ void NavigatorGamepad::didConnectOrDisconnectGamepad(unsigned index, const blink m_gamepads->set(index, gamepad); const AtomicString& eventName = connected ? EventTypeNames::gamepadconnected : EventTypeNames::gamepaddisconnected; - RefPtr<GamepadEvent> event = GamepadEvent::create(eventName, false, true, gamepad.get()); + RefPtrWillBeRawPtr<GamepadEvent> event = GamepadEvent::create(eventName, false, true, gamepad.get()); window()->dispatchEvent(event); } @@ -197,7 +197,7 @@ bool NavigatorGamepad::hasLastData() return false; } -PassRefPtr<Event> NavigatorGamepad::getLastEvent() +PassRefPtrWillBeRawPtr<Event> NavigatorGamepad::getLastEvent() { // This is called only when hasLastData() is true. ASSERT_NOT_REACHED(); diff --git a/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.h b/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.h index cd397b9..6f83e47 100644 --- a/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.h +++ b/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.h @@ -74,7 +74,7 @@ private: virtual void registerWithDispatcher() OVERRIDE FINAL; virtual void unregisterWithDispatcher() OVERRIDE FINAL; virtual bool hasLastData() OVERRIDE FINAL; - virtual PassRefPtr<Event> getLastEvent() OVERRIDE FINAL; + virtual PassRefPtrWillBeRawPtr<Event> getLastEvent() OVERRIDE FINAL; virtual bool isNullEvent(Event*) OVERRIDE FINAL; // DOMWindowLifecycleObserver diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp index 5432f43..cbef775 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp @@ -366,7 +366,7 @@ void IDBDatabase::onVersionChange(int64_t oldVersion, int64_t newVersion) enqueueEvent(IDBVersionChangeEvent::create(EventTypeNames::versionchange, oldVersion, newVersionNullable)); } -void IDBDatabase::enqueueEvent(PassRefPtr<Event> event) +void IDBDatabase::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) { ASSERT(!m_contextStopped); ASSERT(executionContext()); @@ -376,7 +376,7 @@ void IDBDatabase::enqueueEvent(PassRefPtr<Event> event) m_enqueuedEvents.append(event); } -bool IDBDatabase::dispatchEvent(PassRefPtr<Event> event) +bool IDBDatabase::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) { IDB_TRACE("IDBDatabase::dispatchEvent"); if (m_contextStopped || !executionContext()) diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.h b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.h index b771e56..50c5d5f 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.h @@ -98,10 +98,10 @@ public: bool isClosePending() const { return m_closePending; } void forceClose(); const IDBDatabaseMetadata& metadata() const { return m_metadata; } - void enqueueEvent(PassRefPtr<Event>); + void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); using EventTarget::dispatchEvent; - virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE; + virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE; int64_t findObjectStoreId(const String& name) const; bool containsObjectStore(const String& name) const @@ -144,7 +144,7 @@ private: // Keep track of the versionchange events waiting to be fired on this // database so that we can cancel them if the database closes. - Vector<RefPtr<Event> > m_enqueuedEvents; + WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_enqueuedEvents; RefPtr<IDBDatabaseCallbacks> m_databaseCallbacks; }; diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp index 123a5ff..45eecc2 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp @@ -145,7 +145,7 @@ bool IDBOpenDBRequest::shouldEnqueueEvent() const return true; } -bool IDBOpenDBRequest::dispatchEvent(PassRefPtr<Event> event) +bool IDBOpenDBRequest::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) { // If the connection closed between onUpgradeNeeded and the delivery of the "success" event, // an "error" event should be fired instead. diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h index 6d018c8..f04fec0 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h @@ -46,7 +46,7 @@ public: // EventTarget virtual const AtomicString& interfaceName() const OVERRIDE; - virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE; + virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE; DEFINE_ATTRIBUTE_EVENT_LISTENER(blocked); DEFINE_ATTRIBUTE_EVENT_LISTENER(upgradeneeded); diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp index 841c81f..4718e32 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp @@ -400,7 +400,7 @@ ExecutionContext* IDBRequest::executionContext() const return ActiveDOMObject::executionContext(); } -bool IDBRequest::dispatchEvent(PassRefPtr<Event> event) +bool IDBRequest::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) { IDB_TRACE("IDBRequest::dispatchEvent"); if (m_contextStopped || !executionContext()) @@ -500,7 +500,7 @@ void IDBRequest::transactionDidFinishAndDispatch() m_readyState = PENDING; } -void IDBRequest::enqueueEvent(PassRefPtr<Event> event) +void IDBRequest::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) { ASSERT(m_readyState == PENDING || m_readyState == DONE); diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h index f9594d7e..dcc3bb1 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h @@ -120,7 +120,7 @@ public: virtual void uncaughtExceptionInEventHandler() OVERRIDE FINAL; using EventTarget::dispatchEvent; - virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE; + virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE; // Called by a version change transaction that has finished to set this // request back from DONE (following "upgradeneeded") back to PENDING (for @@ -140,7 +140,7 @@ public: protected: IDBRequest(ExecutionContext*, PassRefPtr<IDBAny> source, IDBTransaction*); - void enqueueEvent(PassRefPtr<Event>); + void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); void dequeueEvent(Event*); virtual bool shouldEnqueueEvent() const; void onSuccessInternal(PassRefPtr<IDBAny>); @@ -160,7 +160,7 @@ private: RefPtrWillBePersistent<DOMError> m_error; bool m_hasPendingActivity; - Vector<RefPtr<Event> > m_enqueuedEvents; + WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_enqueuedEvents; // Only used if the result type will be a cursor. IndexedDB::CursorType m_cursorType; diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp index c9316ca..2889cd2 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp @@ -45,7 +45,7 @@ class NullEventQueue FINAL : public EventQueue { public: NullEventQueue() { } virtual ~NullEventQueue() { } - virtual bool enqueueEvent(PassRefPtr<Event>) OVERRIDE { return true; } + virtual bool enqueueEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE { return true; } virtual bool cancelEvent(Event*) OVERRIDE { return true; } virtual void close() OVERRIDE { } }; diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp index 1930117..76f9037 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp @@ -338,7 +338,7 @@ ExecutionContext* IDBTransaction::executionContext() const return ActiveDOMObject::executionContext(); } -bool IDBTransaction::dispatchEvent(PassRefPtr<Event> event) +bool IDBTransaction::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) { IDB_TRACE("IDBTransaction::dispatchEvent"); if (m_contextStopped || !executionContext()) { @@ -386,7 +386,7 @@ void IDBTransaction::stop() abort(IGNORE_EXCEPTION); } -void IDBTransaction::enqueueEvent(PassRefPtr<Event> event) +void IDBTransaction::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) { ASSERT_WITH_MESSAGE(m_state != Finished, "A finished transaction tried to enqueue an event of type %s.", event->type().utf8().data()); if (m_contextStopped || !executionContext()) diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h index 4019aee..f1d29a1 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h @@ -98,7 +98,7 @@ public: virtual ExecutionContext* executionContext() const OVERRIDE; using EventTarget::dispatchEvent; - virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE; + virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE; // ActiveDOMObject virtual bool hasPendingActivity() const OVERRIDE; @@ -107,7 +107,7 @@ public: private: IDBTransaction(ExecutionContext*, int64_t, const Vector<String>&, blink::WebIDBDatabase::TransactionMode, IDBDatabase*, IDBOpenDBRequest*, const IDBDatabaseMetadata&); - void enqueueEvent(PassRefPtr<Event>); + void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); enum State { Inactive, // Created or started, but not in an event callback diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSourceBase.cpp b/third_party/WebKit/Source/modules/mediasource/MediaSourceBase.cpp index 0f534b0..6662e27 100644 --- a/third_party/WebKit/Source/modules/mediasource/MediaSourceBase.cpp +++ b/third_party/WebKit/Source/modules/mediasource/MediaSourceBase.cpp @@ -346,7 +346,7 @@ void MediaSourceBase::scheduleEvent(const AtomicString& eventName) { ASSERT(m_asyncEventQueue); - RefPtr<Event> event = Event::create(eventName); + RefPtrWillBeRawPtr<Event> event = Event::create(eventName); event->setTarget(this); m_asyncEventQueue->enqueueEvent(event.release()); diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp index 04eb7d5..026e9da 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp +++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp @@ -481,7 +481,7 @@ void SourceBuffer::scheduleEvent(const AtomicString& eventName) { ASSERT(m_asyncEventQueue); - RefPtr<Event> event = Event::create(eventName); + RefPtrWillBeRawPtr<Event> event = Event::create(eventName); event->setTarget(this); m_asyncEventQueue->enqueueEvent(event.release()); diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBufferList.cpp b/third_party/WebKit/Source/modules/mediasource/SourceBufferList.cpp index 8f804f85..d406263 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBufferList.cpp +++ b/third_party/WebKit/Source/modules/mediasource/SourceBufferList.cpp @@ -74,7 +74,7 @@ void SourceBufferList::scheduleEvent(const AtomicString& eventName) { ASSERT(m_asyncEventQueue); - RefPtr<Event> event = Event::create(eventName); + RefPtrWillBeRawPtr<Event> event = Event::create(eventName); event->setTarget(this); m_asyncEventQueue->enqueueEvent(event.release()); diff --git a/third_party/WebKit/Source/modules/mediasource/WebKitSourceBufferList.cpp b/third_party/WebKit/Source/modules/mediasource/WebKitSourceBufferList.cpp index 43d93d0..a0236f7 100644 --- a/third_party/WebKit/Source/modules/mediasource/WebKitSourceBufferList.cpp +++ b/third_party/WebKit/Source/modules/mediasource/WebKitSourceBufferList.cpp @@ -86,7 +86,7 @@ void WebKitSourceBufferList::createAndFireEvent(const AtomicString& eventName) { ASSERT(m_asyncEventQueue); - RefPtr<Event> event = Event::create(eventName); + RefPtrWillBeRawPtr<Event> event = Event::create(eventName); event->setTarget(this); m_asyncEventQueue->enqueueEvent(event.release()); diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp b/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp index af0bb63..bfde31b 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp +++ b/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp @@ -365,7 +365,7 @@ void MediaStream::removeRemoteTrack(MediaStreamComponent* component) scheduleDispatchEvent(MediaStreamTrackEvent::create(EventTypeNames::removetrack, false, false, track)); } -void MediaStream::scheduleDispatchEvent(PassRefPtr<Event> event) +void MediaStream::scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event> event) { m_scheduledEvents.append(event); @@ -378,10 +378,10 @@ void MediaStream::scheduledEventTimerFired(Timer<MediaStream>*) if (m_stopped) return; - Vector<RefPtr<Event> > events; + WillBeHeapVector<RefPtrWillBeMember<Event> > events; events.swap(m_scheduledEvents); - Vector<RefPtr<Event> >::iterator it = events.begin(); + WillBeHeapVector<RefPtrWillBeMember<Event> >::iterator it = events.begin(); for (; it != events.end(); ++it) dispatchEvent((*it).release()); diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStream.h b/third_party/WebKit/Source/modules/mediastream/MediaStream.h index 0334b5e..8ecd6f6 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStream.h +++ b/third_party/WebKit/Source/modules/mediastream/MediaStream.h @@ -95,7 +95,7 @@ private: virtual void addRemoteTrack(MediaStreamComponent*) OVERRIDE; virtual void removeRemoteTrack(MediaStreamComponent*) OVERRIDE; - void scheduleDispatchEvent(PassRefPtr<Event>); + void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); void scheduledEventTimerFired(Timer<MediaStream>*); bool m_stopped; @@ -105,7 +105,7 @@ private: RefPtr<MediaStreamDescriptor> m_descriptor; Timer<MediaStream> m_scheduledEventTimer; - Vector<RefPtr<Event> > m_scheduledEvents; + WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; }; typedef Vector<RefPtr<MediaStream> > MediaStreamVector; diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp b/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp index 865c58d..7759f10 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp +++ b/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp @@ -145,7 +145,7 @@ void RTCDTMFSender::stop() m_handler->setClient(0); } -void RTCDTMFSender::scheduleDispatchEvent(PassRefPtr<Event> event) +void RTCDTMFSender::scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event> event) { m_scheduledEvents.append(event); @@ -158,10 +158,10 @@ void RTCDTMFSender::scheduledEventTimerFired(Timer<RTCDTMFSender>*) if (m_stopped) return; - Vector<RefPtr<Event> > events; + WillBeHeapVector<RefPtrWillBeMember<Event> > events; events.swap(m_scheduledEvents); - Vector<RefPtr<Event> >::iterator it = events.begin(); + WillBeHeapVector<RefPtrWillBeMember<Event> >::iterator it = events.begin(); for (; it != events.end(); ++it) dispatchEvent((*it).release()); } diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.h b/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.h index 7494a7d..69e8620 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.h +++ b/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.h @@ -71,7 +71,7 @@ public: private: RTCDTMFSender(ExecutionContext*, PassRefPtr<MediaStreamTrack>, PassOwnPtr<blink::WebRTCDTMFSenderHandler>); - void scheduleDispatchEvent(PassRefPtr<Event>); + void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); void scheduledEventTimerFired(Timer<RTCDTMFSender>*); // blink::WebRTCDTMFSenderHandlerClient @@ -86,7 +86,7 @@ private: bool m_stopped; Timer<RTCDTMFSender> m_scheduledEventTimer; - Vector<RefPtr<Event> > m_scheduledEvents; + WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; }; } // namespace WebCore diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp index c6b69c8..a40434c5 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp +++ b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp @@ -291,7 +291,7 @@ void RTCDataChannel::stop() m_executionContext = 0; } -void RTCDataChannel::scheduleDispatchEvent(PassRefPtr<Event> event) +void RTCDataChannel::scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event> event) { m_scheduledEvents.append(event); @@ -304,10 +304,10 @@ void RTCDataChannel::scheduledEventTimerFired(Timer<RTCDataChannel>*) if (m_stopped) return; - Vector<RefPtr<Event> > events; + WillBeHeapVector<RefPtrWillBeMember<Event> > events; events.swap(m_scheduledEvents); - Vector<RefPtr<Event> >::iterator it = events.begin(); + WillBeHeapVector<RefPtrWillBeMember<Event> >::iterator it = events.begin(); for (; it != events.end(); ++it) dispatchEvent((*it).release()); diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.h b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.h index 69f756f..31b0e1a 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.h +++ b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.h @@ -89,7 +89,7 @@ public: private: RTCDataChannel(ExecutionContext*, PassOwnPtr<blink::WebRTCDataChannelHandler>); - void scheduleDispatchEvent(PassRefPtr<Event>); + void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); void scheduledEventTimerFired(Timer<RTCDataChannel>*); ExecutionContext* m_executionContext; @@ -113,7 +113,7 @@ private: BinaryType m_binaryType; Timer<RTCDataChannel> m_scheduledEventTimer; - Vector<RefPtr<Event> > m_scheduledEvents; + WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; }; } // namespace WebCore diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp index 696ddc8..b359c31 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp +++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp @@ -689,7 +689,7 @@ void RTCPeerConnection::changeIceConnectionState(ICEConnectionState iceConnectio } } -void RTCPeerConnection::scheduleDispatchEvent(PassRefPtr<Event> event) +void RTCPeerConnection::scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event> event) { m_scheduledEvents.append(event); @@ -701,10 +701,10 @@ void RTCPeerConnection::dispatchScheduledEvent() if (m_stopped) return; - Vector<RefPtr<Event> > events; + WillBeHeapVector<RefPtrWillBeMember<Event> > events; events.swap(m_scheduledEvents); - Vector<RefPtr<Event> >::iterator it = events.begin(); + WillBeHeapVector<RefPtrWillBeMember<Event> >::iterator it = events.begin(); for (; it != events.end(); ++it) dispatchEvent((*it).release()); diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h index da1fcc1..ee48825 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h +++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h @@ -135,7 +135,7 @@ private: RTCPeerConnection(ExecutionContext*, PassRefPtr<RTCConfiguration>, blink::WebMediaConstraints, ExceptionState&); static PassRefPtr<RTCConfiguration> parseConfiguration(const Dictionary& configuration, ExceptionState&); - void scheduleDispatchEvent(PassRefPtr<Event>); + void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); void dispatchScheduledEvent(); bool hasLocalStreamWithTrackId(const String& trackId); @@ -155,7 +155,7 @@ private: OwnPtr<blink::WebRTCPeerConnectionHandler> m_peerHandler; AsyncMethodRunner<RTCPeerConnection> m_dispatchScheduledEventRunner; - Vector<RefPtr<Event> > m_scheduledEvents; + WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; bool m_stopped; }; diff --git a/third_party/WebKit/Source/modules/notifications/Notification.cpp b/third_party/WebKit/Source/modules/notifications/Notification.cpp index 7c67d32..9709159 100644 --- a/third_party/WebKit/Source/modules/notifications/Notification.cpp +++ b/third_party/WebKit/Source/modules/notifications/Notification.cpp @@ -170,7 +170,7 @@ void Notification::requestPermission(ExecutionContext* context, PassOwnPtr<Notif NotificationController::from(toDocument(context)->page())->client()->requestPermission(context, callback); } -bool Notification::dispatchEvent(PassRefPtr<Event> event) +bool Notification::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) { ASSERT(m_state != Closed); diff --git a/third_party/WebKit/Source/modules/notifications/Notification.h b/third_party/WebKit/Source/modules/notifications/Notification.h index 19e81591..a1deb235 100644 --- a/third_party/WebKit/Source/modules/notifications/Notification.h +++ b/third_party/WebKit/Source/modules/notifications/Notification.h @@ -85,7 +85,7 @@ public: // EventTarget interface. virtual ExecutionContext* executionContext() const OVERRIDE FINAL { return ActiveDOMObject::executionContext(); } - virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE FINAL; + virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE FINAL; virtual const AtomicString& interfaceName() const OVERRIDE; // ActiveDOMObject interface. diff --git a/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp b/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp index e6a6fc3..3ee53a3 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp +++ b/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp @@ -124,7 +124,7 @@ void SpeechRecognition::didReceiveNoMatch(PassRefPtrWillBeRawPtr<SpeechRecogniti dispatchEvent(SpeechRecognitionEvent::createNoMatch(result)); } -void SpeechRecognition::didReceiveError(PassRefPtr<SpeechRecognitionError> error) +void SpeechRecognition::didReceiveError(PassRefPtrWillBeRawPtr<SpeechRecognitionError> error) { dispatchEvent(error); m_started = false; diff --git a/third_party/WebKit/Source/modules/speech/SpeechRecognition.h b/third_party/WebKit/Source/modules/speech/SpeechRecognition.h index 40c84da..ec0e056 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechRecognition.h +++ b/third_party/WebKit/Source/modules/speech/SpeechRecognition.h @@ -76,7 +76,7 @@ public: void didEndAudio(); void didReceiveResults(const WillBeHeapVector<RefPtrWillBeMember<SpeechRecognitionResult> >& newFinalResults, const WillBeHeapVector<RefPtrWillBeMember<SpeechRecognitionResult> >& currentInterimResults); void didReceiveNoMatch(PassRefPtrWillBeRawPtr<SpeechRecognitionResult>); - void didReceiveError(PassRefPtr<SpeechRecognitionError>); + void didReceiveError(PassRefPtrWillBeRawPtr<SpeechRecognitionError>); void didStart(); void didEnd(); diff --git a/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp index 5c4d996..30efea9 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp @@ -204,7 +204,7 @@ AudioScheduledSourceNode::NotifyEndedTask::NotifyEndedTask(PassRefPtr<AudioSched void AudioScheduledSourceNode::NotifyEndedTask::notifyEnded() { - RefPtr<Event> event = Event::create(EventTypeNames::ended); + RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::ended); event->setTarget(m_scheduledNode); m_scheduledNode->dispatchEvent(event.get()); } diff --git a/third_party/WebKit/Source/modules/websockets/WebSocket.cpp b/third_party/WebKit/Source/modules/websockets/WebSocket.cpp index 44e1300..9c9e541 100644 --- a/third_party/WebKit/Source/modules/websockets/WebSocket.cpp +++ b/third_party/WebKit/Source/modules/websockets/WebSocket.cpp @@ -71,7 +71,7 @@ WebSocket::EventQueue::EventQueue(EventTarget* target) WebSocket::EventQueue::~EventQueue() { stop(); } -void WebSocket::EventQueue::dispatch(PassRefPtr<Event> event) +void WebSocket::EventQueue::dispatch(PassRefPtrWillBeRawPtr<Event> event) { switch (m_state) { case Active: @@ -127,7 +127,7 @@ void WebSocket::EventQueue::dispatchQueuedEvents() RefPtr<EventQueue> protect(this); - Deque<RefPtr<Event> > events; + Deque<RefPtrWillBePersistent<Event> > events; events.swap(m_events); while (!events.isEmpty()) { if (m_state == Stopped || m_state == Suspended) diff --git a/third_party/WebKit/Source/modules/websockets/WebSocket.h b/third_party/WebKit/Source/modules/websockets/WebSocket.h index 04f913b..c7cd9083 100644 --- a/third_party/WebKit/Source/modules/websockets/WebSocket.h +++ b/third_party/WebKit/Source/modules/websockets/WebSocket.h @@ -125,6 +125,7 @@ public: virtual void didClose(unsigned long unhandledBufferedAmount, ClosingHandshakeCompletionStatus, unsigned short code, const String& reason) OVERRIDE; private: + // FIXME: This should inherit WebCore::EventQueue. class EventQueue FINAL : public RefCounted<EventQueue> { public: static PassRefPtr<EventQueue> create(EventTarget* target) { return adoptRef(new EventQueue(target)); } @@ -133,7 +134,7 @@ private: // Dispatches the event if this queue is active. // Queues the event if this queue is suspended. // Does nothing otherwise. - void dispatch(PassRefPtr<Event> /* event */); + void dispatch(PassRefPtrWillBeRawPtr<Event> /* event */); bool isEmpty() const; @@ -157,7 +158,8 @@ private: State m_state; EventTarget* m_target; - Deque<RefPtr<Event> > m_events; + // FIXME: oilpan: This should be HeapDeque once it's implemented. + Deque<RefPtrWillBePersistent<Event> > m_events; Timer<EventQueue> m_resumeTimer; }; diff --git a/third_party/WebKit/Source/web/WebDOMEvent.cpp b/third_party/WebKit/Source/web/WebDOMEvent.cpp index eb70c33..ec4ee5d 100644 --- a/third_party/WebKit/Source/web/WebDOMEvent.cpp +++ b/third_party/WebKit/Source/web/WebDOMEvent.cpp @@ -56,12 +56,12 @@ void WebDOMEvent::assign(const WTF::PassRefPtr<WebDOMEventPrivate>& event) m_private = event; } -WebDOMEvent::WebDOMEvent(const WTF::PassRefPtr<WebCore::Event>& event) +WebDOMEvent::WebDOMEvent(const PassRefPtrWillBeRawPtr<WebCore::Event>& event) : m_private(event) { } -WebDOMEvent::operator WTF::PassRefPtr<WebCore::Event>() const +WebDOMEvent::operator PassRefPtrWillBeRawPtr<WebCore::Event>() const { return m_private.get(); } diff --git a/third_party/WebKit/Source/web/tests/CustomEventTest.cpp b/third_party/WebKit/Source/web/tests/CustomEventTest.cpp index 8d75e40..a1defb5 100644 --- a/third_party/WebKit/Source/web/tests/CustomEventTest.cpp +++ b/third_party/WebKit/Source/web/tests/CustomEventTest.cpp @@ -104,9 +104,7 @@ TEST(CustomEventTest, InitWithSerializedScriptValue) URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_str()), WebString::fromUTF8(path.c_str())); FrameTestHelpers::WebViewHelper webViewHelper; WebFrameImpl* frame = toWebFrameImpl(webViewHelper.initializeAndLoad(baseURL + path)->mainFrame()); - - // FIXME: oilpan: Remove PassRefPtr<Event>() once we support PassRefPtrWillBeRawPtr in WebDOMEvent. - WebDOMEvent event = PassRefPtr<Event>(frame->frame()->document()->createEvent("CustomEvent", IGNORE_EXCEPTION)); + WebDOMEvent event = frame->frame()->document()->createEvent("CustomEvent", IGNORE_EXCEPTION); WebDOMCustomEvent customEvent = event.to<WebDOMCustomEvent>(); v8::Isolate* isolate = toIsolate(frame->frame()); diff --git a/third_party/WebKit/Source/web/tests/KeyboardTest.cpp b/third_party/WebKit/Source/web/tests/KeyboardTest.cpp index b2fce99..df58426 100644 --- a/third_party/WebKit/Source/web/tests/KeyboardTest.cpp +++ b/third_party/WebKit/Source/web/tests/KeyboardTest.cpp @@ -58,7 +58,7 @@ public: { PlatformKeyboardEventBuilder evt(webKeyboardEvent); evt.setKeyType(keyType); - RefPtr<KeyboardEvent> keyboardEvent = KeyboardEvent::create(evt, 0); + RefPtrWillBeRawPtr<KeyboardEvent> keyboardEvent = KeyboardEvent::create(evt, 0); OwnPtr<Settings> settings = Settings::create(); EditingBehavior behavior(settings->editingBehaviorType()); return behavior.interpretKeyEvent(*keyboardEvent); diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp index 61ed841..7fccce6 100644 --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp @@ -4759,7 +4759,7 @@ TEST_F(WebFrameTest, SimulateFragmentAnchorMiddleClick) WebCore::KURL destination = document->url(); destination.setFragmentIdentifier("test"); - RefPtr<WebCore::Event> event = WebCore::MouseEvent::create(WebCore::EventTypeNames::click, false, false, + RefPtrWillBeRawPtr<WebCore::Event> event = WebCore::MouseEvent::create(WebCore::EventTypeNames::click, false, false, document->domWindow(), 0, 0, 0, 0, 0, 0, 0, false, false, false, false, 1, nullptr, nullptr); WebCore::FrameLoadRequest frameRequest(document, WebCore::ResourceRequest(destination)); frameRequest.setTriggeringEvent(event); @@ -4809,7 +4809,7 @@ TEST_F(WebFrameTest, ModifiedClickNewWindow) WebCore::KURL destination = toKURL(m_baseURL + "hello_world.html"); // ctrl+click event - RefPtr<WebCore::Event> event = WebCore::MouseEvent::create(WebCore::EventTypeNames::click, false, false, + RefPtrWillBeRawPtr<WebCore::Event> event = WebCore::MouseEvent::create(WebCore::EventTypeNames::click, false, false, document->domWindow(), 0, 0, 0, 0, 0, 0, 0, true, false, false, false, 0, nullptr, nullptr); WebCore::FrameLoadRequest frameRequest(document, WebCore::ResourceRequest(destination)); frameRequest.setTriggeringEvent(event); diff --git a/third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp b/third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp index d293855..8387b6c 100644 --- a/third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp @@ -249,7 +249,7 @@ TEST(WebInputEventConversionTest, InputEventsScaling) // which expect CSS pixel coordinates. { PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10), LeftButton, PlatformEvent::MouseMoved, 1, false, false, false, false, 0); - RefPtr<MouseEvent> mouseEvent = MouseEvent::create(WebCore::EventTypeNames::mousemove, domWindow, platformMouseEvent, 0, document); + RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(WebCore::EventTypeNames::mousemove, domWindow, platformMouseEvent, 0, document); WebMouseEventBuilder webMouseBuilder(view, docRenderer, *mouseEvent); EXPECT_EQ(10, webMouseBuilder.x); @@ -262,14 +262,14 @@ TEST(WebInputEventConversionTest, InputEventsScaling) { PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10), NoButton, PlatformEvent::MouseMoved, 1, false, false, false, false, 0); - RefPtr<MouseEvent> mouseEvent = MouseEvent::create(WebCore::EventTypeNames::mousemove, domWindow, platformMouseEvent, 0, document); + RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(WebCore::EventTypeNames::mousemove, domWindow, platformMouseEvent, 0, document); WebMouseEventBuilder webMouseBuilder(view, docRenderer, *mouseEvent); EXPECT_EQ(WebMouseEvent::ButtonNone, webMouseBuilder.button); } { PlatformGestureEvent platformGestureEvent(PlatformEvent::GestureScrollUpdate, IntPoint(10, 10), IntPoint(10, 10), IntSize(10, 10), 0, false, false, false, false, 10, 10, 10, 10); - RefPtr<GestureEvent> gestureEvent = GestureEvent::create(domWindow, platformGestureEvent); + RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(domWindow, platformGestureEvent); WebGestureEventBuilder webGestureBuilder(view, docRenderer, *gestureEvent); EXPECT_EQ(10, webGestureBuilder.x); @@ -284,7 +284,7 @@ TEST(WebInputEventConversionTest, InputEventsScaling) RefPtrWillBeRawPtr<Touch> touch = Touch::create(webViewImpl->page()->mainFrame(), document.get(), 0, 10, 10, 10, 10, 10, 10, 0, 0); RefPtrWillBeRawPtr<TouchList> touchList = TouchList::create(); touchList->append(touch); - RefPtr<TouchEvent> touchEvent = TouchEvent::create(touchList.get(), touchList.get(), touchList.get(), WebCore::EventTypeNames::touchmove, domWindow, 10, 10, 10, 10, false, false, false, false); + RefPtrWillBeRawPtr<TouchEvent> touchEvent = TouchEvent::create(touchList.get(), touchList.get(), touchList.get(), WebCore::EventTypeNames::touchmove, domWindow, 10, 10, 10, 10, false, false, false, false); WebTouchEventBuilder webTouchBuilder(view, docRenderer, *touchEvent); ASSERT_EQ(1u, webTouchBuilder.touchesLength); diff --git a/third_party/WebKit/public/web/WebDOMEvent.h b/third_party/WebKit/public/web/WebDOMEvent.h index 152a102..aa6ac5c 100644 --- a/third_party/WebKit/public/web/WebDOMEvent.h +++ b/third_party/WebKit/public/web/WebDOMEvent.h @@ -92,8 +92,8 @@ public: BLINK_EXPORT bool isXMLHttpRequestProgressEvent() const; #if BLINK_IMPLEMENTATION - WebDOMEvent(const WTF::PassRefPtr<WebCore::Event>&); - operator WTF::PassRefPtr<WebCore::Event>() const; + WebDOMEvent(const PassRefPtrWillBeRawPtr<WebCore::Event>&); + operator PassRefPtrWillBeRawPtr<WebCore::Event>() const; #endif template<typename T> T to() diff --git a/third_party/WebKit/public/web/WebDOMMessageEvent.h b/third_party/WebKit/public/web/WebDOMMessageEvent.h index 92623f1..c220c0e 100644 --- a/third_party/WebKit/public/web/WebDOMMessageEvent.h +++ b/third_party/WebKit/public/web/WebDOMMessageEvent.h @@ -55,7 +55,7 @@ public: BLINK_EXPORT WebMessagePortChannelArray releaseChannels(); #if BLINK_IMPLEMENTATION - explicit WebDOMMessageEvent(const WTF::PassRefPtr<WebCore::MessageEvent>& e) : WebDOMEvent(e) { } + explicit WebDOMMessageEvent(const PassRefPtrWillBeRawPtr<WebCore::MessageEvent>& e) : WebDOMEvent(e) { } #endif }; |