зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1764370 - Use NS_GET_IID instead of NS_DEFINE_IID for PRIVATE_IDBREQUEST_IID. r=dom-workers-and-storage-reviewers,asuth
Create a new fake class so that NS_GET_IID can be used instead of NS_DEFINE_IID. Differential Revision: https://phabricator.services.mozilla.com/D143509
This commit is contained in:
Родитель
467d2abfd0
Коммит
5ec46e3cef
|
@ -41,12 +41,6 @@ namespace mozilla::dom {
|
|||
using namespace mozilla::dom::indexedDB;
|
||||
using namespace mozilla::ipc;
|
||||
|
||||
namespace {
|
||||
|
||||
NS_DEFINE_IID(kIDBRequestIID, PRIVATE_IDBREQUEST_IID);
|
||||
|
||||
} // namespace
|
||||
|
||||
IDBRequest::IDBRequest(IDBDatabase* aDatabase)
|
||||
: DOMEventTargetHelper(aDatabase),
|
||||
mLoggingSerialNumber(0),
|
||||
|
@ -302,7 +296,7 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(IDBRequest, DOMEventTargetHelper)
|
|||
NS_IMPL_CYCLE_COLLECTION_TRACE_END
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(IDBRequest)
|
||||
if (aIID.Equals(kIDBRequestIID)) {
|
||||
if (aIID.Equals(NS_GET_IID(mozilla::dom::detail::PrivateIDBRequest))) {
|
||||
foundInterface = this;
|
||||
} else
|
||||
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
|
||||
|
|
|
@ -45,6 +45,17 @@ struct Nullable;
|
|||
class OwningIDBObjectStoreOrIDBIndexOrIDBCursor;
|
||||
class StrongWorkerRef;
|
||||
|
||||
namespace detail {
|
||||
// This class holds the IID for use with NS_GET_IID.
|
||||
class PrivateIDBRequest {
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(PRIVATE_IDBREQUEST_IID)
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(PrivateIDBRequest, PRIVATE_IDBREQUEST_IID)
|
||||
|
||||
} // namespace detail
|
||||
|
||||
class IDBRequest : public DOMEventTargetHelper {
|
||||
protected:
|
||||
// mSourceAsObjectStore and mSourceAsIndex are exclusive and one must always
|
||||
|
|
|
@ -105,8 +105,6 @@ using namespace mozilla::dom::indexedDB;
|
|||
|
||||
namespace {
|
||||
|
||||
NS_DEFINE_IID(kIDBPrivateRequestIID, PRIVATE_IDBREQUEST_IID);
|
||||
|
||||
// The threshold we use for structured clone data storing.
|
||||
// Anything smaller than the threshold is compressed and stored in the database.
|
||||
// Anything larger is compressed and stored outside the database.
|
||||
|
@ -410,7 +408,8 @@ nsresult IndexedDatabaseManager::CommonPostHandleEvent(
|
|||
|
||||
// Only mess with events that were originally targeted to an IDBRequest.
|
||||
RefPtr<IDBRequest> request;
|
||||
if (NS_FAILED(eventTarget->QueryInterface(kIDBPrivateRequestIID,
|
||||
if (NS_FAILED(eventTarget->QueryInterface(
|
||||
NS_GET_IID(mozilla::dom::detail::PrivateIDBRequest),
|
||||
getter_AddRefs(request))) ||
|
||||
!request) {
|
||||
return NS_OK;
|
||||
|
|
Загрузка…
Ссылка в новой задаче