Purge PassRefPtr in WebCore/Modules - 3
authorgyuyoung.kim@webkit.org <gyuyoung.kim@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Jun 2015 01:04:32 +0000 (01:04 +0000)
committergyuyoung.kim@webkit.org <gyuyoung.kim@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Jun 2015 01:04:32 +0000 (01:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145508

Reviewed by Darin Adler.

As a step to purge PassRefPtr, this patch removes PassRefPtr, then use Ref or RefPtr.

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::create):
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBCursorBackend.h:
(WebCore::IDBCursorBackend::create):
* Modules/indexeddb/IDBCursorBackendOperations.h:
(WebCore::CursorIterationOperation::create):
(WebCore::CursorAdvanceOperation::create):
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::create):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabaseBackend.cpp:
(WebCore::IDBDatabaseBackend::create):
* Modules/indexeddb/IDBDatabaseBackend.h:
* Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
(WebCore::IDBDatabaseCallbacksImpl::create):
* Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
* Modules/indexeddb/IDBDatabaseError.h:
(WebCore::IDBDatabaseError::create):
* Modules/indexeddb/IDBIndex.h:
(WebCore::IDBIndex::create):
* Modules/indexeddb/IDBKey.h:
(WebCore::IDBKey::createInvalid):
(WebCore::IDBKey::createNumber):
(WebCore::IDBKey::createString):
(WebCore::IDBKey::createDate):
(WebCore::IDBKey::createArray):
* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::create):
* Modules/indexeddb/IDBKeyRange.h:
(WebCore::IDBKeyRange::create):
* Modules/indexeddb/IDBObjectStore.cpp:
* Modules/indexeddb/IDBObjectStore.h:
(WebCore::IDBObjectStore::create):
* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::create):
* Modules/indexeddb/IDBOpenDBRequest.h:
* Modules/indexeddb/IDBRecordIdentifier.h:
(WebCore::IDBRecordIdentifier::create):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::create):
(WebCore::IDBRequest::getResultCursor):
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::create):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/IDBTransactionBackend.cpp:
(WebCore::IDBTransactionBackend::create):
* Modules/indexeddb/IDBTransactionBackend.h:
* Modules/indexeddb/IDBTransactionBackendOperations.h:
(WebCore::CreateObjectStoreOperation::create):
(WebCore::DeleteObjectStoreOperation::create):
(WebCore::IDBDatabaseBackend::VersionChangeOperation::create):
(WebCore::CreateObjectStoreAbortOperation::create):
(WebCore::DeleteObjectStoreAbortOperation::create):
(WebCore::IDBDatabaseBackend::VersionChangeAbortOperation::create):
(WebCore::CreateIndexOperation::create):
(WebCore::CreateIndexAbortOperation::create):
(WebCore::DeleteIndexOperation::create):
(WebCore::DeleteIndexAbortOperation::create):
(WebCore::GetOperation::create):
(WebCore::PutOperation::create):
(WebCore::SetIndexesReadyOperation::create):
(WebCore::OpenCursorOperation::create):
(WebCore::CountOperation::create):
(WebCore::DeleteRangeOperation::create):
(WebCore::ClearObjectStoreOperation::create):
* Modules/mediasource/VideoPlaybackQuality.cpp:
(WebCore::VideoPlaybackQuality::create):
* Modules/mediasource/VideoPlaybackQuality.h:
* Modules/mediastream/MediaConstraintsImpl.cpp:
(WebCore::MediaConstraintsImpl::create):
* Modules/mediastream/MediaConstraintsImpl.h:
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::create):
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::create):
* Modules/mediastream/RTCDTMFSender.h:
* Modules/mediastream/RTCOfferAnswerOptions.cpp:
(WebCore::RTCOfferAnswerOptions::create):
(WebCore::RTCOfferOptions::create):
* Modules/mediastream/RTCOfferAnswerOptions.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::parseConfiguration):
(WebCore::RTCPeerConnection::create):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::create):
* Modules/webdatabase/AbstractDatabaseServer.h:
* Modules/webdatabase/DOMWindowWebDatabase.cpp:
(WebCore::DOMWindowWebDatabase::openDatabase):
* Modules/webdatabase/DOMWindowWebDatabase.h:
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::existingDatabaseContextFor):
(WebCore::DatabaseManager::databaseContextFor):
(WebCore::DatabaseManager::openDatabase):
* Modules/webdatabase/DatabaseManager.h:
* Modules/webdatabase/DatabaseServer.cpp:
(WebCore::DatabaseServer::openDatabase):
(WebCore::DatabaseServer::createDatabase):
* Modules/webdatabase/DatabaseServer.h:

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

49 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBCursor.cpp
Source/WebCore/Modules/indexeddb/IDBCursor.h
Source/WebCore/Modules/indexeddb/IDBCursorBackend.h
Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.h
Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
Source/WebCore/Modules/indexeddb/IDBDatabase.h
Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h
Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h
Source/WebCore/Modules/indexeddb/IDBDatabaseError.h
Source/WebCore/Modules/indexeddb/IDBIndex.h
Source/WebCore/Modules/indexeddb/IDBKey.h
Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp
Source/WebCore/Modules/indexeddb/IDBKeyRange.h
Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
Source/WebCore/Modules/indexeddb/IDBObjectStore.h
Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h
Source/WebCore/Modules/indexeddb/IDBRecordIdentifier.h
Source/WebCore/Modules/indexeddb/IDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBRequest.h
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
Source/WebCore/Modules/indexeddb/IDBTransaction.h
Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp
Source/WebCore/Modules/indexeddb/IDBTransactionBackend.h
Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.h
Source/WebCore/Modules/mediasource/VideoPlaybackQuality.cpp
Source/WebCore/Modules/mediasource/VideoPlaybackQuality.h
Source/WebCore/Modules/mediastream/MediaConstraintsImpl.cpp
Source/WebCore/Modules/mediastream/MediaConstraintsImpl.h
Source/WebCore/Modules/mediastream/MediaStream.cpp
Source/WebCore/Modules/mediastream/MediaStream.h
Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp
Source/WebCore/Modules/mediastream/RTCDTMFSender.h
Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.cpp
Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.h
Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
Source/WebCore/Modules/mediastream/RTCPeerConnection.h
Source/WebCore/Modules/webaudio/AudioContext.cpp
Source/WebCore/Modules/webdatabase/AbstractDatabaseServer.h
Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.cpp
Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.h
Source/WebCore/Modules/webdatabase/DatabaseManager.cpp
Source/WebCore/Modules/webdatabase/DatabaseManager.h
Source/WebCore/Modules/webdatabase/DatabaseServer.cpp
Source/WebCore/Modules/webdatabase/DatabaseServer.h
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp

index 9bb1dff..f7e2f72 100644 (file)
@@ -1,3 +1,115 @@
+2015-06-01  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
+
+        Purge PassRefPtr in WebCore/Modules - 3
+        https://bugs.webkit.org/show_bug.cgi?id=145508
+
+        Reviewed by Darin Adler.
+
+        As a step to purge PassRefPtr, this patch removes PassRefPtr, then use Ref or RefPtr.
+
+        * Modules/indexeddb/IDBCursor.cpp:
+        (WebCore::IDBCursor::create):
+        * Modules/indexeddb/IDBCursor.h:
+        * Modules/indexeddb/IDBCursorBackend.h:
+        (WebCore::IDBCursorBackend::create):
+        * Modules/indexeddb/IDBCursorBackendOperations.h:
+        (WebCore::CursorIterationOperation::create):
+        (WebCore::CursorAdvanceOperation::create):
+        * Modules/indexeddb/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::create):
+        * Modules/indexeddb/IDBDatabase.h:
+        * Modules/indexeddb/IDBDatabaseBackend.cpp:
+        (WebCore::IDBDatabaseBackend::create):
+        * Modules/indexeddb/IDBDatabaseBackend.h:
+        * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
+        (WebCore::IDBDatabaseCallbacksImpl::create):
+        * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
+        * Modules/indexeddb/IDBDatabaseError.h:
+        (WebCore::IDBDatabaseError::create):
+        * Modules/indexeddb/IDBIndex.h:
+        (WebCore::IDBIndex::create):
+        * Modules/indexeddb/IDBKey.h:
+        (WebCore::IDBKey::createInvalid):
+        (WebCore::IDBKey::createNumber):
+        (WebCore::IDBKey::createString):
+        (WebCore::IDBKey::createDate):
+        (WebCore::IDBKey::createArray):
+        * Modules/indexeddb/IDBKeyRange.cpp:
+        (WebCore::IDBKeyRange::create):
+        * Modules/indexeddb/IDBKeyRange.h:
+        (WebCore::IDBKeyRange::create):
+        * Modules/indexeddb/IDBObjectStore.cpp:
+        * Modules/indexeddb/IDBObjectStore.h:
+        (WebCore::IDBObjectStore::create):
+        * Modules/indexeddb/IDBOpenDBRequest.cpp:
+        (WebCore::IDBOpenDBRequest::create):
+        * Modules/indexeddb/IDBOpenDBRequest.h:
+        * Modules/indexeddb/IDBRecordIdentifier.h:
+        (WebCore::IDBRecordIdentifier::create):
+        * Modules/indexeddb/IDBRequest.cpp:
+        (WebCore::IDBRequest::create):
+        (WebCore::IDBRequest::getResultCursor):
+        * Modules/indexeddb/IDBRequest.h:
+        * Modules/indexeddb/IDBTransaction.cpp:
+        (WebCore::IDBTransaction::create):
+        * Modules/indexeddb/IDBTransaction.h:
+        * Modules/indexeddb/IDBTransactionBackend.cpp:
+        (WebCore::IDBTransactionBackend::create):
+        * Modules/indexeddb/IDBTransactionBackend.h:
+        * Modules/indexeddb/IDBTransactionBackendOperations.h:
+        (WebCore::CreateObjectStoreOperation::create):
+        (WebCore::DeleteObjectStoreOperation::create):
+        (WebCore::IDBDatabaseBackend::VersionChangeOperation::create):
+        (WebCore::CreateObjectStoreAbortOperation::create):
+        (WebCore::DeleteObjectStoreAbortOperation::create):
+        (WebCore::IDBDatabaseBackend::VersionChangeAbortOperation::create):
+        (WebCore::CreateIndexOperation::create):
+        (WebCore::CreateIndexAbortOperation::create):
+        (WebCore::DeleteIndexOperation::create):
+        (WebCore::DeleteIndexAbortOperation::create):
+        (WebCore::GetOperation::create):
+        (WebCore::PutOperation::create):
+        (WebCore::SetIndexesReadyOperation::create):
+        (WebCore::OpenCursorOperation::create):
+        (WebCore::CountOperation::create):
+        (WebCore::DeleteRangeOperation::create):
+        (WebCore::ClearObjectStoreOperation::create):
+        * Modules/mediasource/VideoPlaybackQuality.cpp:
+        (WebCore::VideoPlaybackQuality::create):
+        * Modules/mediasource/VideoPlaybackQuality.h:
+        * Modules/mediastream/MediaConstraintsImpl.cpp:
+        (WebCore::MediaConstraintsImpl::create):
+        * Modules/mediastream/MediaConstraintsImpl.h:
+        * Modules/mediastream/MediaStream.cpp:
+        (WebCore::MediaStream::create):
+        * Modules/mediastream/MediaStream.h:
+        * Modules/mediastream/RTCDTMFSender.cpp:
+        (WebCore::RTCDTMFSender::create):
+        * Modules/mediastream/RTCDTMFSender.h:
+        * Modules/mediastream/RTCOfferAnswerOptions.cpp:
+        (WebCore::RTCOfferAnswerOptions::create):
+        (WebCore::RTCOfferOptions::create):
+        * Modules/mediastream/RTCOfferAnswerOptions.h:
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        (WebCore::RTCPeerConnection::parseConfiguration):
+        (WebCore::RTCPeerConnection::create):
+        * Modules/mediastream/RTCPeerConnection.h:
+        * Modules/webaudio/AudioContext.cpp:
+        (WebCore::AudioContext::create):
+        * Modules/webdatabase/AbstractDatabaseServer.h:
+        * Modules/webdatabase/DOMWindowWebDatabase.cpp:
+        (WebCore::DOMWindowWebDatabase::openDatabase):
+        * Modules/webdatabase/DOMWindowWebDatabase.h:
+        * Modules/webdatabase/DatabaseManager.cpp:
+        (WebCore::DatabaseManager::existingDatabaseContextFor):
+        (WebCore::DatabaseManager::databaseContextFor):
+        (WebCore::DatabaseManager::openDatabase):
+        * Modules/webdatabase/DatabaseManager.h:
+        * Modules/webdatabase/DatabaseServer.cpp:
+        (WebCore::DatabaseServer::openDatabase):
+        (WebCore::DatabaseServer::createDatabase):
+        * Modules/webdatabase/DatabaseServer.h:
+
 2015-06-01  Daniel Bates  <dabates@apple.com>
 
         Notify client that we began editing when text field is focused
index 2e846dd..a20e1e1 100644 (file)
@@ -43,9 +43,9 @@
 
 namespace WebCore {
 
-PassRefPtr<IDBCursor> IDBCursor::create(PassRefPtr<IDBCursorBackend> backend, IndexedDB::CursorDirection direction, IDBRequest* request, IDBAny* source, IDBTransaction* transaction)
+Ref<IDBCursor> IDBCursor::create(PassRefPtr<IDBCursorBackend> backend, IndexedDB::CursorDirection direction, IDBRequest* request, IDBAny* source, IDBTransaction* transaction)
 {
-    return adoptRef(new IDBCursor(backend, direction, request, source, transaction));
+    return adoptRef(*new IDBCursor(backend, direction, request, source, transaction));
 }
 
 const AtomicString& IDBCursor::directionNext()
index b58d5ae..c43cb4a 100644 (file)
@@ -58,7 +58,7 @@ public:
     static IndexedDB::CursorDirection stringToDirection(const String& modeString, ExceptionCode&);
     static const AtomicString& directionToString(IndexedDB::CursorDirection mode);
 
-    static PassRefPtr<IDBCursor> create(PassRefPtr<IDBCursorBackend>, IndexedDB::CursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
+    static Ref<IDBCursor> create(PassRefPtr<IDBCursorBackend>, IndexedDB::CursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
     virtual ~IDBCursor();
 
     // Implement the IDL
index 994341f..424d1f9 100644 (file)
@@ -40,13 +40,13 @@ class SharedBuffer;
 
 class IDBCursorBackend : public RefCounted<IDBCursorBackend> {
 public:
-    static PassRefPtr<IDBCursorBackend> create(int64_t cursorID, IndexedDB::CursorType cursorType, IDBTransactionBackend& transaction, int64_t objectStoreID)
+    static Ref<IDBCursorBackend> create(int64_t cursorID, IndexedDB::CursorType cursorType, IDBTransactionBackend& transaction, int64_t objectStoreID)
     {
-        return adoptRef(new IDBCursorBackend(cursorID, cursorType, IDBDatabaseBackend::NormalTask, transaction, objectStoreID));
+        return adoptRef(*new IDBCursorBackend(cursorID, cursorType, IDBDatabaseBackend::NormalTask, transaction, objectStoreID));
     }
-    static PassRefPtr<IDBCursorBackend> create(int64_t cursorID, IndexedDB::CursorType cursorType, IDBDatabaseBackend::TaskType taskType, IDBTransactionBackend& transaction, int64_t objectStoreID)
+    static Ref<IDBCursorBackend> create(int64_t cursorID, IndexedDB::CursorType cursorType, IDBDatabaseBackend::TaskType taskType, IDBTransactionBackend& transaction, int64_t objectStoreID)
     {
-        return adoptRef(new IDBCursorBackend(cursorID, cursorType, taskType, transaction, objectStoreID));
+        return adoptRef(*new IDBCursorBackend(cursorID, cursorType, taskType, transaction, objectStoreID));
     }
     ~IDBCursorBackend();
 
index 467f1de..627977b 100644 (file)
@@ -36,9 +36,9 @@ namespace WebCore {
 
 class CursorIterationOperation : public IDBOperation {
 public:
-    static PassRefPtr<IDBOperation> create(PassRefPtr<IDBCursorBackend> cursor, PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks)
+    static Ref<IDBOperation> create(PassRefPtr<IDBCursorBackend> cursor, PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks)
     {
-        return adoptRef(new CursorIterationOperation(cursor, key, callbacks));
+        return adoptRef(*new CursorIterationOperation(cursor, key, callbacks));
     }
     virtual void perform(std::function<void()> completionCallback) override final;
 
@@ -60,9 +60,9 @@ private:
 
 class CursorAdvanceOperation : public IDBOperation {
 public:
-    static PassRefPtr<IDBOperation> create(PassRefPtr<IDBCursorBackend> cursor, unsigned long count, PassRefPtr<IDBCallbacks> callbacks)
+    static Ref<IDBOperation> create(PassRefPtr<IDBCursorBackend> cursor, unsigned long count, PassRefPtr<IDBCallbacks> callbacks)
     {
-        return adoptRef(new CursorAdvanceOperation(cursor, count, callbacks));
+        return adoptRef(*new CursorAdvanceOperation(cursor, count, callbacks));
     }
     virtual void perform(std::function<void()> completionCallback) override final;
 
index 4a1be81..47fa4e0 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<IDBDatabase> IDBDatabase::create(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseBackend> database, PassRefPtr<IDBDatabaseCallbacks> callbacks)
+Ref<IDBDatabase> IDBDatabase::create(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseBackend> database, PassRefPtr<IDBDatabaseCallbacks> callbacks)
 {
-    RefPtr<IDBDatabase> idbDatabase(adoptRef(new IDBDatabase(context, database, callbacks)));
+    Ref<IDBDatabase> idbDatabase(adoptRef(*new IDBDatabase(context, database, callbacks)));
     idbDatabase->suspendIfNeeded();
-    return idbDatabase.release();
+    return idbDatabase;
 }
 
 IDBDatabase::IDBDatabase(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseBackend> backend, PassRefPtr<IDBDatabaseCallbacks> callbacks)
index 58e2f6c..48179b4 100644 (file)
@@ -51,7 +51,7 @@ typedef int ExceptionCode;
 
 class IDBDatabase final : public RefCounted<IDBDatabase>, public ScriptWrappable, public EventTargetWithInlineData, public ActiveDOMObject {
 public:
-    static PassRefPtr<IDBDatabase> create(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackend>, PassRefPtr<IDBDatabaseCallbacks>);
+    static Ref<IDBDatabase> create(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackend>, PassRefPtr<IDBDatabaseCallbacks>);
     ~IDBDatabase();
 
     void setMetadata(const IDBDatabaseMetadata& metadata) { m_metadata = metadata; }
index c82926a..e5943dc 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<IDBDatabaseBackend> IDBDatabaseBackend::create(const String& name, const String& uniqueIdentifier, IDBFactoryBackendInterface* factory, IDBServerConnection& serverConnection)
+Ref<IDBDatabaseBackend> IDBDatabaseBackend::create(const String& name, const String& uniqueIdentifier, IDBFactoryBackendInterface* factory, IDBServerConnection& serverConnection)
 {
-    RefPtr<IDBDatabaseBackend> backend = adoptRef(new IDBDatabaseBackend(name, uniqueIdentifier, factory, serverConnection));
+    Ref<IDBDatabaseBackend> backend = adoptRef(*new IDBDatabaseBackend(name, uniqueIdentifier, factory, serverConnection));
     backend->openInternalAsync();
     
-    return backend.release();
+    return backend;
 }
 
 IDBDatabaseBackend::IDBDatabaseBackend(const String& name, const String& uniqueIdentifier, IDBFactoryBackendInterface* factory, IDBServerConnection& serverConnection)
index f24046a..3819926 100644 (file)
@@ -59,7 +59,7 @@ typedef int ExceptionCode;
 
 class IDBDatabaseBackend : public RefCounted<IDBDatabaseBackend> {
 public:
-    WEBCORE_EXPORT static PassRefPtr<IDBDatabaseBackend> create(const String& name, const String& uniqueIdentifier, IDBFactoryBackendInterface*, IDBServerConnection&);
+    WEBCORE_EXPORT static Ref<IDBDatabaseBackend> create(const String& name, const String& uniqueIdentifier, IDBFactoryBackendInterface*, IDBServerConnection&);
     WEBCORE_EXPORT ~IDBDatabaseBackend();
 
     IDBServerConnection& serverConnection() { return m_serverConnection.get(); }
index 587c4a7..d92a351 100644 (file)
@@ -32,9 +32,9 @@
 
 namespace WebCore {
 
-PassRefPtr<IDBDatabaseCallbacksImpl> IDBDatabaseCallbacksImpl::create()
+Ref<IDBDatabaseCallbacksImpl> IDBDatabaseCallbacksImpl::create()
 {
-    return adoptRef(new IDBDatabaseCallbacksImpl());
+    return adoptRef(*new IDBDatabaseCallbacksImpl());
 }
 
 IDBDatabaseCallbacksImpl::IDBDatabaseCallbacksImpl()
index 248332a..f7d5a22 100644 (file)
@@ -38,7 +38,7 @@ class IDBDatabase;
 
 class IDBDatabaseCallbacksImpl final : public IDBDatabaseCallbacks {
 public:
-    static PassRefPtr<IDBDatabaseCallbacksImpl> create();
+    static Ref<IDBDatabaseCallbacksImpl> create();
     virtual ~IDBDatabaseCallbacksImpl() override;
 
     // IDBDatabaseCallbacks
index 7a939b5..8fb459d 100644 (file)
@@ -37,18 +37,18 @@ namespace WebCore {
 
 class IDBDatabaseError : public RefCounted<IDBDatabaseError> {
 public:
-    static PassRefPtr<IDBDatabaseError> create(unsigned short code)
+    static Ref<IDBDatabaseError> create(unsigned short code)
     {
         ASSERT(code >= IDBDatabaseException::IDBDatabaseExceptionOffset);
         ASSERT(code < IDBDatabaseException::IDBDatabaseExceptionMax);
-        return adoptRef(new IDBDatabaseError(code));
+        return adoptRef(*new IDBDatabaseError(code));
     }
 
-    static PassRefPtr<IDBDatabaseError> create(unsigned short code, const String& message)
+    static Ref<IDBDatabaseError> create(unsigned short code, const String& message)
     {
         ASSERT_WITH_MESSAGE(code >= IDBDatabaseException::IDBDatabaseExceptionOffset, "%d >= %d", code, IDBDatabaseException::IDBDatabaseExceptionOffset);
         ASSERT(code < IDBDatabaseException::IDBDatabaseExceptionMax);
-        return adoptRef(new IDBDatabaseError(code, message));
+        return adoptRef(*new IDBDatabaseError(code, message));
     }
 
     ~IDBDatabaseError() { }
index f954ad6..b16f78f 100644 (file)
@@ -45,9 +45,9 @@ class IDBObjectStore;
 
 class IDBIndex : public ScriptWrappable, public RefCounted<IDBIndex> {
 public:
-    static PassRefPtr<IDBIndex> create(const IDBIndexMetadata& metadata, IDBObjectStore* objectStore, IDBTransaction* transaction)
+    static Ref<IDBIndex> create(const IDBIndexMetadata& metadata, IDBObjectStore* objectStore, IDBTransaction* transaction)
     {
-        return adoptRef(new IDBIndex(metadata, objectStore, transaction));
+        return adoptRef(*new IDBIndex(metadata, objectStore, transaction));
     }
     ~IDBIndex();
 
index 78530b3..6d2a2a3 100644 (file)
@@ -39,24 +39,24 @@ class IDBKey : public RefCounted<IDBKey> {
 public:
     typedef Vector<RefPtr<IDBKey>> KeyArray;
 
-    static PassRefPtr<IDBKey> createInvalid()
+    static Ref<IDBKey> createInvalid()
     {
-        return adoptRef(new IDBKey());
+        return adoptRef(*new IDBKey());
     }
 
-    static PassRefPtr<IDBKey> createNumber(double number)
+    static Ref<IDBKey> createNumber(double number)
     {
-        return adoptRef(new IDBKey(NumberType, number));
+        return adoptRef(*new IDBKey(NumberType, number));
     }
 
-    static PassRefPtr<IDBKey> createString(const String& string)
+    static Ref<IDBKey> createString(const String& string)
     {
-        return adoptRef(new IDBKey(string));
+        return adoptRef(*new IDBKey(string));
     }
 
-    static PassRefPtr<IDBKey> createDate(double date)
+    static Ref<IDBKey> createDate(double date)
     {
-        return adoptRef(new IDBKey(DateType, date));
+        return adoptRef(*new IDBKey(DateType, date));
     }
 
     static PassRefPtr<IDBKey> createMultiEntryArray(const KeyArray& array)
@@ -85,13 +85,13 @@ public:
         return idbKey.release();
     }
 
-    static PassRefPtr<IDBKey> createArray(const KeyArray& array)
+    static Ref<IDBKey> createArray(const KeyArray& array)
     {
         size_t sizeEstimate = 0;
         for (size_t i = 0; i < array.size(); ++i)
             sizeEstimate += array[i]->m_sizeEstimate;
 
-        return adoptRef(new IDBKey(array, sizeEstimate));
+        return adoptRef(*new IDBKey(array, sizeEstimate));
     }
 
     WEBCORE_EXPORT ~IDBKey();
index 3d54fc2..f6b17e0 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<IDBKeyRange> IDBKeyRange::create(PassRefPtr<IDBKey> prpKey)
+Ref<IDBKeyRange> IDBKeyRange::create(PassRefPtr<IDBKey> prpKey)
 {
     RefPtr<IDBKey> key = prpKey;
-    return adoptRef(new IDBKeyRange(key, key, LowerBoundClosed, UpperBoundClosed));
+    return adoptRef(*new IDBKeyRange(key, key, LowerBoundClosed, UpperBoundClosed));
 }
 
 IDBKeyRange::IDBKeyRange(PassRefPtr<IDBKey> lower, PassRefPtr<IDBKey> upper, LowerBoundType lowerType, UpperBoundType upperType)
index a168db4..3397bd2 100644 (file)
@@ -49,11 +49,11 @@ public:
         UpperBoundClosed
     };
 
-    static PassRefPtr<IDBKeyRange> create(PassRefPtr<IDBKey> lower, PassRefPtr<IDBKey> upper, LowerBoundType lowerType, UpperBoundType upperType)
+    static Ref<IDBKeyRange> create(PassRefPtr<IDBKey> lower, PassRefPtr<IDBKey> upper, LowerBoundType lowerType, UpperBoundType upperType)
     {
-        return adoptRef(new IDBKeyRange(lower, upper, lowerType, upperType));
+        return adoptRef(*new IDBKeyRange(lower, upper, lowerType, upperType));
     }
-    static PassRefPtr<IDBKeyRange> create(PassRefPtr<IDBKey> prpKey);
+    static Ref<IDBKeyRange> create(PassRefPtr<IDBKey> prpKey);
     ~IDBKeyRange() { }
 
     PassRefPtr<IDBKey> lower() const { return m_lower; }
index 4ef49ac..e86082c 100644 (file)
@@ -281,9 +281,9 @@ namespace {
 // cursor success handlers are kept alive.
 class IndexPopulator : public EventListener {
 public:
-    static PassRefPtr<IndexPopulator> create(PassRefPtr<IDBDatabaseBackend> backend, int64_t transactionId, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
+    static Ref<IndexPopulator> create(PassRefPtr<IDBDatabaseBackend> backend, int64_t transactionId, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
     {
-        return adoptRef(new IndexPopulator(backend, transactionId, objectStoreId, indexMetadata));
+        return adoptRef(*new IndexPopulator(backend, transactionId, objectStoreId, indexMetadata));
     }
 
     virtual bool operator==(const EventListener& other)
index da65a05..7fdec84 100644 (file)
@@ -50,9 +50,9 @@ class IDBAny;
 
 class IDBObjectStore : public ScriptWrappable, public RefCounted<IDBObjectStore> {
 public:
-    static PassRefPtr<IDBObjectStore> create(const IDBObjectStoreMetadata& metadata, IDBTransaction* transaction)
+    static Ref<IDBObjectStore> create(const IDBObjectStoreMetadata& metadata, IDBTransaction* transaction)
     {
-        return adoptRef(new IDBObjectStore(metadata, transaction));
+        return adoptRef(*new IDBObjectStore(metadata, transaction));
     }
     ~IDBObjectStore() { }
 
index e929c6c..4bf7b6e 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<IDBOpenDBRequest> IDBOpenDBRequest::create(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseCallbacks> callbacks, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness versionNullness)
+Ref<IDBOpenDBRequest> IDBOpenDBRequest::create(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseCallbacks> callbacks, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness versionNullness)
 {
-    RefPtr<IDBOpenDBRequest> request(adoptRef(new IDBOpenDBRequest(context, callbacks, transactionId, version, versionNullness)));
+    Ref<IDBOpenDBRequest> request(adoptRef(*new IDBOpenDBRequest(context, callbacks, transactionId, version, versionNullness)));
     request->suspendIfNeeded();
-    return request.release();
+    return request;
 }
 
 IDBOpenDBRequest::IDBOpenDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseCallbacks> callbacks, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness versionNullness)
index 3339fa3..7aa8b0d 100644 (file)
@@ -37,7 +37,7 @@ class IDBDatabaseCallbacks;
 
 class IDBOpenDBRequest : public IDBRequest {
 public:
-    static PassRefPtr<IDBOpenDBRequest> create(ScriptExecutionContext*, PassRefPtr<IDBDatabaseCallbacks>, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness);
+    static Ref<IDBOpenDBRequest> create(ScriptExecutionContext*, PassRefPtr<IDBDatabaseCallbacks>, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness);
     virtual ~IDBOpenDBRequest();
 
     using IDBRequest::onSuccess;
index f03a69d..e658ecc 100644 (file)
@@ -37,14 +37,14 @@ namespace WebCore {
 
 class IDBRecordIdentifier : public RefCounted<IDBRecordIdentifier> {
 public:
-    static PassRefPtr<IDBRecordIdentifier> create(const Vector<char>& encodedPrimaryKey, int64_t version)
+    static Ref<IDBRecordIdentifier> create(const Vector<char>& encodedPrimaryKey, int64_t version)
     {
-        return adoptRef(new IDBRecordIdentifier(encodedPrimaryKey, version));
+        return adoptRef(*new IDBRecordIdentifier(encodedPrimaryKey, version));
     }
 
-    static PassRefPtr<IDBRecordIdentifier> create()
+    static Ref<IDBRecordIdentifier> create()
     {
-        return adoptRef(new IDBRecordIdentifier);
+        return adoptRef(*new IDBRecordIdentifier);
     }
 
     const Vector<char>& encodedPrimaryKey() const { return m_encodedPrimaryKey; }
index 2cac325..154a06f 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<IDBRequest> IDBRequest::create(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, IDBTransaction* transaction)
+Ref<IDBRequest> IDBRequest::create(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, IDBTransaction* transaction)
 {
-    RefPtr<IDBRequest> request(adoptRef(new IDBRequest(context, source, IDBDatabaseBackend::NormalTask, transaction)));
+    Ref<IDBRequest> request(adoptRef(*new IDBRequest(context, source, IDBDatabaseBackend::NormalTask, transaction)));
     request->suspendIfNeeded();
     // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames) are not associated with transactions.
     if (transaction)
-        transaction->registerRequest(request.get());
-    return request.release();
+        transaction->registerRequest(request.ptr());
+    return request;
 }
 
-PassRefPtr<IDBRequest> IDBRequest::create(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, IDBDatabaseBackend::TaskType taskType, IDBTransaction* transaction)
+Ref<IDBRequest> IDBRequest::create(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, IDBDatabaseBackend::TaskType taskType, IDBTransaction* transaction)
 {
-    RefPtr<IDBRequest> request(adoptRef(new IDBRequest(context, source, taskType, transaction)));
+    Ref<IDBRequest> request(adoptRef(*new IDBRequest(context, source, taskType, transaction)));
     request->suspendIfNeeded();
     // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames) are not associated with transactions.
     if (transaction)
-        transaction->registerRequest(request.get());
-    return request.release();
+        transaction->registerRequest(request.ptr());
+    return request;
 }
 
 IDBRequest::IDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, IDBDatabaseBackend::TaskType taskType, IDBTransaction* transaction)
@@ -202,15 +202,15 @@ void IDBRequest::setPendingCursor(PassRefPtr<IDBCursor> cursor)
     m_transaction->registerRequest(this);
 }
 
-PassRefPtr<IDBCursor> IDBRequest::getResultCursor()
+RefPtr<IDBCursor> IDBRequest::getResultCursor()
 {
     if (!m_result)
-        return 0;
+        return nullptr;
     if (m_result->type() == IDBAny::IDBCursorType)
         return m_result->idbCursor();
     if (m_result->type() == IDBAny::IDBCursorWithValueType)
         return m_result->idbCursorWithValue();
-    return 0;
+    return nullptr;
 }
 
 void IDBRequest::setResultCursor(PassRefPtr<IDBCursor> cursor, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, const Deprecated::ScriptValue& value)
index 79edc64..183b9fc 100644 (file)
@@ -53,8 +53,8 @@ typedef int ExceptionCode;
 
 class IDBRequest : public ScriptWrappable, public IDBCallbacks, public EventTargetWithInlineData, public ActiveDOMObject {
 public:
-    static PassRefPtr<IDBRequest> create(ScriptExecutionContext*, PassRefPtr<IDBAny> source, IDBTransaction*);
-    static PassRefPtr<IDBRequest> create(ScriptExecutionContext*, PassRefPtr<IDBAny> source, IDBDatabaseBackend::TaskType, IDBTransaction*);
+    static Ref<IDBRequest> create(ScriptExecutionContext*, PassRefPtr<IDBAny> source, IDBTransaction*);
+    static Ref<IDBRequest> create(ScriptExecutionContext*, PassRefPtr<IDBAny> source, IDBDatabaseBackend::TaskType, IDBTransaction*);
     virtual ~IDBRequest();
 
     PassRefPtr<IDBAny> result(ExceptionCode&) const;
@@ -136,7 +136,7 @@ private:
     virtual void refEventTarget() override final { ref(); }
     virtual void derefEventTarget() override final { deref(); }
 
-    PassRefPtr<IDBCursor> getResultCursor();
+    RefPtr<IDBCursor> getResultCursor();
     void setResultCursor(PassRefPtr<IDBCursor>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, const Deprecated::ScriptValue&);
 
     RefPtr<IDBAny> m_source;
index 7a737e1..33694c5 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<IDBTransaction> IDBTransaction::create(ScriptExecutionContext* context, int64_t id, const Vector<String>& objectStoreNames, IndexedDB::TransactionMode mode, IDBDatabase* db)
+Ref<IDBTransaction> IDBTransaction::create(ScriptExecutionContext* context, int64_t id, const Vector<String>& objectStoreNames, IndexedDB::TransactionMode mode, IDBDatabase* db)
 {
-    IDBOpenDBRequest* openDBRequest = 0;
-    RefPtr<IDBTransaction> transaction(adoptRef(new IDBTransaction(context, id, objectStoreNames, mode, db, openDBRequest, IDBDatabaseMetadata())));
+    IDBOpenDBRequest* openDBRequest = nullptr;
+    Ref<IDBTransaction> transaction(adoptRef(*new IDBTransaction(context, id, objectStoreNames, mode, db, openDBRequest, IDBDatabaseMetadata())));
     transaction->suspendIfNeeded();
-    return transaction.release();
+    return transaction;
 }
 
-PassRefPtr<IDBTransaction> IDBTransaction::create(ScriptExecutionContext* context, int64_t id, IDBDatabase* db, IDBOpenDBRequest* openDBRequest, const IDBDatabaseMetadata& previousMetadata)
+Ref<IDBTransaction> IDBTransaction::create(ScriptExecutionContext* context, int64_t id, IDBDatabase* db, IDBOpenDBRequest* openDBRequest, const IDBDatabaseMetadata& previousMetadata)
 {
-    RefPtr<IDBTransaction> transaction(adoptRef(new IDBTransaction(context, id, Vector<String>(), IndexedDB::TransactionMode::VersionChange, db, openDBRequest, previousMetadata)));
+    Ref<IDBTransaction> transaction(adoptRef(*new IDBTransaction(context, id, Vector<String>(), IndexedDB::TransactionMode::VersionChange, db, openDBRequest, previousMetadata)));
     transaction->suspendIfNeeded();
-    return transaction.release();
+    return transaction;
 }
 
 const AtomicString& IDBTransaction::modeReadOnly()
index ac47e5a..9f34314 100644 (file)
@@ -51,8 +51,8 @@ struct IDBObjectStoreMetadata;
 
 class IDBTransaction final : public ScriptWrappable, public RefCounted<IDBTransaction>, public EventTargetWithInlineData, public ActiveDOMObject {
 public:
-    static PassRefPtr<IDBTransaction> create(ScriptExecutionContext*, int64_t, const Vector<String>& objectStoreNames, IndexedDB::TransactionMode, IDBDatabase*);
-    static PassRefPtr<IDBTransaction> create(ScriptExecutionContext*, int64_t, IDBDatabase*, IDBOpenDBRequest*, const IDBDatabaseMetadata& previousMetadata);
+    static Ref<IDBTransaction> create(ScriptExecutionContext*, int64_t, const Vector<String>& objectStoreNames, IndexedDB::TransactionMode, IDBDatabase*);
+    static Ref<IDBTransaction> create(ScriptExecutionContext*, int64_t, IDBDatabase*, IDBOpenDBRequest*, const IDBDatabaseMetadata& previousMetadata);
     virtual ~IDBTransaction();
 
     static const AtomicString& modeReadOnly();
index abb5d0f..afbc61b 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<IDBTransactionBackend> IDBTransactionBackend::create(IDBDatabaseBackend* databaseBackend, int64_t id, PassRefPtr<IDBDatabaseCallbacks> callbacks, const Vector<int64_t>& objectStoreIds, IndexedDB::TransactionMode mode)
+Ref<IDBTransactionBackend> IDBTransactionBackend::create(IDBDatabaseBackend* databaseBackend, int64_t id, PassRefPtr<IDBDatabaseCallbacks> callbacks, const Vector<int64_t>& objectStoreIds, IndexedDB::TransactionMode mode)
 {
     HashSet<int64_t> objectStoreHashSet;
     for (size_t i = 0; i < objectStoreIds.size(); ++i)
         objectStoreHashSet.add(objectStoreIds[i]);
 
-    return adoptRef(new IDBTransactionBackend(databaseBackend, id, callbacks, objectStoreHashSet, mode));
+    return adoptRef(*new IDBTransactionBackend(databaseBackend, id, callbacks, objectStoreHashSet, mode));
 }
 
 IDBTransactionBackend::IDBTransactionBackend(IDBDatabaseBackend* databaseBackend, int64_t id, PassRefPtr<IDBDatabaseCallbacks> callbacks, const HashSet<int64_t>& objectStoreIds, IndexedDB::TransactionMode mode)
index e602f24..83b9ef3 100644 (file)
@@ -43,7 +43,7 @@ class IDBDatabaseCallbacks;
 
 class IDBTransactionBackend : public RefCounted<IDBTransactionBackend> {
 public:
-    static PassRefPtr<IDBTransactionBackend> create(IDBDatabaseBackend*, int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>& objectStoreIds, IndexedDB::TransactionMode);
+    static Ref<IDBTransactionBackend> create(IDBDatabaseBackend*, int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>& objectStoreIds, IndexedDB::TransactionMode);
     ~IDBTransactionBackend();
 
     void commit();
index 964cb85..1410979 100644 (file)
@@ -38,9 +38,9 @@ class IDBServerConnection;
 
 class CreateObjectStoreOperation : public IDBOperation {
 public:
-    static PassRefPtr<IDBOperation> create(IDBTransactionBackend* transaction, const IDBObjectStoreMetadata& objectStoreMetadata)
+    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, const IDBObjectStoreMetadata& objectStoreMetadata)
     {
-        return adoptRef(new CreateObjectStoreOperation(transaction, objectStoreMetadata));
+        return adoptRef(*new CreateObjectStoreOperation(transaction, objectStoreMetadata));
     }
     virtual void perform(std::function<void()> successCallback) override final;
 
@@ -59,9 +59,9 @@ private:
 
 class DeleteObjectStoreOperation : public IDBOperation {
 public:
-    static PassRefPtr<IDBOperation> create(IDBTransactionBackend* transaction, const IDBObjectStoreMetadata& objectStoreMetadata)
+    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, const IDBObjectStoreMetadata& objectStoreMetadata)
     {
-        return adoptRef(new DeleteObjectStoreOperation(transaction, objectStoreMetadata));
+        return adoptRef(*new DeleteObjectStoreOperation(transaction, objectStoreMetadata));
     }
     virtual void perform(std::function<void()> successCallback) override final;
 
@@ -81,9 +81,9 @@ private:
 
 class IDBDatabaseBackend::VersionChangeOperation : public IDBOperation {
 public:
-    static PassRefPtr<IDBOperation> create(IDBTransactionBackend* transaction, int64_t version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks)
+    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, int64_t version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks)
     {
-        return adoptRef(new VersionChangeOperation(transaction, version, callbacks, databaseCallbacks));
+        return adoptRef(*new VersionChangeOperation(transaction, version, callbacks, databaseCallbacks));
     }
     virtual void perform(std::function<void()> successCallback) override final;
 
@@ -108,9 +108,9 @@ private:
 
 class CreateObjectStoreAbortOperation : public IDBSynchronousOperation {
 public:
-    static PassRefPtr<IDBSynchronousOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId)
+    static Ref<IDBSynchronousOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId)
     {
-        return adoptRef(new CreateObjectStoreAbortOperation(transaction, objectStoreId));
+        return adoptRef(*new CreateObjectStoreAbortOperation(transaction, objectStoreId));
     }
     virtual void perform() override final;
 private:
@@ -126,9 +126,9 @@ private:
 
 class DeleteObjectStoreAbortOperation : public IDBSynchronousOperation {
 public:
-    static PassRefPtr<IDBSynchronousOperation> create(IDBTransactionBackend* transaction, const IDBObjectStoreMetadata& objectStore)
+    static Ref<IDBSynchronousOperation> create(IDBTransactionBackend* transaction, const IDBObjectStoreMetadata& objectStore)
     {
-        return adoptRef(new DeleteObjectStoreAbortOperation(transaction, objectStore));
+        return adoptRef(*new DeleteObjectStoreAbortOperation(transaction, objectStore));
     }
     virtual void perform() override final;
 private:
@@ -144,9 +144,9 @@ private:
 
 class IDBDatabaseBackend::VersionChangeAbortOperation : public IDBSynchronousOperation {
 public:
-    static PassRefPtr<IDBSynchronousOperation> create(IDBTransactionBackend* transaction, const String& previousVersion, int64_t previousIntVersion)
+    static Ref<IDBSynchronousOperation> create(IDBTransactionBackend* transaction, const String& previousVersion, int64_t previousIntVersion)
     {
-        return adoptRef(new VersionChangeAbortOperation(transaction, previousVersion, previousIntVersion));
+        return adoptRef(*new VersionChangeAbortOperation(transaction, previousVersion, previousIntVersion));
     }
     virtual void perform() override final;
 private:
@@ -164,9 +164,9 @@ private:
 
 class CreateIndexOperation : public IDBOperation {
 public:
-    static PassRefPtr<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
+    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
     {
-        return adoptRef(new CreateIndexOperation(transaction, objectStoreId, indexMetadata));
+        return adoptRef(*new CreateIndexOperation(transaction, objectStoreId, indexMetadata));
     }
     virtual void perform(std::function<void()> successCallback) override final;
 
@@ -188,9 +188,9 @@ private:
 
 class CreateIndexAbortOperation : public IDBSynchronousOperation {
 public:
-    static PassRefPtr<IDBSynchronousOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, int64_t indexId)
+    static Ref<IDBSynchronousOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, int64_t indexId)
     {
-        return adoptRef(new CreateIndexAbortOperation(transaction, objectStoreId, indexId));
+        return adoptRef(*new CreateIndexAbortOperation(transaction, objectStoreId, indexId));
     }
     virtual void perform() override final;
 private:
@@ -208,9 +208,9 @@ private:
 
 class DeleteIndexOperation : public IDBOperation {
 public:
-    static PassRefPtr<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
+    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
     {
-        return adoptRef(new DeleteIndexOperation(transaction, objectStoreId, indexMetadata));
+        return adoptRef(*new DeleteIndexOperation(transaction, objectStoreId, indexMetadata));
     }
     virtual void perform(std::function<void()> successCallback) override final;
 
@@ -232,9 +232,9 @@ private:
 
 class DeleteIndexAbortOperation : public IDBSynchronousOperation {
 public:
-    static PassRefPtr<IDBSynchronousOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
+    static Ref<IDBSynchronousOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
     {
-        return adoptRef(new DeleteIndexAbortOperation(transaction, objectStoreId, indexMetadata));
+        return adoptRef(*new DeleteIndexAbortOperation(transaction, objectStoreId, indexMetadata));
     }
     virtual void perform() override final;
 private:
@@ -252,9 +252,9 @@ private:
 
 class GetOperation : public IDBOperation {
 public:
-    static PassRefPtr<IDBOperation> create(IDBTransactionBackend* transaction, const IDBDatabaseMetadata& metadata, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorType cursorType, PassRefPtr<IDBCallbacks> callbacks)
+    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, const IDBDatabaseMetadata& metadata, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorType cursorType, PassRefPtr<IDBCallbacks> callbacks)
     {
-        return adoptRef(new GetOperation(transaction, metadata, objectStoreId, indexId, keyRange, cursorType, callbacks));
+        return adoptRef(*new GetOperation(transaction, metadata, objectStoreId, indexId, keyRange, cursorType, callbacks));
     }
     virtual void perform(std::function<void()> successCallback) override final;
 
@@ -292,9 +292,9 @@ private:
 
 class PutOperation : public IDBOperation {
 public:
-    static PassRefPtr<IDBOperation> create(IDBTransactionBackend* transaction, const IDBObjectStoreMetadata& objectStore, PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey> key, IDBDatabaseBackend::PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, const Vector<int64_t>& indexIds, const Vector<IndexKeys>& indexKeys)
+    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, const IDBObjectStoreMetadata& objectStore, PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey> key, IDBDatabaseBackend::PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, const Vector<int64_t>& indexIds, const Vector<IndexKeys>& indexKeys)
     {
-        return adoptRef(new PutOperation(transaction, objectStore, value, key, putMode, callbacks, indexIds, indexKeys));
+        return adoptRef(*new PutOperation(transaction, objectStore, value, key, putMode, callbacks, indexIds, indexKeys));
     }
     virtual void perform(std::function<void()> successCallback) override final;
 
@@ -330,9 +330,9 @@ private:
 
 class SetIndexesReadyOperation : public IDBOperation {
 public:
-    static PassRefPtr<IDBOperation> create(IDBTransactionBackend* transaction, size_t indexCount)
+    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, size_t indexCount)
     {
-        return adoptRef(new SetIndexesReadyOperation(transaction, indexCount));
+        return adoptRef(*new SetIndexesReadyOperation(transaction, indexCount));
     }
     virtual void perform(std::function<void()> successCallback) override final;
 private:
@@ -348,9 +348,9 @@ private:
 
 class OpenCursorOperation : public IDBOperation {
 public:
-    static PassRefPtr<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorDirection direction, IndexedDB::CursorType cursorType, IDBDatabaseBackend::TaskType taskType, PassRefPtr<IDBCallbacks> callbacks)
+    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorDirection direction, IndexedDB::CursorType cursorType, IDBDatabaseBackend::TaskType taskType, PassRefPtr<IDBCallbacks> callbacks)
     {
-        return adoptRef(new OpenCursorOperation(transaction, objectStoreId, indexId, keyRange, direction, cursorType, taskType, callbacks));
+        return adoptRef(*new OpenCursorOperation(transaction, objectStoreId, indexId, keyRange, direction, cursorType, taskType, callbacks));
     }
     virtual void perform(std::function<void()> successCallback) override final;
 
@@ -388,9 +388,9 @@ private:
 
 class CountOperation : public IDBOperation {
 public:
-    static PassRefPtr<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
+    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
     {
-        return adoptRef(new CountOperation(transaction, objectStoreId, indexId, keyRange, callbacks));
+        return adoptRef(*new CountOperation(transaction, objectStoreId, indexId, keyRange, callbacks));
     }
     virtual void perform(std::function<void()> successCallback) override final;
 
@@ -417,9 +417,9 @@ private:
 
 class DeleteRangeOperation : public IDBOperation {
 public:
-    static PassRefPtr<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
+    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
     {
-        return adoptRef(new DeleteRangeOperation(transaction, objectStoreId, keyRange, callbacks));
+        return adoptRef(*new DeleteRangeOperation(transaction, objectStoreId, keyRange, callbacks));
     }
     virtual void perform(std::function<void()> successCallback) override final;
 
@@ -443,9 +443,9 @@ private:
 
 class ClearObjectStoreOperation : public IDBOperation {
 public:
-    static PassRefPtr<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, PassRefPtr<IDBCallbacks> callbacks)
+    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, PassRefPtr<IDBCallbacks> callbacks)
     {
-        return adoptRef(new ClearObjectStoreOperation(transaction, objectStoreId, callbacks));
+        return adoptRef(*new ClearObjectStoreOperation(transaction, objectStoreId, callbacks));
     }
     virtual void perform(std::function<void()> successCallback) override final;
 
index f7a5cf8..f19561f 100644 (file)
@@ -28,9 +28,9 @@
 
 namespace WebCore {
 
-RefPtr<VideoPlaybackQuality> VideoPlaybackQuality::create(double creationTime, unsigned long totalVideoFrames, unsigned long droppedVideoFrames, unsigned long corruptedVideoFrames, double totalFrameDelay)
+Ref<VideoPlaybackQuality> VideoPlaybackQuality::create(double creationTime, unsigned long totalVideoFrames, unsigned long droppedVideoFrames, unsigned long corruptedVideoFrames, double totalFrameDelay)
 {
-    return adoptRef(new VideoPlaybackQuality(creationTime, totalVideoFrames, droppedVideoFrames, corruptedVideoFrames, totalFrameDelay));
+    return adoptRef(*new VideoPlaybackQuality(creationTime, totalVideoFrames, droppedVideoFrames, corruptedVideoFrames, totalFrameDelay));
 }
 
 VideoPlaybackQuality::VideoPlaybackQuality(double creationTime, unsigned long totalVideoFrames, unsigned long droppedVideoFrames, unsigned long corruptedVideoFrames, double totalFrameDelay)
index 5b89377..8b03b85 100644 (file)
@@ -34,7 +34,7 @@ namespace WebCore {
 class VideoPlaybackQuality : public RefCounted<VideoPlaybackQuality> {
     WTF_MAKE_NONCOPYABLE(VideoPlaybackQuality)
 public:
-    static RefPtr<VideoPlaybackQuality> create(double creationTime, unsigned long totalVideoFrames, unsigned long droppedVideoFrames, unsigned long corruptedVideoFrames, double totalFrameDelay);
+    static Ref<VideoPlaybackQuality> create(double creationTime, unsigned long totalVideoFrames, unsigned long droppedVideoFrames, unsigned long corruptedVideoFrames, double totalFrameDelay);
 
     double creationTime() const { return m_creationTime; }
     unsigned long totalVideoFrames() const { return m_totalVideoFrames; }
index 10f812b..5cf2c3e 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<MediaConstraintsImpl> MediaConstraintsImpl::create(const Dictionary& constraints, ExceptionCode& ec)
+RefPtr<MediaConstraintsImpl> MediaConstraintsImpl::create(const Dictionary& constraints, ExceptionCode& ec)
 {
-    RefPtr<MediaConstraintsImpl> object = adoptRef(new MediaConstraintsImpl());
+    RefPtr<MediaConstraintsImpl> object = adoptRef(*new MediaConstraintsImpl());
     if (!object->initialize(constraints)) {
         ec = TYPE_MISMATCH_ERR;
-        return 0;
+        return nullptr;
     }
-    return object.release();
+    return object;
 }
 
-PassRefPtr<MediaConstraintsImpl> MediaConstraintsImpl::create()
+Ref<MediaConstraintsImpl> MediaConstraintsImpl::create()
 {
-    return adoptRef(new MediaConstraintsImpl());
+    return adoptRef(*new MediaConstraintsImpl());
 }
 
 bool MediaConstraintsImpl::initialize(const Dictionary& constraints)
index eeb631c..a4c1f7c 100644 (file)
@@ -43,8 +43,8 @@ class Dictionary;
 
 class MediaConstraintsImpl : public MediaConstraints {
 public:
-    static PassRefPtr<MediaConstraintsImpl> create();
-    static PassRefPtr<MediaConstraintsImpl> create(const Dictionary&, ExceptionCode&);
+    static Ref<MediaConstraintsImpl> create();
+    static RefPtr<MediaConstraintsImpl> create(const Dictionary&, ExceptionCode&);
 
     virtual ~MediaConstraintsImpl();
     bool initialize(const Dictionary&);
index 9fbfb82..4720f03 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<MediaStream> MediaStream::create(ScriptExecutionContext& context)
+Ref<MediaStream> MediaStream::create(ScriptExecutionContext& context)
 {
     return MediaStream::create(context, MediaStreamPrivate::create(Vector<RefPtr<RealtimeMediaSource>>(), Vector<RefPtr<RealtimeMediaSource>>()));
 }
 
-PassRefPtr<MediaStream> MediaStream::create(ScriptExecutionContext& context, PassRefPtr<MediaStream> stream)
+Ref<MediaStream> MediaStream::create(ScriptExecutionContext& context, PassRefPtr<MediaStream> stream)
 {
     ASSERT(stream);
 
@@ -60,7 +60,7 @@ PassRefPtr<MediaStream> MediaStream::create(ScriptExecutionContext& context, Pas
     return MediaStream::create(context, MediaStreamPrivate::create(audioTracks, videoTracks));
 }
 
-PassRefPtr<MediaStream> MediaStream::create(ScriptExecutionContext& context, const Vector<RefPtr<MediaStreamTrack>>& tracks)
+Ref<MediaStream> MediaStream::create(ScriptExecutionContext& context, const Vector<RefPtr<MediaStreamTrack>>& tracks)
 {
     Vector<RefPtr<MediaStreamTrackPrivate>> audioTracks;
     Vector<RefPtr<MediaStreamTrackPrivate>> videoTracks;
@@ -75,9 +75,9 @@ PassRefPtr<MediaStream> MediaStream::create(ScriptExecutionContext& context, con
     return MediaStream::create(context, MediaStreamPrivate::create(audioTracks, videoTracks));
 }
 
-PassRefPtr<MediaStream> MediaStream::create(ScriptExecutionContext& context, PassRefPtr<MediaStreamPrivate> privateStream)
+Ref<MediaStream> MediaStream::create(ScriptExecutionContext& context, PassRefPtr<MediaStreamPrivate> privateStream)
 {
-    return adoptRef(new MediaStream(context, privateStream));
+    return adoptRef(*new MediaStream(context, privateStream));
 }
 
 MediaStream::MediaStream(ScriptExecutionContext& context, PassRefPtr<MediaStreamPrivate> privateStream)
index d273dae..bf63885 100644 (file)
@@ -51,10 +51,10 @@ public:
         virtual void didAddOrRemoveTrack() = 0;
     };
 
-    static PassRefPtr<MediaStream> create(ScriptExecutionContext&);
-    static PassRefPtr<MediaStream> create(ScriptExecutionContext&, PassRefPtr<MediaStream>);
-    static PassRefPtr<MediaStream> create(ScriptExecutionContext&, const Vector<RefPtr<MediaStreamTrack>>&);
-    static PassRefPtr<MediaStream> create(ScriptExecutionContext&, PassRefPtr<MediaStreamPrivate>);
+    static Ref<MediaStream> create(ScriptExecutionContext&);
+    static Ref<MediaStream> create(ScriptExecutionContext&, PassRefPtr<MediaStream>);
+    static Ref<MediaStream> create(ScriptExecutionContext&, const Vector<RefPtr<MediaStreamTrack>>&);
+    static Ref<MediaStream> create(ScriptExecutionContext&, PassRefPtr<MediaStreamPrivate>);
     virtual ~MediaStream();
 
     String id() const { return m_private->id(); }
index b792c2f..3cffb86 100644 (file)
@@ -44,7 +44,7 @@ static const long maxToneDurationMs = 6000;
 static const long minInterToneGapMs = 30;
 static const long defaultInterToneGapMs = 70;
 
-PassRefPtr<RTCDTMFSender> RTCDTMFSender::create(ScriptExecutionContext* context, RTCPeerConnectionHandler* peerConnectionHandler, PassRefPtr<MediaStreamTrack> prpTrack, ExceptionCode& ec)
+RefPtr<RTCDTMFSender> RTCDTMFSender::create(ScriptExecutionContext* context, RTCPeerConnectionHandler* peerConnectionHandler, PassRefPtr<MediaStreamTrack> prpTrack, ExceptionCode& ec)
 {
     RefPtr<MediaStreamTrack> track = prpTrack;
     std::unique_ptr<RTCDTMFSenderHandler> handler = peerConnectionHandler->createDTMFSender(track->source());
@@ -55,7 +55,7 @@ PassRefPtr<RTCDTMFSender> RTCDTMFSender::create(ScriptExecutionContext* context,
 
     RefPtr<RTCDTMFSender> dtmfSender = adoptRef(new RTCDTMFSender(context, track, WTF::move(handler)));
     dtmfSender->suspendIfNeeded();
-    return dtmfSender.release();
+    return dtmfSender;
 }
 
 RTCDTMFSender::RTCDTMFSender(ScriptExecutionContext* context, PassRefPtr<MediaStreamTrack> track, std::unique_ptr<RTCDTMFSenderHandler> handler)
index aaa0c3c..023e827 100644 (file)
@@ -43,7 +43,7 @@ class RTCDTMFSenderHandler;
 
 class RTCDTMFSender final : public RefCounted<RTCDTMFSender>, public ScriptWrappable, public EventTargetWithInlineData, public RTCDTMFSenderHandlerClient, public ActiveDOMObject {
 public:
-    static PassRefPtr<RTCDTMFSender> create(ScriptExecutionContext*, RTCPeerConnectionHandler*, PassRefPtr<MediaStreamTrack>, ExceptionCode&);
+    static RefPtr<RTCDTMFSender> create(ScriptExecutionContext*, RTCPeerConnectionHandler*, PassRefPtr<MediaStreamTrack>, ExceptionCode&);
     ~RTCDTMFSender();
 
     bool canInsertDTMF() const;
index 1855b80..ef0aa6d 100644 (file)
@@ -32,7 +32,7 @@
 
 namespace WebCore {
 
-PassRefPtr<RTCOfferAnswerOptions> RTCOfferAnswerOptions::create(const Dictionary& options, ExceptionCode& ec)
+RefPtr<RTCOfferAnswerOptions> RTCOfferAnswerOptions::create(const Dictionary& options, ExceptionCode& ec)
 {
     RefPtr<RTCOfferAnswerOptions> offerAnswerOptions = adoptRef(new RTCOfferAnswerOptions());
     String requestIdentity;
@@ -43,7 +43,7 @@ PassRefPtr<RTCOfferAnswerOptions> RTCOfferAnswerOptions::create(const Dictionary
         return nullptr;
     }
 
-    return offerAnswerOptions.release();
+    return offerAnswerOptions;
 }
 
 bool RTCOfferAnswerOptions::initialize(const Dictionary& options)
@@ -59,7 +59,7 @@ bool RTCOfferAnswerOptions::initialize(const Dictionary& options)
     return true;
 }
 
-PassRefPtr<RTCOfferOptions> RTCOfferOptions::create(const Dictionary& options, ExceptionCode& ec)
+RefPtr<RTCOfferOptions> RTCOfferOptions::create(const Dictionary& options, ExceptionCode& ec)
 {
     RefPtr<RTCOfferOptions> offerOptions = adoptRef(new RTCOfferOptions());
     if (!offerOptions->initialize(options)) {
@@ -69,7 +69,7 @@ PassRefPtr<RTCOfferOptions> RTCOfferOptions::create(const Dictionary& options, E
         return nullptr;
     }
 
-    return offerOptions.release();
+    return offerOptions;
 }
 
 bool RTCOfferOptions::initialize(const Dictionary& options)
index ad58248..5f3ae1f 100644 (file)
@@ -40,7 +40,7 @@ class Dictionary;
 
 class RTCOfferAnswerOptions : public RefCounted<RTCOfferAnswerOptions> {
 public:
-    static PassRefPtr<RTCOfferAnswerOptions> create(const Dictionary&, ExceptionCode&);
+    static RefPtr<RTCOfferAnswerOptions> create(const Dictionary&, ExceptionCode&);
 
     const String& requestIdentity() const { return m_private->requestIdentity(); }
     RTCOfferAnswerOptionsPrivate* privateOfferAnswerOptions() const { return m_private.get(); }
@@ -56,7 +56,7 @@ protected:
 
 class RTCOfferOptions : public RTCOfferAnswerOptions {
 public:
-    static PassRefPtr<RTCOfferOptions> create(const Dictionary&, ExceptionCode&);
+    static RefPtr<RTCOfferOptions> create(const Dictionary&, ExceptionCode&);
 
     int64_t offerToReceiveVideo() const { return privateOfferOptions()->offerToReceiveVideo(); }
     int64_t offerToReceiveAudio() const { return privateOfferOptions()->offerToReceiveAudio(); }
index 01daee7..1609816 100644 (file)
@@ -110,7 +110,7 @@ static ExceptionCode processIceServer(const Dictionary& iceServer, RTCConfigurat
     return 0;
 }
 
-PassRefPtr<RTCConfiguration> RTCPeerConnection::parseConfiguration(const Dictionary& configuration, ExceptionCode& ec)
+RefPtr<RTCConfiguration> RTCPeerConnection::parseConfiguration(const Dictionary& configuration, ExceptionCode& ec)
 {
     if (configuration.isUndefinedOrNull())
         return nullptr;
@@ -152,10 +152,10 @@ PassRefPtr<RTCConfiguration> RTCPeerConnection::parseConfiguration(const Diction
             return nullptr;
     }
 
-    return rtcConfiguration.release();
+    return rtcConfiguration;
 }
 
-PassRefPtr<RTCPeerConnection> RTCPeerConnection::create(ScriptExecutionContext& context, const Dictionary& rtcConfiguration, ExceptionCode& ec)
+RefPtr<RTCPeerConnection> RTCPeerConnection::create(ScriptExecutionContext& context, const Dictionary& rtcConfiguration, ExceptionCode& ec)
 {
     RefPtr<RTCConfiguration> configuration = parseConfiguration(rtcConfiguration, ec);
     if (ec)
index 4b4a9d1..52dc793 100644 (file)
@@ -60,7 +60,7 @@ class VoidCallback;
 
 class RTCPeerConnection final : public RefCounted<RTCPeerConnection>, public ScriptWrappable, public RTCPeerConnectionHandlerClient, public EventTargetWithInlineData, public ActiveDOMObject, public MediaStream::Observer {
 public:
-    static PassRefPtr<RTCPeerConnection> create(ScriptExecutionContext&, const Dictionary& rtcConfiguration, ExceptionCode&);
+    static RefPtr<RTCPeerConnection> create(ScriptExecutionContext&, const Dictionary& rtcConfiguration, ExceptionCode&);
     ~RTCPeerConnection();
 
     void createOffer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>, const Dictionary& offerOptions, ExceptionCode&);
@@ -126,7 +126,7 @@ public:
 private:
     RTCPeerConnection(ScriptExecutionContext&, PassRefPtr<RTCConfiguration>, ExceptionCode&);
 
-    static PassRefPtr<RTCConfiguration> parseConfiguration(const Dictionary& configuration, ExceptionCode&);
+    static RefPtr<RTCConfiguration> parseConfiguration(const Dictionary& configuration, ExceptionCode&);
     void scheduleDispatchEvent(PassRefPtr<Event>);
     void scheduledEventTimerFired();
     bool hasLocalStreamWithTrackId(const String& trackId);
index 90ac490..a29316a 100644 (file)
@@ -123,7 +123,7 @@ RefPtr<AudioContext> AudioContext::create(Document& document, ExceptionCode& ec)
 
     RefPtr<AudioContext> audioContext(adoptRef(new AudioContext(document)));
     audioContext->suspendIfNeeded();
-    return audioContext.release();
+    return audioContext;
 }
 
 // Constructor for rendering to the audio hardware.
index e95157d..21c4a90 100644 (file)
@@ -55,7 +55,7 @@ public:
         RetryOpenDatabase
     };
 
-    virtual PassRefPtr<DatabaseBackendBase> openDatabase(RefPtr<DatabaseContext>&, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, bool setVersionInNewDatabase, DatabaseError&, String& errorMessage, OpenAttempt = FirstTryToOpenDatabase) = 0;
+    virtual RefPtr<DatabaseBackendBase> openDatabase(RefPtr<DatabaseContext>&, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, bool setVersionInNewDatabase, DatabaseError&, String& errorMessage, OpenAttempt = FirstTryToOpenDatabase) = 0;
 
     virtual void closeAllDatabases() = 0;
 
index 0154ba0..1217e5b 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<Database> DOMWindowWebDatabase::openDatabase(DOMWindow* window, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
+RefPtr<Database> DOMWindowWebDatabase::openDatabase(DOMWindow* window, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
 {
     if (!window->isCurrentlyDisplayedInFrame())
-        return 0;
+        return nullptr;
 
-    RefPtr<Database> database = 0;
+    RefPtr<Database> database = nullptr;
     DatabaseManager& dbManager = DatabaseManager::singleton();
     DatabaseError error = DatabaseError::None;
     if (dbManager.isAvailable() && window->document()->securityOrigin()->canAccessDatabase(window->document()->topOrigin())) {
index fd75534..bfd71a8 100644 (file)
@@ -42,7 +42,7 @@ class Frame;
 
 class DOMWindowWebDatabase {
 public:
-    static PassRefPtr<Database> openDatabase(DOMWindow*, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode&);
+    static RefPtr<Database> openDatabase(DOMWindow*, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode&);
 
 private:
     DOMWindowWebDatabase() { };
index 7f6fb27..5b5b0e6 100644 (file)
@@ -107,7 +107,7 @@ void DatabaseManager::setIsAvailable(bool available)
     m_databaseIsAvailable = available;
 }
 
-PassRefPtr<DatabaseContext> DatabaseManager::existingDatabaseContextFor(ScriptExecutionContext* context)
+RefPtr<DatabaseContext> DatabaseManager::existingDatabaseContextFor(ScriptExecutionContext* context)
 {
     std::lock_guard<std::mutex> lock(m_mutex);
 
@@ -127,15 +127,15 @@ PassRefPtr<DatabaseContext> DatabaseManager::existingDatabaseContextFor(ScriptEx
         // We do this by ref'ing the reused databaseContext before returning it.
         databaseContext->ref();
     }
-    return databaseContext.release();
+    return databaseContext;
 }
 
-PassRefPtr<DatabaseContext> DatabaseManager::databaseContextFor(ScriptExecutionContext* context)
+RefPtr<DatabaseContext> DatabaseManager::databaseContextFor(ScriptExecutionContext* context)
 {
     RefPtr<DatabaseContext> databaseContext = existingDatabaseContextFor(context);
     if (!databaseContext)
-        databaseContext = adoptRef(new DatabaseContext(context));
-    return databaseContext.release();
+        databaseContext = adoptRef(*new DatabaseContext(context));
+    return databaseContext;
 }
 
 void DatabaseManager::registerDatabaseContext(DatabaseContext* databaseContext)
@@ -272,7 +272,7 @@ void DatabaseManager::removeProposedDatabase(ProposedDatabase* proposedDb)
     m_proposedDatabases.remove(proposedDb);
 }
 
-PassRefPtr<Database> DatabaseManager::openDatabase(ScriptExecutionContext* context,
+RefPtr<Database> DatabaseManager::openDatabase(ScriptExecutionContext* context,
     const String& name, const String& expectedVersion, const String& displayName,
     unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback,
     DatabaseError& error)
@@ -284,7 +284,7 @@ PassRefPtr<Database> DatabaseManager::openDatabase(ScriptExecutionContext* conte
     String errorMessage;
     RefPtr<DatabaseBackendBase> backend = openDatabaseBackend(context, name, expectedVersion, displayName, estimatedSize, setVersionInNewDatabase, error, errorMessage);
     if (!backend)
-        return 0;
+        return nullptr;
 
     RefPtr<Database> database = Database::create(context, backend);
 
@@ -302,7 +302,7 @@ PassRefPtr<Database> DatabaseManager::openDatabase(ScriptExecutionContext* conte
     }
 
     ASSERT(database);
-    return database.release();
+    return database;
 }
 
 bool DatabaseManager::hasOpenDatabases(ScriptExecutionContext* context)
index 320d4cd..664da52 100644 (file)
@@ -65,7 +65,7 @@ public:
 
     // This gets a DatabaseContext for the specified ScriptExecutionContext.
     // If one doesn't already exist, it will create a new one.
-    PassRefPtr<DatabaseContext> databaseContextFor(ScriptExecutionContext*);
+    RefPtr<DatabaseContext> databaseContextFor(ScriptExecutionContext*);
 
     // These 2 methods are for DatabaseContext (un)registration, and should only
     // be called by the DatabaseContext constructor and destructor.
@@ -82,7 +82,7 @@ public:
 
     static ExceptionCode exceptionCodeForDatabaseError(DatabaseError);
 
-    PassRefPtr<Database> openDatabase(ScriptExecutionContext*, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback>, DatabaseError&);
+    RefPtr<Database> openDatabase(ScriptExecutionContext*, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback>, DatabaseError&);
 
     WEBCORE_EXPORT bool hasOpenDatabases(ScriptExecutionContext*);
 
@@ -129,7 +129,7 @@ private:
 
     // This gets a DatabaseContext for the specified ScriptExecutionContext if
     // it already exist previously. Otherwise, it returns 0.
-    PassRefPtr<DatabaseContext> existingDatabaseContextFor(ScriptExecutionContext*);
+    RefPtr<DatabaseContext> existingDatabaseContextFor(ScriptExecutionContext*);
 
     PassRefPtr<DatabaseBackendBase> openDatabaseBackend(ScriptExecutionContext*, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, bool setVersionInNewDatabase, DatabaseError&, String& errorMessage);
 
index a80ac8e..24096fb 100644 (file)
@@ -118,7 +118,7 @@ void DatabaseServer::interruptAllDatabasesForContext(const DatabaseContext* cont
     DatabaseTracker::tracker().interruptAllDatabasesForContext(context);
 }
 
-PassRefPtr<DatabaseBackendBase> DatabaseServer::openDatabase(RefPtr<DatabaseContext>& backendContext, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, bool setVersionInNewDatabase, DatabaseError &error, String& errorMessage,
+RefPtr<DatabaseBackendBase> DatabaseServer::openDatabase(RefPtr<DatabaseContext>& backendContext, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, bool setVersionInNewDatabase, DatabaseError &error, String& errorMessage,
     OpenAttempt attempt)
 {
     RefPtr<DatabaseBackendBase> database;
@@ -134,18 +134,18 @@ PassRefPtr<DatabaseBackendBase> DatabaseServer::openDatabase(RefPtr<DatabaseCont
 
     if (success)
         database = createDatabase(backendContext, name, expectedVersion, displayName, estimatedSize, setVersionInNewDatabase, error, errorMessage);
-    return database.release();
+    return database;
 }
 
-PassRefPtr<DatabaseBackendBase> DatabaseServer::createDatabase(RefPtr<DatabaseContext>& backendContext, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, bool setVersionInNewDatabase, DatabaseError& error, String& errorMessage)
+RefPtr<DatabaseBackendBase> DatabaseServer::createDatabase(RefPtr<DatabaseContext>& backendContext, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, bool setVersionInNewDatabase, DatabaseError& error, String& errorMessage)
 {
     RefPtr<Database> database = adoptRef(new Database(backendContext, name, expectedVersion, displayName, estimatedSize));
 
     if (!database->openAndVerifyVersion(setVersionInNewDatabase, error, errorMessage))
-        return 0;
+        return nullptr;
 
     DatabaseTracker::tracker().setDatabaseDetails(backendContext->securityOrigin(), name, displayName, estimatedSize);
-    return database.release();
+    return database;
 }
 
 } // namespace WebCore
index 2e8081c..be48108 100644 (file)
@@ -44,7 +44,7 @@ public:
 
     virtual String fullPathForDatabase(SecurityOrigin*, const String& name, bool createIfDoesNotExist);
 
-    virtual PassRefPtr<DatabaseBackendBase> openDatabase(RefPtr<DatabaseContext>&, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, bool setVersionInNewDatabase, DatabaseError&, String& errorMessage, OpenAttempt);
+    virtual RefPtr<DatabaseBackendBase> openDatabase(RefPtr<DatabaseContext>&, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, bool setVersionInNewDatabase, DatabaseError&, String& errorMessage, OpenAttempt);
 
     void closeAllDatabases() override;
 
@@ -65,7 +65,7 @@ public:
     virtual void interruptAllDatabasesForContext(const DatabaseContext*);
 
 protected:
-    virtual PassRefPtr<DatabaseBackendBase> createDatabase(RefPtr<DatabaseContext>&, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, bool setVersionInNewDatabase, DatabaseError&, String& errorMessage);
+    virtual RefPtr<DatabaseBackendBase> createDatabase(RefPtr<DatabaseContext>&, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, bool setVersionInNewDatabase, DatabaseError&, String& errorMessage);
 };
 
 } // namespace WebCore
index 0e07b2f..37b2eb2 100644 (file)
@@ -336,7 +336,7 @@ void WebIDBServerConnection::didCreateObjectStore(uint64_t requestID, bool succe
     if (!serverRequest)
         return;
 
-    serverRequest->completeRequest(success ? nullptr : IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Unknown error occured creating object store"));
+    serverRequest->completeRequest(success ? nullptr : IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Unknown error occured creating object store").ptr());
 }
 
 void WebIDBServerConnection::createIndex(IDBTransactionBackend&transaction, const CreateIndexOperation& operation, std::function<void (PassRefPtr<IDBDatabaseError>)> completionCallback)
@@ -365,7 +365,7 @@ void WebIDBServerConnection::didCreateIndex(uint64_t requestID, bool success)
     if (!serverRequest)
         return;
 
-    serverRequest->completeRequest(success ? nullptr : IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Unknown error occured creating index"));
+    serverRequest->completeRequest(success ? nullptr : IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Unknown error occured creating index").ptr());
 }
 
 void WebIDBServerConnection::deleteIndex(IDBTransactionBackend&transaction, const DeleteIndexOperation& operation, std::function<void (PassRefPtr<IDBDatabaseError>)> completionCallback)
@@ -394,7 +394,7 @@ void WebIDBServerConnection::didDeleteIndex(uint64_t requestID, bool success)
     if (!serverRequest)
         return;
 
-    serverRequest->completeRequest(success ? nullptr : IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Unknown error occured deleting index"));
+    serverRequest->completeRequest(success ? nullptr : IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Unknown error occured deleting index").ptr());
 }
 
 void WebIDBServerConnection::get(IDBTransactionBackend& transaction, const GetOperation& operation, std::function<void (const IDBGetResult&, PassRefPtr<IDBDatabaseError>)> completionCallback)
@@ -453,7 +453,7 @@ void WebIDBServerConnection::didPutRecord(uint64_t requestID, const WebCore::IDB
     if (!serverRequest)
         return;
 
-    serverRequest->completeRequest(resultKey.isNull ? nullptr : resultKey.maybeCreateIDBKey(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
+    serverRequest->completeRequest(resultKey.isNull ? nullptr : resultKey.maybeCreateIDBKey(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage).ptr() : nullptr);
 }
 
 void WebIDBServerConnection::didGetRecord(uint64_t requestID, const WebCore::IDBGetResult& getResult, uint32_t errorCode, const String& errorMessage)
@@ -465,7 +465,7 @@ void WebIDBServerConnection::didGetRecord(uint64_t requestID, const WebCore::IDB
     if (!serverRequest)
         return;
 
-    serverRequest->completeRequest(getResult, errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
+    serverRequest->completeRequest(getResult, errorCode ? IDBDatabaseError::create(errorCode, errorMessage).ptr() : nullptr);
 }
 
 void WebIDBServerConnection::didOpenCursor(uint64_t requestID, int64_t cursorID, const IDBKeyData& key, const IDBKeyData& primaryKey, const IPC::DataReference& valueData, uint32_t errorCode, const String& errorMessage)
@@ -478,7 +478,7 @@ void WebIDBServerConnection::didOpenCursor(uint64_t requestID, int64_t cursorID,
         return;
 
     RefPtr<SharedBuffer> value = SharedBuffer::create(valueData.data(), valueData.size());
-    serverRequest->completeRequest(cursorID, key.maybeCreateIDBKey(), primaryKey.maybeCreateIDBKey(), value.release(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
+    serverRequest->completeRequest(cursorID, key.maybeCreateIDBKey(), primaryKey.maybeCreateIDBKey(), value.release(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage).ptr() : nullptr);
 }
 
 void WebIDBServerConnection::didAdvanceCursor(uint64_t requestID, const IDBKeyData& key, const IDBKeyData& primaryKey, const IPC::DataReference& valueData, uint32_t errorCode, const String& errorMessage)
@@ -491,7 +491,7 @@ void WebIDBServerConnection::didAdvanceCursor(uint64_t requestID, const IDBKeyDa
         return;
 
     RefPtr<SharedBuffer> value = SharedBuffer::create(valueData.data(), valueData.size());
-    serverRequest->completeRequest(key.maybeCreateIDBKey(), primaryKey.maybeCreateIDBKey(), value.release(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
+    serverRequest->completeRequest(key.maybeCreateIDBKey(), primaryKey.maybeCreateIDBKey(), value.release(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage).ptr() : nullptr);
 }
 
 void WebIDBServerConnection::didIterateCursor(uint64_t requestID, const IDBKeyData& key, const IDBKeyData& primaryKey, const IPC::DataReference& valueData, uint32_t errorCode, const String& errorMessage)
@@ -504,7 +504,7 @@ void WebIDBServerConnection::didIterateCursor(uint64_t requestID, const IDBKeyDa
         return;
 
     RefPtr<SharedBuffer> value = SharedBuffer::create(valueData.data(), valueData.size());
-    serverRequest->completeRequest(key.maybeCreateIDBKey(), primaryKey.maybeCreateIDBKey(), value.release(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
+    serverRequest->completeRequest(key.maybeCreateIDBKey(), primaryKey.maybeCreateIDBKey(), value.release(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage).ptr() : nullptr);
 }
 
 void WebIDBServerConnection::count(IDBTransactionBackend& transaction, const CountOperation& operation, std::function<void (int64_t, PassRefPtr<IDBDatabaseError>)> completionCallback)
@@ -533,7 +533,7 @@ void WebIDBServerConnection::didCount(uint64_t requestID, int64_t count, uint32_
     if (!serverRequest)
         return;
 
-    serverRequest->completeRequest(count, errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
+    serverRequest->completeRequest(count, errorCode ? IDBDatabaseError::create(errorCode, errorMessage).ptr() : nullptr);
 }
 
 void WebIDBServerConnection::deleteRange(IDBTransactionBackend& transaction, const DeleteRangeOperation& operation, std::function<void (PassRefPtr<IDBDatabaseError>)> completionCallback)
@@ -562,7 +562,7 @@ void WebIDBServerConnection::didDeleteRange(uint64_t requestID, uint32_t errorCo
     if (!serverRequest)
         return;
 
-    serverRequest->completeRequest(errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
+    serverRequest->completeRequest(errorCode ? IDBDatabaseError::create(errorCode, errorMessage).ptr() : nullptr);
 }
 
 void WebIDBServerConnection::clearObjectStore(IDBTransactionBackend&, const ClearObjectStoreOperation& operation, std::function<void (PassRefPtr<IDBDatabaseError>)> completionCallback)
@@ -591,7 +591,7 @@ void WebIDBServerConnection::didClearObjectStore(uint64_t requestID, bool succes
     if (!serverRequest)
         return;
 
-    serverRequest->completeRequest(success ? nullptr : IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Unknown error occured clearing object store"));
+    serverRequest->completeRequest(success ? nullptr : IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Unknown error occured clearing object store").ptr());
 }
 
 void WebIDBServerConnection::deleteObjectStore(IDBTransactionBackend&, const DeleteObjectStoreOperation& operation, std::function<void (PassRefPtr<IDBDatabaseError>)> completionCallback)
@@ -620,7 +620,7 @@ void WebIDBServerConnection::didDeleteObjectStore(uint64_t requestID, bool succe
     if (!serverRequest)
         return;
 
-    serverRequest->completeRequest(success ? nullptr : IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Unknown error occured deleting object store"));
+    serverRequest->completeRequest(success ? nullptr : IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Unknown error occured deleting object store").ptr());
 }
 
 void WebIDBServerConnection::changeDatabaseVersion(IDBTransactionBackend&, const IDBDatabaseBackend::VersionChangeOperation& operation, std::function<void (PassRefPtr<IDBDatabaseError>)> completionCallback)
@@ -649,7 +649,7 @@ void WebIDBServerConnection::didChangeDatabaseVersion(uint64_t requestID, bool s
     if (!serverRequest)
         return;
 
-    serverRequest->completeRequest(success ? nullptr : IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Unknown error occured changing database version"));
+    serverRequest->completeRequest(success ? nullptr : IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Unknown error occured changing database version").ptr());
 }
 
 void WebIDBServerConnection::openCursor(IDBTransactionBackend&, const OpenCursorOperation& operation, std::function<void (int64_t, PassRefPtr<IDBKey>, PassRefPtr<IDBKey>, PassRefPtr<SharedBuffer>, PassRefPtr<IDBDatabaseError>)> completionCallback)