Remove upcastPointer from ActiveDOMObject constructor
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2013 23:28:38 +0000 (23:28 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2013 23:28:38 +0000 (23:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=112858

Patch by Russell McClellan <russell.mcclellan@gmail.com> on 2013-03-21
Reviewed by Alexey Proskuryakov.

Removed pesky argument to ActiveDOMObject constructor that is no longer
used.

No new tests (no change in behavior).

* Modules/battery/BatteryManager.cpp:
(WebCore::BatteryManager::BatteryManager):
* Modules/filesystem/DOMFileSystem.cpp:
(WebCore::DOMFileSystem::DOMFileSystem):
* Modules/filesystem/FileWriter.cpp:
(WebCore::FileWriter::FileWriter):
* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::Geolocation):
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::IDBDatabase):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::IDBTransaction):
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::MediaSource):
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::MediaStreamTrack):
* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::RTCDTMFSender):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::RTCPeerConnection):
* Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp:
(WebCore::RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl):
* Modules/mediastream/RTCStatsRequestImpl.cpp:
(WebCore::RTCStatsRequestImpl::RTCStatsRequestImpl):
* Modules/mediastream/RTCVoidRequestImpl.cpp:
(WebCore::RTCVoidRequestImpl::RTCVoidRequestImpl):
* Modules/networkinfo/NetworkInfoConnection.cpp:
(WebCore::NetworkInfoConnection::NetworkInfoConnection):
* Modules/notifications/Notification.cpp:
(WebCore::Notification::Notification):
* Modules/notifications/NotificationCenter.cpp:
(WebCore::NotificationCenter::NotificationCenter):
* Modules/speech/SpeechRecognition.cpp:
(WebCore::SpeechRecognition::SpeechRecognition):
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::AudioContext):
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::DatabaseContext):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::WebSocket):
* css/FontLoader.cpp:
(WebCore::FontLoader::FontLoader):
* dom/ActiveDOMObject.cpp:
(WebCore::ActiveDOMObject::ActiveDOMObject):
* dom/ActiveDOMObject.h:
(ActiveDOMObject):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::canSuspendActiveDOMObjects):
(WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
(WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
(WebCore::ScriptExecutionContext::stopActiveDOMObjects):
(WebCore::ScriptExecutionContext::didCreateActiveDOMObject):
* dom/ScriptExecutionContext.h:
(ScriptExecutionContext):
(WebCore::ScriptExecutionContext::activeDOMObjects):
* fileapi/FileReader.cpp:
(WebCore::FileReader::FileReader):
* html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::HTMLMarqueeElement):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore):
(WebCore::WebGLRenderingContext::WebGLRenderingContext):
* loader/Prerenderer.cpp:
(WebCore::Prerenderer::Prerenderer):
* page/EventSource.cpp:
(WebCore::EventSource::EventSource):
* page/SuspendableTimer.cpp:
(WebCore::SuspendableTimer::SuspendableTimer):
* workers/AbstractWorker.cpp:
(WebCore::AbstractWorker::AbstractWorker):
* workers/WorkerContext.cpp:
(WebCore::WorkerContext::hasPendingActivity):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::XMLHttpRequest):

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

37 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/battery/BatteryManager.cpp
Source/WebCore/Modules/filesystem/DOMFileSystem.cpp
Source/WebCore/Modules/filesystem/FileWriter.cpp
Source/WebCore/Modules/geolocation/Geolocation.cpp
Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
Source/WebCore/Modules/indexeddb/IDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
Source/WebCore/Modules/mediasource/MediaSource.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp
Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
Source/WebCore/Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp
Source/WebCore/Modules/mediastream/RTCStatsRequestImpl.cpp
Source/WebCore/Modules/mediastream/RTCVoidRequestImpl.cpp
Source/WebCore/Modules/networkinfo/NetworkInfoConnection.cpp
Source/WebCore/Modules/notifications/Notification.cpp
Source/WebCore/Modules/notifications/NotificationCenter.cpp
Source/WebCore/Modules/speech/SpeechRecognition.cpp
Source/WebCore/Modules/webaudio/AudioContext.cpp
Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
Source/WebCore/Modules/websockets/WebSocket.cpp
Source/WebCore/css/FontLoader.cpp
Source/WebCore/dom/ActiveDOMObject.cpp
Source/WebCore/dom/ActiveDOMObject.h
Source/WebCore/dom/ScriptExecutionContext.cpp
Source/WebCore/dom/ScriptExecutionContext.h
Source/WebCore/fileapi/FileReader.cpp
Source/WebCore/html/HTMLMarqueeElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/canvas/WebGLRenderingContext.cpp
Source/WebCore/loader/Prerenderer.cpp
Source/WebCore/page/EventSource.cpp
Source/WebCore/page/SuspendableTimer.cpp
Source/WebCore/workers/AbstractWorker.cpp
Source/WebCore/workers/WorkerContext.cpp
Source/WebCore/xml/XMLHttpRequest.cpp

index d8b4dbd..c82b720 100644 (file)
@@ -1,3 +1,94 @@
+2013-03-21  Russell McClellan  <russell.mcclellan@gmail.com>
+
+        Remove upcastPointer from ActiveDOMObject constructor
+        https://bugs.webkit.org/show_bug.cgi?id=112858
+
+        Reviewed by Alexey Proskuryakov.
+
+        Removed pesky argument to ActiveDOMObject constructor that is no longer
+        used.
+
+        No new tests (no change in behavior).
+
+        * Modules/battery/BatteryManager.cpp:
+        (WebCore::BatteryManager::BatteryManager):
+        * Modules/filesystem/DOMFileSystem.cpp:
+        (WebCore::DOMFileSystem::DOMFileSystem):
+        * Modules/filesystem/FileWriter.cpp:
+        (WebCore::FileWriter::FileWriter):
+        * Modules/geolocation/Geolocation.cpp:
+        (WebCore::Geolocation::Geolocation):
+        * Modules/indexeddb/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::IDBDatabase):
+        * Modules/indexeddb/IDBRequest.cpp:
+        (WebCore::IDBRequest::IDBRequest):
+        * Modules/indexeddb/IDBTransaction.cpp:
+        (WebCore::IDBTransaction::IDBTransaction):
+        * Modules/mediasource/MediaSource.cpp:
+        (WebCore::MediaSource::MediaSource):
+        * Modules/mediastream/MediaStreamTrack.cpp:
+        (WebCore::MediaStreamTrack::MediaStreamTrack):
+        * Modules/mediastream/RTCDTMFSender.cpp:
+        (WebCore::RTCDTMFSender::RTCDTMFSender):
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        (WebCore::RTCPeerConnection::RTCPeerConnection):
+        * Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp:
+        (WebCore::RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl):
+        * Modules/mediastream/RTCStatsRequestImpl.cpp:
+        (WebCore::RTCStatsRequestImpl::RTCStatsRequestImpl):
+        * Modules/mediastream/RTCVoidRequestImpl.cpp:
+        (WebCore::RTCVoidRequestImpl::RTCVoidRequestImpl):
+        * Modules/networkinfo/NetworkInfoConnection.cpp:
+        (WebCore::NetworkInfoConnection::NetworkInfoConnection):
+        * Modules/notifications/Notification.cpp:
+        (WebCore::Notification::Notification):
+        * Modules/notifications/NotificationCenter.cpp:
+        (WebCore::NotificationCenter::NotificationCenter):
+        * Modules/speech/SpeechRecognition.cpp:
+        (WebCore::SpeechRecognition::SpeechRecognition):
+        * Modules/webaudio/AudioContext.cpp:
+        (WebCore::AudioContext::AudioContext):
+        * Modules/webdatabase/DatabaseContext.cpp:
+        (WebCore::DatabaseContext::DatabaseContext):
+        * Modules/websockets/WebSocket.cpp:
+        (WebCore::WebSocket::WebSocket):
+        * css/FontLoader.cpp:
+        (WebCore::FontLoader::FontLoader):
+        * dom/ActiveDOMObject.cpp:
+        (WebCore::ActiveDOMObject::ActiveDOMObject):
+        * dom/ActiveDOMObject.h:
+        (ActiveDOMObject):
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjects):
+        (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
+        (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
+        (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
+        (WebCore::ScriptExecutionContext::didCreateActiveDOMObject):
+        * dom/ScriptExecutionContext.h:
+        (ScriptExecutionContext):
+        (WebCore::ScriptExecutionContext::activeDOMObjects):
+        * fileapi/FileReader.cpp:
+        (WebCore::FileReader::FileReader):
+        * html/HTMLMarqueeElement.cpp:
+        (WebCore::HTMLMarqueeElement::HTMLMarqueeElement):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::HTMLMediaElement):
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore):
+        (WebCore::WebGLRenderingContext::WebGLRenderingContext):
+        * loader/Prerenderer.cpp:
+        (WebCore::Prerenderer::Prerenderer):
+        * page/EventSource.cpp:
+        (WebCore::EventSource::EventSource):
+        * page/SuspendableTimer.cpp:
+        (WebCore::SuspendableTimer::SuspendableTimer):
+        * workers/AbstractWorker.cpp:
+        (WebCore::AbstractWorker::AbstractWorker):
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::hasPendingActivity):
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::XMLHttpRequest):
+
 2013-03-21  Alexey Proskuryakov  <ap@apple.com>
 
         [Mac] Move NSOperationQueue out of NetworkingContext
index dc2596a..d6b0a08 100644 (file)
@@ -44,7 +44,7 @@ BatteryManager::~BatteryManager()
 }
 
 BatteryManager::BatteryManager(Navigator* navigator)
-    : ActiveDOMObject(navigator->frame()->document(), this)
+    : ActiveDOMObject(navigator->frame()->document())
     , m_batteryController(BatteryController::from(navigator->frame()->page()))
     , m_batteryStatus(0)
 {
index 4824f81..f18a08c 100644 (file)
@@ -88,7 +88,7 @@ PassRefPtr<DOMFileSystem> DOMFileSystem::createIsolatedFileSystem(ScriptExecutio
 
 DOMFileSystem::DOMFileSystem(ScriptExecutionContext* context, const String& name, FileSystemType type, const KURL& rootURL, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
     : DOMFileSystemBase(context, name, type, rootURL, asyncFileSystem)
-    , ActiveDOMObject(context, this)
+    , ActiveDOMObject(context)
 {
 }
 
index 52bcba7..f32b95f 100644 (file)
@@ -55,7 +55,7 @@ PassRefPtr<FileWriter> FileWriter::create(ScriptExecutionContext* context)
 }
 
 FileWriter::FileWriter(ScriptExecutionContext* context)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_readyState(INIT)
     , m_operationInProgress(OperationNone)
     , m_queuedOperation(OperationNone)
index 6202d29..c7a65c7 100644 (file)
@@ -241,7 +241,7 @@ PassRefPtr<Geolocation> Geolocation::create(ScriptExecutionContext* context)
 }
 
 Geolocation::Geolocation(ScriptExecutionContext* context)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_allowGeolocation(Unknown)
 {
 }
index fcddc5f..ce21764 100644 (file)
@@ -59,7 +59,7 @@ PassRefPtr<IDBDatabase> IDBDatabase::create(ScriptExecutionContext* context, Pas
 }
 
 IDBDatabase::IDBDatabase(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseBackendInterface> backend, PassRefPtr<IDBDatabaseCallbacks> callbacks)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_backend(backend)
     , m_closePending(false)
     , m_contextStopped(false)
index c207cad..fa5311d 100644 (file)
@@ -68,7 +68,7 @@ PassRefPtr<IDBRequest> IDBRequest::create(ScriptExecutionContext* context, PassR
 }
 
 IDBRequest::IDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, IDBDatabaseBackendInterface::TaskType taskType, IDBTransaction* transaction)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_result(0)
     , m_errorCode(0)
     , m_contextStopped(false)
index f555943..77962c3 100644 (file)
@@ -91,7 +91,7 @@ const AtomicString& IDBTransaction::modeReadWriteLegacy()
 
 
 IDBTransaction::IDBTransaction(ScriptExecutionContext* context, int64_t id, const Vector<String>& objectStoreNames, IndexedDB::TransactionMode mode, IDBDatabase* db, IDBOpenDBRequest* openDBRequest, const IDBDatabaseMetadata& previousMetadata)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_id(id)
     , m_database(db)
     , m_objectStoreNames(objectStoreNames)
index 8eb10f1..ee63269 100644 (file)
@@ -50,7 +50,7 @@ PassRefPtr<MediaSource> MediaSource::create(ScriptExecutionContext* context)
 }
 
 MediaSource::MediaSource(ScriptExecutionContext* context)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_readyState(closedKeyword())
     , m_asyncEventQueue(GenericEventQueue::create(this))
 {
index b32cd90..060adfa 100644 (file)
@@ -42,7 +42,7 @@ PassRefPtr<MediaStreamTrack> MediaStreamTrack::create(ScriptExecutionContext* co
 }
 
 MediaStreamTrack::MediaStreamTrack(ScriptExecutionContext* context, MediaStreamComponent* component)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_stopped(false)
     , m_component(component)
 {
index b27afdf..5cfc1e8 100644 (file)
@@ -59,7 +59,7 @@ PassRefPtr<RTCDTMFSender> RTCDTMFSender::create(ScriptExecutionContext* context,
 }
 
 RTCDTMFSender::RTCDTMFSender(ScriptExecutionContext* context, PassRefPtr<MediaStreamTrack> track, PassOwnPtr<RTCDTMFSenderHandler> handler)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_track(track)
     , m_duration(defaultToneDurationMs)
     , m_interToneGap(defaultInterToneGapMs)
index 4ea6e50..63ef796 100644 (file)
@@ -132,7 +132,7 @@ PassRefPtr<RTCPeerConnection> RTCPeerConnection::create(ScriptExecutionContext*
 }
 
 RTCPeerConnection::RTCPeerConnection(ScriptExecutionContext* context, PassRefPtr<RTCConfiguration> configuration, PassRefPtr<MediaConstraints> constraints, ExceptionCode& ec)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_signalingState(SignalingStateStable)
     , m_iceGatheringState(IceGatheringStateNew)
     , m_iceConnectionState(IceConnectionStateStarting)
index 23c553a..4081e93 100644 (file)
@@ -50,7 +50,7 @@ PassRefPtr<RTCSessionDescriptionRequestImpl> RTCSessionDescriptionRequestImpl::c
 }
 
 RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl(ScriptExecutionContext* context, PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_successCallback(successCallback)
     , m_errorCallback(errorCallback)
 {
index 79cca8c..343e30b 100644 (file)
@@ -42,7 +42,7 @@ PassRefPtr<RTCStatsRequestImpl> RTCStatsRequestImpl::create(ScriptExecutionConte
 }
 
 RTCStatsRequestImpl::RTCStatsRequestImpl(ScriptExecutionContext* context, PassRefPtr<RTCStatsCallback> callback, PassRefPtr<MediaStreamTrack> selector)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_successCallback(callback)
     , m_stream(selector ? selector->component()->stream() : 0)
     , m_component(selector ? selector->component() : 0)
index cae7613..150e3e9 100644 (file)
@@ -48,7 +48,7 @@ PassRefPtr<RTCVoidRequestImpl> RTCVoidRequestImpl::create(ScriptExecutionContext
 }
 
 RTCVoidRequestImpl::RTCVoidRequestImpl(ScriptExecutionContext* context, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_successCallback(successCallback)
     , m_errorCallback(errorCallback)
 {
index 9a4231c..5834e88 100644 (file)
@@ -44,7 +44,7 @@ PassRefPtr<NetworkInfoConnection> NetworkInfoConnection::create(Navigator* navig
 }
 
 NetworkInfoConnection::NetworkInfoConnection(Navigator* navigator)
-    : ActiveDOMObject(navigator->frame()->document(), this)
+    : ActiveDOMObject(navigator->frame()->document())
     , m_controller(NetworkInfoController::from(navigator->frame()->page()))
     , m_networkInfo(0)
 {
index b398772..d8b6b7a 100644 (file)
 namespace WebCore {
 
 Notification::Notification()
-    : ActiveDOMObject(0, this)
+    : ActiveDOMObject(0)
 {
 }
 
 #if ENABLE(LEGACY_NOTIFICATIONS)
 Notification::Notification(const KURL& url, ScriptExecutionContext* context, ExceptionCode& ec, PassRefPtr<NotificationCenter> provider)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_isHTML(true)
     , m_state(Idle)
     , m_notificationCenter(provider)
@@ -81,7 +81,7 @@ Notification::Notification(const KURL& url, ScriptExecutionContext* context, Exc
 
 #if ENABLE(LEGACY_NOTIFICATIONS)
 Notification::Notification(const String& title, const String& body, const String& iconURI, ScriptExecutionContext* context, ExceptionCode& ec, PassRefPtr<NotificationCenter> provider)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_isHTML(false)
     , m_title(title)
     , m_body(body)
@@ -103,7 +103,7 @@ Notification::Notification(const String& title, const String& body, const String
 
 #if ENABLE(NOTIFICATIONS)
 Notification::Notification(ScriptExecutionContext* context, const String& title)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_isHTML(false)
     , m_title(title)
     , m_state(Idle)
index f4d1228..f11a2c9 100644 (file)
@@ -50,7 +50,7 @@ PassRefPtr<NotificationCenter> NotificationCenter::create(ScriptExecutionContext
 }
 
 NotificationCenter::NotificationCenter(ScriptExecutionContext* context, NotificationClient* client)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_client(client)
 {
 }
index 212b201..8b4a475 100644 (file)
@@ -162,7 +162,7 @@ void SpeechRecognition::stop()
 }
 
 SpeechRecognition::SpeechRecognition(ScriptExecutionContext* context)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_grammars(SpeechGrammarList::create()) // FIXME: The spec is not clear on the default value for the grammars attribute.
     , m_continuous(false)
     , m_interimResults(false)
index e654d9f..04cdd4c 100644 (file)
@@ -122,7 +122,7 @@ PassRefPtr<AudioContext> AudioContext::create(Document* document, ExceptionCode&
 
 // Constructor for rendering to the audio hardware.
 AudioContext::AudioContext(Document* document)
-    : ActiveDOMObject(document, this)
+    : ActiveDOMObject(document)
     , m_isStopScheduled(false)
     , m_isInitialized(false)
     , m_isAudioThreadFinished(false)
@@ -148,7 +148,7 @@ AudioContext::AudioContext(Document* document)
 
 // Constructor for offline (non-realtime) rendering.
 AudioContext::AudioContext(Document* document, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate)
-    : ActiveDOMObject(document, this)
+    : ActiveDOMObject(document)
     , m_isStopScheduled(false)
     , m_isInitialized(false)
     , m_isAudioThreadFinished(false)
index 798b399..58a309a 100644 (file)
@@ -98,7 +98,7 @@ namespace WebCore {
 
 
 DatabaseContext::DatabaseContext(ScriptExecutionContext* context)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_hasOpenDatabases(false)
     , m_isRegistered(true) // will register on construction below.
     , m_hasRequestedTermination(false)
index c33c747..81efa3e 100644 (file)
@@ -143,7 +143,7 @@ const char* WebSocket::subProtocolSeperator()
 }
 
 WebSocket::WebSocket(ScriptExecutionContext* context)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_state(CONNECTING)
     , m_bufferedAmount(0)
     , m_bufferedAmountAfterClose(0)
index d7d7d96..a7b6536 100644 (file)
@@ -103,7 +103,7 @@ void LoadFontCallback::notifyError()
 }
 
 FontLoader::FontLoader(Document* document)
-    : ActiveDOMObject(document, this)
+    : ActiveDOMObject(document)
     , m_document(document)
     , m_loadingCount(0)
 {
index c1e963e..f327b8c 100644 (file)
@@ -34,7 +34,7 @@
 
 namespace WebCore {
 
-ActiveDOMObject::ActiveDOMObject(ScriptExecutionContext* scriptExecutionContext, void* upcastPointer)
+ActiveDOMObject::ActiveDOMObject(ScriptExecutionContext* scriptExecutionContext)
     : ContextDestructionObserver(scriptExecutionContext)
     , m_pendingActivityCount(0)
 #if !ASSERT_DISABLED
@@ -45,7 +45,7 @@ ActiveDOMObject::ActiveDOMObject(ScriptExecutionContext* scriptExecutionContext,
         return;
 
     ASSERT(m_scriptExecutionContext->isContextThread());
-    m_scriptExecutionContext->didCreateActiveDOMObject(this, upcastPointer);
+    m_scriptExecutionContext->didCreateActiveDOMObject(this);
 }
 
 ActiveDOMObject::~ActiveDOMObject()
index 8c56bf9..5cb03aa 100644 (file)
@@ -35,7 +35,7 @@ namespace WebCore {
 
 class ActiveDOMObject : public ContextDestructionObserver {
 public:
-    ActiveDOMObject(ScriptExecutionContext*, void* upcastPointer);
+    ActiveDOMObject(ScriptExecutionContext*);
 
     // suspendIfNeeded() should be called exactly once after object construction to synchronize
     // the suspend state with that in ScriptExecutionContext.
index 882fd1a..f4757f3 100644 (file)
@@ -180,11 +180,11 @@ bool ScriptExecutionContext::canSuspendActiveDOMObjects()
 {
     // No protection against m_activeDOMObjects changing during iteration: canSuspend() shouldn't execute arbitrary JS.
     m_iteratingActiveDOMObjects = true;
-    HashMap<ActiveDOMObject*, void*>::iterator activeObjectsEnd = m_activeDOMObjects.end();
-    for (HashMap<ActiveDOMObject*, void*>::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) {
-        ASSERT(iter->key->scriptExecutionContext() == this);
-        ASSERT(iter->key->suspendIfNeededCalled());
-        if (!iter->key->canSuspend()) {
+    ActiveDOMObjectsSet::iterator activeObjectsEnd = m_activeDOMObjects.end();
+    for (ActiveDOMObjectsSet::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) {
+        ASSERT((*iter)->scriptExecutionContext() == this);
+        ASSERT((*iter)->suspendIfNeededCalled());
+        if (!(*iter)->canSuspend()) {
             m_iteratingActiveDOMObjects = false;
             return false;
         }
@@ -197,11 +197,11 @@ void ScriptExecutionContext::suspendActiveDOMObjects(ActiveDOMObject::ReasonForS
 {
     // No protection against m_activeDOMObjects changing during iteration: suspend() shouldn't execute arbitrary JS.
     m_iteratingActiveDOMObjects = true;
-    HashMap<ActiveDOMObject*, void*>::iterator activeObjectsEnd = m_activeDOMObjects.end();
-    for (HashMap<ActiveDOMObject*, void*>::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) {
-        ASSERT(iter->key->scriptExecutionContext() == this);
-        ASSERT(iter->key->suspendIfNeededCalled());
-        iter->key->suspend(why);
+    ActiveDOMObjectsSet::iterator activeObjectsEnd = m_activeDOMObjects.end();
+    for (ActiveDOMObjectsSet::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) {
+        ASSERT((*iter)->scriptExecutionContext() == this);
+        ASSERT((*iter)->suspendIfNeededCalled());
+        (*iter)->suspend(why);
     }
     m_iteratingActiveDOMObjects = false;
     m_activeDOMObjectsAreSuspended = true;
@@ -213,11 +213,11 @@ void ScriptExecutionContext::resumeActiveDOMObjects()
     m_activeDOMObjectsAreSuspended = false;
     // No protection against m_activeDOMObjects changing during iteration: resume() shouldn't execute arbitrary JS.
     m_iteratingActiveDOMObjects = true;
-    HashMap<ActiveDOMObject*, void*>::iterator activeObjectsEnd = m_activeDOMObjects.end();
-    for (HashMap<ActiveDOMObject*, void*>::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) {
-        ASSERT(iter->key->scriptExecutionContext() == this);
-        ASSERT(iter->key->suspendIfNeededCalled());
-        iter->key->resume();
+    ActiveDOMObjectsSet::iterator activeObjectsEnd = m_activeDOMObjects.end();
+    for (ActiveDOMObjectsSet::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) {
+        ASSERT((*iter)->scriptExecutionContext() == this);
+        ASSERT((*iter)->suspendIfNeededCalled());
+        (*iter)->resume();
     }
     m_iteratingActiveDOMObjects = false;
 }
@@ -227,11 +227,11 @@ void ScriptExecutionContext::stopActiveDOMObjects()
     m_activeDOMObjectsAreStopped = true;
     // No protection against m_activeDOMObjects changing during iteration: stop() shouldn't execute arbitrary JS.
     m_iteratingActiveDOMObjects = true;
-    HashMap<ActiveDOMObject*, void*>::iterator activeObjectsEnd = m_activeDOMObjects.end();
-    for (HashMap<ActiveDOMObject*, void*>::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) {
-        ASSERT(iter->key->scriptExecutionContext() == this);
-        ASSERT(iter->key->suspendIfNeededCalled());
-        iter->key->stop();
+    ActiveDOMObjectsSet::iterator activeObjectsEnd = m_activeDOMObjects.end();
+    for (ActiveDOMObjectsSet::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) {
+        ASSERT((*iter)->scriptExecutionContext() == this);
+        ASSERT((*iter)->suspendIfNeededCalled());
+        (*iter)->stop();
     }
     m_iteratingActiveDOMObjects = false;
 
@@ -247,14 +247,13 @@ void ScriptExecutionContext::suspendActiveDOMObjectIfNeeded(ActiveDOMObject* obj
         object->suspend(m_reasonForSuspendingActiveDOMObjects);
 }
 
-void ScriptExecutionContext::didCreateActiveDOMObject(ActiveDOMObject* object, void* upcastPointer)
+void ScriptExecutionContext::didCreateActiveDOMObject(ActiveDOMObject* object)
 {
     ASSERT(object);
-    ASSERT(upcastPointer);
     ASSERT(!m_inDestructor);
     if (m_iteratingActiveDOMObjects)
         CRASH();
-    m_activeDOMObjects.add(object, upcastPointer);
+    m_activeDOMObjects.add(object);
 }
 
 void ScriptExecutionContext::willDestroyActiveDOMObject(ActiveDOMObject* object)
index f634a48..9f19a3e 100644 (file)
@@ -36,7 +36,6 @@
 #include "SecurityContext.h"
 #include "Supplementable.h"
 #include <wtf/Forward.h>
-#include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/OwnPtr.h>
@@ -103,14 +102,14 @@ public:
     bool activeDOMObjectsAreStopped() const { return m_activeDOMObjectsAreStopped; }
 
     // Called from the constructor and destructors of ActiveDOMObject.
-    void didCreateActiveDOMObject(ActiveDOMObject*, void* upcastPointer);
+    void didCreateActiveDOMObject(ActiveDOMObject*);
     void willDestroyActiveDOMObject(ActiveDOMObject*);
 
     // Called after the construction of an ActiveDOMObject to synchronize suspend state.
     void suspendActiveDOMObjectIfNeeded(ActiveDOMObject*);
 
-    typedef const HashMap<ActiveDOMObject*, void*> ActiveDOMObjectsMap;
-    ActiveDOMObjectsMap& activeDOMObjects() const { return m_activeDOMObjects; }
+    typedef HashSet<ActiveDOMObject*> ActiveDOMObjectsSet;
+    const ActiveDOMObjectsSet& activeDOMObjects() const { return m_activeDOMObjects; }
 
     void didCreateDestructionObserver(ContextDestructionObserver*);
     void willDestroyDestructionObserver(ContextDestructionObserver*);
@@ -203,7 +202,7 @@ private:
 
     HashSet<MessagePort*> m_messagePorts;
     HashSet<ContextDestructionObserver*> m_destructionObservers;
-    HashMap<ActiveDOMObject*, void*> m_activeDOMObjects;
+    ActiveDOMObjectsSet m_activeDOMObjects;
     bool m_iteratingActiveDOMObjects;
     bool m_inDestructor;
 
index 128eb64..bf8c33d 100644 (file)
@@ -56,7 +56,7 @@ PassRefPtr<FileReader> FileReader::create(ScriptExecutionContext* context)
 }
 
 FileReader::FileReader(ScriptExecutionContext* context)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_state(EMPTY)
     , m_aborting(false)
     , m_readType(FileReaderLoader::ReadAsBinaryString)
index 55d94de..fa4dfdc 100644 (file)
@@ -37,7 +37,7 @@ using namespace HTMLNames;
 
 inline HTMLMarqueeElement::HTMLMarqueeElement(const QualifiedName& tagName, Document* document)
     : HTMLElement(tagName, document)
-    , ActiveDOMObject(document, this)
+    , ActiveDOMObject(document)
 {
     ASSERT(hasTagName(marqueeTag));
 }
index 5e230d8..92201b5 100644 (file)
@@ -236,7 +236,7 @@ private:
 
 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* document, bool createdByParser)
     : HTMLElement(tagName, document)
-    , ActiveDOMObject(document, this)
+    , ActiveDOMObject(document)
     , m_loadTimer(this, &HTMLMediaElement::loadTimerFired)
     , m_progressEventTimer(this, &HTMLMediaElement::progressEventTimerFired)
     , m_playbackProgressTimer(this, &HTMLMediaElement::playbackProgressTimerFired)
index a8b3dbc..0f6839d 100644 (file)
@@ -462,7 +462,7 @@ PassOwnPtr<WebGLRenderingContext> WebGLRenderingContext::create(HTMLCanvasElemen
 WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement* passedCanvas, PassRefPtr<GraphicsContext3D> context,
                                              GraphicsContext3D::Attributes attributes)
     : CanvasRenderingContext(passedCanvas)
-    , ActiveDOMObject(passedCanvas->document(), this)
+    , ActiveDOMObject(passedCanvas->document())
     , m_context(context)
     , m_drawingBuffer(0)
     , m_dispatchContextLostEventTimer(this, &WebGLRenderingContext::dispatchContextLostEvent)
index 51ea25e..07d91f6 100644 (file)
@@ -60,7 +60,7 @@ PassOwnPtr<Prerenderer> Prerenderer::create(Document* document)
 }
 
 Prerenderer::Prerenderer(Document* document)
-    : ActiveDOMObject(document, this)
+    : ActiveDOMObject(document)
     , m_initializedClient(false)
     , m_client(0)
 {
index c6ca0c9..6e8da92 100644 (file)
@@ -59,7 +59,7 @@ namespace WebCore {
 const unsigned long long EventSource::defaultReconnectDelay = 3000;
 
 inline EventSource::EventSource(ScriptExecutionContext* context, const KURL& url, const Dictionary& eventSourceInit)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_url(url)
     , m_withCredentials(false)
     , m_state(CONNECTING)
index 15e5628..57afcc5 100644 (file)
@@ -32,7 +32,7 @@
 namespace WebCore {
 
 SuspendableTimer::SuspendableTimer(ScriptExecutionContext* context)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_nextFireInterval(0)
     , m_repeatInterval(0)
     , m_active(false)
index 0ad995b..735041e 100644 (file)
@@ -47,7 +47,7 @@
 namespace WebCore {
 
 AbstractWorker::AbstractWorker(ScriptExecutionContext* context)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
 {
 }
 
index 88b198d..0ae0f89 100644 (file)
@@ -181,10 +181,9 @@ WorkerNavigator* WorkerContext::navigator() const
 
 bool WorkerContext::hasPendingActivity() const
 {
-    ActiveDOMObjectsMap& activeObjects = activeDOMObjects();
-    ActiveDOMObjectsMap::const_iterator activeObjectsEnd = activeObjects.end();
-    for (ActiveDOMObjectsMap::const_iterator iter = activeObjects.begin(); iter != activeObjectsEnd; ++iter) {
-        if (iter->key->hasPendingActivity())
+    ActiveDOMObjectsSet::const_iterator activeObjectsEnd = activeDOMObjects().end();
+    for (ActiveDOMObjectsSet::const_iterator iter = activeDOMObjects().begin(); iter != activeObjectsEnd; ++iter) {
+        if ((*iter)->hasPendingActivity())
             return true;
     }
 
index ee02400..6510258 100644 (file)
@@ -180,7 +180,7 @@ PassRefPtr<XMLHttpRequest> XMLHttpRequest::create(ScriptExecutionContext* contex
 }
 
 XMLHttpRequest::XMLHttpRequest(ScriptExecutionContext* context, PassRefPtr<SecurityOrigin> securityOrigin)
-    : ActiveDOMObject(context, this)
+    : ActiveDOMObject(context)
     , m_async(true)
     , m_includeCredentials(false)
 #if ENABLE(XHR_TIMEOUT)