Skip to content

Commit

Permalink
Make PostMessageTimer release itself using std::unique_ptr.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian J. Burg committed Dec 25, 2013
1 parent 191450e commit e76b7b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions Source/WebCore/page/DOMWindow.cpp
Expand Up @@ -143,7 +143,7 @@ class PostMessageTimer : public TimerBase {
private:
virtual void fired()
{
m_window->postMessageTimerFired(adoptPtr(this));
m_window->postMessageTimerFired(std::unique_ptr<PostMessageTimer>(this));
// This object is deleted now.
}

Expand Down Expand Up @@ -836,10 +836,8 @@ void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, const Mes
timer->startOneShot(0);
}

void DOMWindow::postMessageTimerFired(PassOwnPtr<PostMessageTimer> t)
void DOMWindow::postMessageTimerFired(std::unique_ptr<PostMessageTimer> timer)
{
OwnPtr<PostMessageTimer> timer(t);

if (!document() || !isCurrentlyDisplayedInFrame())
return;

Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/page/DOMWindow.h
Expand Up @@ -243,7 +243,7 @@ namespace WebCore {
void postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePortArray*, const String& targetOrigin, DOMWindow& source, ExceptionCode&);
// Needed for Objective-C bindings (see bug 28774).
void postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort*, const String& targetOrigin, DOMWindow& source, ExceptionCode&);
void postMessageTimerFired(PassOwnPtr<PostMessageTimer>);
void postMessageTimerFired(std::unique_ptr<PostMessageTimer>);
void dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTargetOrigin, PassRefPtr<Event>, PassRefPtr<ScriptCallStack>);

void scrollBy(int x, int y) const;
Expand Down

0 comments on commit e76b7b6

Please sign in to comment.