Unreviewed, rolling out r164422.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Feb 2014 13:52:24 +0000 (13:52 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Feb 2014 13:52:24 +0000 (13:52 +0000)
http://trac.webkit.org/changeset/164422
https://bugs.webkit.org/show_bug.cgi?id=129102

Causes assertions in
ScriptExecutionContext::canSuspendActiveDOMObjects()
(Requested by zdobersek on #webkit).

* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::reportException):
(WebCore::ScriptExecutionContext::publicURLManager):
* dom/ScriptExecutionContext.h:
* dom/ScriptRunner.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164426 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/dom/KeyboardEvent.cpp
Source/WebCore/dom/KeyboardEvent.h
Source/WebCore/dom/ScriptExecutionContext.cpp
Source/WebCore/dom/ScriptExecutionContext.h
Source/WebCore/dom/ScriptRunner.h

index 195859a..fd7372a 100644 (file)
@@ -1,3 +1,22 @@
+2014-02-20  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r164422.
+        http://trac.webkit.org/changeset/164422
+        https://bugs.webkit.org/show_bug.cgi?id=129102
+
+        Causes assertions in
+        ScriptExecutionContext::canSuspendActiveDOMObjects()
+        (Requested by zdobersek on #webkit).
+
+        * dom/KeyboardEvent.cpp:
+        (WebCore::KeyboardEvent::KeyboardEvent):
+        * dom/KeyboardEvent.h:
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ScriptExecutionContext::reportException):
+        (WebCore::ScriptExecutionContext::publicURLManager):
+        * dom/ScriptExecutionContext.h:
+        * dom/ScriptRunner.h:
+
 2014-02-20  Zan Dobersek  <zdobersek@igalia.com>
 
         Move to using std::unique_ptr for VisitedLinkState, CheckedRadioButtons
index c011b42..7916908 100644 (file)
@@ -108,7 +108,7 @@ KeyboardEvent::KeyboardEvent()
 KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* view)
     : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()),
                           true, true, key.timestamp(), view, 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey())
-    , m_keyEvent(std::make_unique<PlatformKeyboardEvent>(key))
+    , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key)))
     , m_keyIdentifier(key.keyIdentifier())
     , m_location(keyLocationCode(key))
     , m_altGraphKey(false)
index 216a634..bd2d1fb 100644 (file)
@@ -25,7 +25,6 @@
 #define KeyboardEvent_h
 
 #include "UIEventWithKeyState.h"
-#include <memory>
 #include <wtf/Vector.h>
 
 namespace WebCore {
@@ -114,7 +113,7 @@ private:
     KeyboardEvent(const PlatformKeyboardEvent&, AbstractView*);
     KeyboardEvent(const AtomicString&, const KeyboardEventInit&);
 
-    std::unique_ptr<PlatformKeyboardEvent> m_keyEvent;
+    OwnPtr<PlatformKeyboardEvent> m_keyEvent;
     String m_keyIdentifier;
     unsigned m_location;
     bool m_altGraphKey : 1;
index d4ca8b2..2d74a38 100644 (file)
@@ -299,8 +299,8 @@ void ScriptExecutionContext::reportException(const String& errorMessage, int lin
 {
     if (m_inDispatchErrorEvent) {
         if (!m_pendingExceptions)
-            m_pendingExceptions = std::make_unique<Vector<std::unique_ptr<PendingException>>>();
-        m_pendingExceptions->append(std::make_unique<PendingException>(errorMessage, lineNumber, columnNumber, sourceURL, callStack));
+            m_pendingExceptions = adoptPtr(new Vector<OwnPtr<PendingException>>());
+        m_pendingExceptions->append(adoptPtr(new PendingException(errorMessage, lineNumber, columnNumber, sourceURL, callStack)));
         return;
     }
 
@@ -311,9 +311,11 @@ void ScriptExecutionContext::reportException(const String& errorMessage, int lin
     if (!m_pendingExceptions)
         return;
 
-    for (auto& exception : *m_pendingExceptions)
-        logExceptionToConsole(exception->m_errorMessage, exception->m_sourceURL, exception->m_lineNumber, exception->m_columnNumber, exception->m_callStack);
-    m_pendingExceptions.reset();
+    for (size_t i = 0; i < m_pendingExceptions->size(); i++) {
+        PendingException* e = m_pendingExceptions->at(i).get();
+        logExceptionToConsole(e->m_errorMessage, e->m_sourceURL, e->m_lineNumber, e->m_columnNumber, e->m_callStack);
+    }
+    m_pendingExceptions.clear();
 }
 
 void ScriptExecutionContext::addConsoleMessage(MessageSource source, MessageLevel level, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, JSC::ExecState* state, unsigned long requestIdentifier)
@@ -361,7 +363,7 @@ int ScriptExecutionContext::circularSequentialID()
 PublicURLManager& ScriptExecutionContext::publicURLManager()
 {
     if (!m_publicURLManager)
-        m_publicURLManager = std::make_unique<PublicURLManager>(this);
+        m_publicURLManager = PublicURLManager::create(this);
     return *m_publicURLManager;
 }
 #endif
index df0acf3..64acad8 100644 (file)
@@ -208,7 +208,7 @@ private:
 
     bool m_inDispatchErrorEvent;
     class PendingException;
-    std::unique_ptr<Vector<std::unique_ptr<PendingException>>> m_pendingExceptions;
+    OwnPtr<Vector<OwnPtr<PendingException>>> m_pendingExceptions;
 
     bool m_activeDOMObjectsAreSuspended;
     ActiveDOMObject::ReasonForSuspension m_reasonForSuspendingActiveDOMObjects;
index d7e692c..f23e6da 100644 (file)
@@ -30,6 +30,7 @@
 #include "Timer.h"
 #include <wtf/HashMap.h>
 #include <wtf/Noncopyable.h>
+#include <wtf/PassOwnPtr.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/Vector.h>