Commit 76564d56 authored by Ryan VanderMeulen's avatar Ryan VanderMeulen
Browse files

Backed out 3 changesets (bug 920179, bug 920633, bug 920800) for Windows |make...

Backed out 3 changesets (bug 920179, bug 920633, bug 920800) for Windows |make package| crashes on a CLOSED TREE.

Backed out changeset bb0041643a0f (bug 920800)
Backed out changeset 24818d9b7470 (bug 920633)
Backed out changeset d49b0f47b05a (bug 920179)
parent 4b928f4a
Loading
Loading
Loading
Loading
+69 −160
Original line number Diff line number Diff line
@@ -36,7 +36,8 @@ using mozilla::dom::OwningIDBObjectStoreOrIDBIndex;
using mozilla::ErrorResult;

static_assert(sizeof(size_t) >= sizeof(IDBCursor::Direction),
              "Relying on conversion between size_t and IDBCursor::Direction");
              "Relying on conversion between size_t and "
              "IDBCursor::Direction");

namespace {

@@ -61,9 +62,6 @@ public:
  UnpackResponseFromParentProcess(const ResponseValue& aResponseValue) = 0;

protected:
  virtual ~CursorHelper()
  { }

  nsRefPtr<IDBCursor> mCursor;

private:
@@ -81,17 +79,19 @@ public:
                 int32_t aCount)
  : CursorHelper(aCursor), mCount(aCount)
  {
    MOZ_ASSERT(NS_IsMainThread());
    MOZ_ASSERT(aCursor);
    MOZ_ASSERT(aCount > 0);
    NS_ASSERTION(aCount > 0, "Must have a count!");
  }

  ~ContinueHelper()
  {
    IDBObjectStore::ClearCloneReadInfo(mCloneReadInfo);
  }

  virtual nsresult DoDatabaseWork(mozIStorageConnection* aConnection)
                                  MOZ_OVERRIDE;

  virtual nsresult GetSuccessResult(JSContext* aCx,
                                    JS::MutableHandle<JS::Value> aVal)
                                    MOZ_OVERRIDE;
                                    JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;

  virtual void ReleaseMainThreadObjects() MOZ_OVERRIDE;

@@ -106,11 +106,6 @@ public:
                                  MOZ_OVERRIDE;

protected:
  virtual ~ContinueHelper()
  {
    IDBObjectStore::ClearCloneReadInfo(mCloneReadInfo);
  }

  virtual nsresult
  BindArgumentsToStatement(mozIStorageStatement* aStatement) = 0;

@@ -129,10 +124,10 @@ protected:

    if (mKey.IsUnset()) {
      mCursor->mHaveValue = false;
    } else {
      MOZ_ASSERT(mCursor->mType == IDBCursor::OBJECTSTORE ||
                 mCursor->mType == IDBCursor::OBJECTSTOREKEY ||
                 !mObjectKey.IsUnset());
    }
    else {
      NS_ASSERTION(mCursor->mType == IDBCursor::OBJECTSTORE ||
                   !mObjectKey.IsUnset(), "Bad key!");

      // Set new values.
      mCursor->mKey = mKey;
@@ -158,31 +153,11 @@ public:
  : ContinueHelper(aCursor, aCount)
  { }

protected:
  virtual ~ContinueObjectStoreHelper()
  { }

private:
  nsresult BindArgumentsToStatement(mozIStorageStatement* aStatement);
  nsresult GatherResultsFromStatement(mozIStorageStatement* aStatement);
};

class ContinueObjectStoreKeyHelper : public ContinueObjectStoreHelper
{
public:
  ContinueObjectStoreKeyHelper(IDBCursor* aCursor,
                               uint32_t aCount)
  : ContinueObjectStoreHelper(aCursor, aCount)
  { }

private:
  virtual ~ContinueObjectStoreKeyHelper()
  { }

  virtual nsresult
  GatherResultsFromStatement(mozIStorageStatement* aStatement) MOZ_OVERRIDE;
};

class ContinueIndexHelper : public ContinueHelper
{
public:
@@ -191,10 +166,6 @@ public:
  : ContinueHelper(aCursor, aCount)
  { }

protected:
  virtual ~ContinueIndexHelper()
  { }

private:
  nsresult BindArgumentsToStatement(mozIStorageStatement* aStatement);
  nsresult GatherResultsFromStatement(mozIStorageStatement* aStatement);
@@ -209,9 +180,6 @@ public:
  { }

private:
  virtual ~ContinueIndexObjectHelper()
  { }

  nsresult GatherResultsFromStatement(mozIStorageStatement* aStatement);
};

@@ -245,32 +213,6 @@ IDBCursor::Create(IDBRequest* aRequest,
  return cursor.forget();
}

// static
already_AddRefed<IDBCursor>
IDBCursor::Create(IDBRequest* aRequest,
                  IDBTransaction* aTransaction,
                  IDBObjectStore* aObjectStore,
                  Direction aDirection,
                  const Key& aRangeKey,
                  const nsACString& aContinueQuery,
                  const nsACString& aContinueToQuery,
                  const Key& aKey)
{
  MOZ_ASSERT(aObjectStore);
  MOZ_ASSERT(!aKey.IsUnset());

  nsRefPtr<IDBCursor> cursor =
    IDBCursor::CreateCommon(aRequest, aTransaction, aObjectStore, aDirection,
                            aRangeKey, aContinueQuery, aContinueToQuery);
  NS_ASSERTION(cursor, "This shouldn't fail!");

  cursor->mObjectStore = aObjectStore;
  cursor->mType = OBJECTSTOREKEY;
  cursor->mKey = aKey;

  return cursor.forget();
}

// static
already_AddRefed<IDBCursor>
IDBCursor::Create(IDBRequest* aRequest,
@@ -351,7 +293,7 @@ IDBCursor::ConvertDirection(mozilla::dom::IDBCursorDirection aDirection)
      return PREV_UNIQUE;

    default:
      MOZ_ASSUME_UNREACHABLE("Unknown direction!");
      MOZ_CRASH("Unknown direction!");
  }
}

@@ -454,8 +396,8 @@ IDBCursor::DropJSObjects()
void
IDBCursor::ContinueInternal(const Key& aKey, int32_t aCount, ErrorResult& aRv)
{
  MOZ_ASSERT(NS_IsMainThread());
  MOZ_ASSERT(aCount > 0);
  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
  NS_ASSERTION(aCount > 0, "Must have a count!");

  if (!mTransaction->IsOpen()) {
    aRv.Throw(NS_ERROR_DOM_INDEXEDDB_TRANSACTION_INACTIVE_ERR);
@@ -469,7 +411,10 @@ IDBCursor::ContinueInternal(const Key& aKey, int32_t aCount, ErrorResult& aRv)

  mContinueToKey = aKey;

  MOZ_ASSERT(mRequest->ReadyState() == IDBRequestReadyState::Done);
#ifdef DEBUG
  NS_ASSERTION(mRequest->ReadyState() == IDBRequestReadyState::Done,
               "Should be DONE!");
#endif

  mRequest->Reset();

@@ -479,10 +424,6 @@ IDBCursor::ContinueInternal(const Key& aKey, int32_t aCount, ErrorResult& aRv)
      helper = new ContinueObjectStoreHelper(this, aCount);
      break;

    case OBJECTSTOREKEY:
      helper = new ContinueObjectStoreKeyHelper(this, aCount);
      break;

    case INDEXKEY:
      helper = new ContinueIndexHelper(this, aCount);
      break;
@@ -492,7 +433,7 @@ IDBCursor::ContinueInternal(const Key& aKey, int32_t aCount, ErrorResult& aRv)
      break;

    default:
      MOZ_ASSUME_UNREACHABLE("Unknown cursor type!");
      NS_NOTREACHED("Unknown cursor type!");
  }

  nsresult rv = helper->DispatchToTransactionPool();
@@ -548,26 +489,15 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(IDBCursor)
JSObject*
IDBCursor::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
{
  MOZ_ASSERT(NS_IsMainThread());

  switch (mType) {
    case OBJECTSTORE:
    case INDEXOBJECT:
      return IDBCursorWithValueBinding::Wrap(aCx, aScope, this);

    case OBJECTSTOREKEY:
    case INDEXKEY:
      return IDBCursorBinding::Wrap(aCx, aScope, this);

    default:
      MOZ_ASSUME_UNREACHABLE("Bad type!");
  }
  return mType != INDEXKEY
          ? IDBCursorWithValueBinding::Wrap(aCx, aScope, this)
          : IDBCursorBinding::Wrap(aCx, aScope, this);
}

mozilla::dom::IDBCursorDirection
IDBCursor::GetDirection() const
{
  MOZ_ASSERT(NS_IsMainThread());
  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");

  switch (mDirection) {
    case NEXT:
@@ -582,39 +512,33 @@ IDBCursor::GetDirection() const
    case PREV_UNIQUE:
      return mozilla::dom::IDBCursorDirection::Prevunique;

    case DIRECTION_INVALID:
    default:
      MOZ_ASSUME_UNREACHABLE("Bad direction!");
      MOZ_CRASH("Unknown direction!");
      return mozilla::dom::IDBCursorDirection::Next;
  }
}


void
IDBCursor::GetSource(OwningIDBObjectStoreOrIDBIndex& aSource) const
{
  MOZ_ASSERT(NS_IsMainThread());
  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");

  switch (mType) {
    case OBJECTSTORE:
    case OBJECTSTOREKEY:
      MOZ_ASSERT(mObjectStore);
  if (mType == OBJECTSTORE) {
    aSource.SetAsIDBObjectStore() = mObjectStore;
      break;

    case INDEXKEY:
    case INDEXOBJECT:
      MOZ_ASSERT(mIndex);
  }
  else {
    aSource.SetAsIDBIndex() = mIndex;
      break;

    default:
      MOZ_ASSUME_UNREACHABLE("Bad type!");
  }
}

JS::Value
IDBCursor::GetKey(JSContext* aCx, ErrorResult& aRv)
{
  MOZ_ASSERT(NS_IsMainThread());
  MOZ_ASSERT(!mKey.IsUnset() || !mHaveValue);
  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");

  NS_ASSERTION(!mKey.IsUnset() || !mHaveValue, "Bad key!");

  if (!mHaveValue) {
    return JSVAL_VOID;
@@ -638,7 +562,7 @@ IDBCursor::GetKey(JSContext* aCx, ErrorResult& aRv)
JS::Value
IDBCursor::GetPrimaryKey(JSContext* aCx, ErrorResult& aRv)
{
  MOZ_ASSERT(NS_IsMainThread());
  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");

  if (!mHaveValue) {
    return JSVAL_VOID;
@@ -650,9 +574,12 @@ IDBCursor::GetPrimaryKey(JSContext* aCx, ErrorResult& aRv)
      mRooted = true;
    }

    const Key& key =
      (mType == OBJECTSTORE || mType == OBJECTSTOREKEY) ? mKey : mObjectKey;
    MOZ_ASSERT(!key.IsUnset());
    JSAutoRequest ar(aCx);

    NS_ASSERTION(mType == OBJECTSTORE ? !mKey.IsUnset() :
                                        !mObjectKey.IsUnset(), "Bad key!");

    const Key& key = mType == OBJECTSTORE ? mKey : mObjectKey;

    aRv = key.ToJSVal(aCx, mCachedPrimaryKey);
    ENSURE_SUCCESS(aRv, JSVAL_VOID);
@@ -666,8 +593,8 @@ IDBCursor::GetPrimaryKey(JSContext* aCx, ErrorResult& aRv)
JS::Value
IDBCursor::GetValue(JSContext* aCx, ErrorResult& aRv)
{
  MOZ_ASSERT(NS_IsMainThread());
  MOZ_ASSERT(mType == OBJECTSTORE || mType == INDEXOBJECT);
  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
  NS_ASSERTION(mType != INDEXKEY, "GetValue shouldn't exist on index keys");

  if (!mHaveValue) {
    return JSVAL_VOID;
@@ -699,7 +626,7 @@ IDBCursor::Continue(JSContext* aCx,
                    const Optional<JS::Handle<JS::Value> >& aKey,
                    ErrorResult &aRv)
{
  MOZ_ASSERT(NS_IsMainThread());
  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");

  Key key;
  if (aKey.WasPassed()) {
@@ -726,7 +653,7 @@ IDBCursor::Continue(JSContext* aCx,
        break;

      default:
        MOZ_ASSUME_UNREACHABLE("Unknown direction type!");
        NS_NOTREACHED("Unknown direction type!");
    }
  }

@@ -736,7 +663,7 @@ IDBCursor::Continue(JSContext* aCx,
  }

#ifdef IDB_PROFILER_USE_MARKS
  if (mType == OBJECTSTORE || mType == OBJECTSTOREKEY) {
  if (mType == OBJECTSTORE) {
    IDB_PROFILER_MARK("IndexedDB Request %llu: "
                      "database(%s).transaction(%s).objectStore(%s).cursor(%s)."
                      "continue(%s)",
@@ -768,7 +695,7 @@ already_AddRefed<IDBRequest>
IDBCursor::Update(JSContext* aCx, JS::Handle<JS::Value> aValue,
                  ErrorResult& aRv)
{
  MOZ_ASSERT(NS_IsMainThread());
  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");

  if (!mTransaction->IsOpen()) {
    aRv.Throw(NS_ERROR_DOM_INDEXEDDB_TRANSACTION_INACTIVE_ERR);
@@ -780,17 +707,18 @@ IDBCursor::Update(JSContext* aCx, JS::Handle<JS::Value> aValue,
    return nullptr;
  }

  if (!mHaveValue || mType == OBJECTSTOREKEY || mType == INDEXKEY) {
  if (!mHaveValue || mType == INDEXKEY) {
    aRv.Throw(NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR);
    return nullptr;
  }

  MOZ_ASSERT(mObjectStore);
  MOZ_ASSERT(!mKey.IsUnset());
  MOZ_ASSERT(mType == OBJECTSTORE || mType == INDEXOBJECT);
  MOZ_ASSERT_IF(mType == INDEXOBJECT, !mObjectKey.IsUnset());
  NS_ASSERTION(mObjectStore, "This cannot be null!");
  NS_ASSERTION(!mKey.IsUnset() , "Bad key!");
  NS_ASSERTION(mType != INDEXOBJECT || !mObjectKey.IsUnset(), "Bad key!");

  const Key& objectKey = (mType == OBJECTSTORE) ? mKey : mObjectKey;
  JSAutoRequest ar(aCx);

  Key& objectKey = (mType == OBJECTSTORE) ? mKey : mObjectKey;

  nsRefPtr<IDBRequest> request;
  if (mObjectStore->HasValidKeyPath()) {
@@ -868,7 +796,7 @@ IDBCursor::Update(JSContext* aCx, JS::Handle<JS::Value> aValue,
already_AddRefed<IDBRequest>
IDBCursor::Delete(JSContext* aCx, ErrorResult& aRv)
{
  MOZ_ASSERT(NS_IsMainThread());
  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");

  if (!mTransaction->IsOpen()) {
    aRv.Throw(NS_ERROR_DOM_INDEXEDDB_TRANSACTION_INACTIVE_ERR);
@@ -880,23 +808,24 @@ IDBCursor::Delete(JSContext* aCx, ErrorResult& aRv)
    return nullptr;
  }

  if (!mHaveValue || mType == OBJECTSTOREKEY || mType == INDEXKEY) {
  if (!mHaveValue || mType == INDEXKEY) {
    aRv.Throw(NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR);
    return nullptr;
  }

  MOZ_ASSERT(mObjectStore);
  MOZ_ASSERT(mType == OBJECTSTORE || mType == INDEXOBJECT);
  MOZ_ASSERT(!mKey.IsUnset());
  NS_ASSERTION(mObjectStore, "This cannot be null!");
  NS_ASSERTION(!mKey.IsUnset() , "Bad key!");

  const Key& objectKey = (mType == OBJECTSTORE) ? mKey : mObjectKey;
  Key& objectKey = (mType == OBJECTSTORE) ? mKey : mObjectKey;

  JS::Rooted<JS::Value> key(aCx);
  aRv = objectKey.ToJSVal(aCx, &key);
  ENSURE_SUCCESS(aRv, nullptr);

  nsRefPtr<IDBRequest> request = mObjectStore->Delete(aCx, key, aRv);
  ENSURE_SUCCESS(aRv, nullptr);
  if (aRv.Failed()) {
    return nullptr;
  }

#ifdef IDB_PROFILER_USE_MARKS
  {
@@ -937,7 +866,7 @@ IDBCursor::Delete(JSContext* aCx, ErrorResult& aRv)
void
IDBCursor::Advance(uint32_t aCount, ErrorResult &aRv)
{
  MOZ_ASSERT(NS_IsMainThread());
  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");

  if (aCount < 1) {
    aRv.ThrowTypeError(MSG_INVALID_ADVANCE_COUNT);
@@ -950,7 +879,7 @@ IDBCursor::Advance(uint32_t aCount, ErrorResult &aRv)

#ifdef IDB_PROFILER_USE_MARKS
  {
    if (mType == OBJECTSTORE || mType == OBJECTSTOREKEY) {
    if (mType == OBJECTSTORE) {
      IDB_PROFILER_MARK("IndexedDB Request %llu: "
                        "database(%s).transaction(%s).objectStore(%s)."
                        "cursor(%s).advance(%ld)",
@@ -1206,9 +1135,6 @@ nsresult
ContinueObjectStoreHelper::BindArgumentsToStatement(
                                               mozIStorageStatement* aStatement)
{
  MOZ_ASSERT(!NS_IsMainThread());
  MOZ_ASSERT(aStatement);

  // Bind object store id.
  nsresult rv = aStatement->BindInt64ByName(NS_LITERAL_CSTRING("id"),
                                            mCursor->mObjectStore->Id());
@@ -1240,29 +1166,12 @@ nsresult
ContinueObjectStoreHelper::GatherResultsFromStatement(
                                               mozIStorageStatement* aStatement)
{
  MOZ_ASSERT(!NS_IsMainThread());
  MOZ_ASSERT(aStatement);

  // Figure out what kind of key we have next.
  nsresult rv = mKey.SetFromStatement(aStatement, 0);
  NS_ENSURE_SUCCESS(rv, rv);

  rv = IDBObjectStore::GetStructuredCloneReadInfoFromStatement(aStatement, 1, 2,
                                                               mDatabase,
                                                               mCloneReadInfo);
  NS_ENSURE_SUCCESS(rv, rv);

  return NS_OK;
}

nsresult
ContinueObjectStoreKeyHelper::GatherResultsFromStatement(
                                               mozIStorageStatement* aStatement)
{
  MOZ_ASSERT(!NS_IsMainThread());
  MOZ_ASSERT(aStatement);

  nsresult rv = mKey.SetFromStatement(aStatement, 0);
    mDatabase, mCloneReadInfo);
  NS_ENSURE_SUCCESS(rv, rv);

  return NS_OK;
+0 −13
Original line number Diff line number Diff line
@@ -55,7 +55,6 @@ public:
  enum Type
  {
    OBJECTSTORE = 0,
    OBJECTSTOREKEY,
    INDEXKEY,
    INDEXOBJECT
  };
@@ -84,18 +83,6 @@ public:
         const Key& aKey,
         StructuredCloneReadInfo& aCloneReadInfo);

  // For OBJECTSTOREKEY cursors.
  static
  already_AddRefed<IDBCursor>
  Create(IDBRequest* aRequest,
         IDBTransaction* aTransaction,
         IDBObjectStore* aObjectStore,
         Direction aDirection,
         const Key& aRangeKey,
         const nsACString& aContinueQuery,
         const nsACString& aContinueToQuery,
         const Key& aKey);

  // For INDEXKEY cursors.
  static
  already_AddRefed<IDBCursor>
+14 −25
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@

#include "nsIIDBKeyRange.h"

#include <algorithm>
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/ContentParent.h"
#include "mozilla/dom/ipc/Blob.h"
@@ -564,7 +563,6 @@ IDBIndex::GetAllKeysInternal(IDBKeyRange* aKeyRange, uint32_t aLimit,
  IDBTransaction* transaction = mObjectStore->Transaction();
  if (!transaction->IsOpen()) {
    aRv.Throw(NS_ERROR_DOM_INDEXEDDB_TRANSACTION_INACTIVE_ERR);
    return nullptr;
  }

  nsRefPtr<IDBRequest> request = GenerateRequest(this);
@@ -1369,11 +1367,10 @@ GetHelper::UnpackResponseFromParentProcess(const ResponseValue& aResponseValue)
nsresult
GetAllKeysHelper::DoDatabaseWork(mozIStorageConnection* /* aConnection */)
{
  MOZ_ASSERT(!NS_IsMainThread());
  MOZ_ASSERT(IndexedDatabaseManager::IsMainProcess());
  NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
  NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");

  PROFILER_LABEL("IndexedDB",
                 "GetAllKeysHelper::DoDatabaseWork [IDBIndex.cpp]");
  PROFILER_LABEL("IndexedDB", "GetAllKeysHelper::DoDatabaseWork");

  nsCString tableName;
  if (mIndex->IsUnique()) {
@@ -1413,7 +1410,7 @@ GetAllKeysHelper::DoDatabaseWork(mozIStorageConnection* /* aConnection */)
    NS_ENSURE_SUCCESS(rv, rv);
  }

  mKeys.SetCapacity(std::min<uint32_t>(50, mLimit));
  mKeys.SetCapacity(50);

  bool hasResult;
  while(NS_SUCCEEDED((rv = stmt->ExecuteStep(&hasResult))) && hasResult) {
@@ -1436,12 +1433,7 @@ nsresult
GetAllKeysHelper::GetSuccessResult(JSContext* aCx,
                                   JS::MutableHandle<JS::Value> aVal)
{
  MOZ_ASSERT(NS_IsMainThread());
  MOZ_ASSERT(mKeys.Length() <= mLimit);

  PROFILER_MAIN_THREAD_LABEL("IndexedDB",
                             "GetAllKeysHelper::GetSuccessResult "
                             "[IDBIndex.cpp]");
  NS_ASSERTION(mKeys.Length() <= mLimit, "Too many results!");

  nsTArray<Key> keys;
  mKeys.SwapElements(keys);
@@ -1483,12 +1475,11 @@ GetAllKeysHelper::GetSuccessResult(JSContext* aCx,
nsresult
GetAllKeysHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)
{
  MOZ_ASSERT(NS_IsMainThread());
  MOZ_ASSERT(!IndexedDatabaseManager::IsMainProcess());
  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
  NS_ASSERTION(!IndexedDatabaseManager::IsMainProcess(), "Wrong process!");

  PROFILER_MAIN_THREAD_LABEL("IndexedDB",
                             "GetAllKeysHelper::PackArgumentsForParentProcess "
                             "[IDBIndex.cpp]");
                             "GetAllKeysHelper::PackArgumentsForParentProcess");

  GetAllKeysParams params;

@@ -1510,12 +1501,11 @@ GetAllKeysHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)
AsyncConnectionHelper::ChildProcessSendResult
GetAllKeysHelper::SendResponseToChildProcess(nsresult aResultCode)
{
  MOZ_ASSERT(NS_IsMainThread());
  MOZ_ASSERT(IndexedDatabaseManager::IsMainProcess());
  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
  NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");

  PROFILER_MAIN_THREAD_LABEL("IndexedDB",
                             "GetAllKeysHelper::SendResponseToChildProcess "
                             "[IDBIndex.cpp]");
                             "GetAllKeysHelper::SendResponseToChildProcess");

  IndexedDBRequestParentBase* actor = mRequest->GetActorParent();
  NS_ASSERTION(actor, "How did we get this far without an actor?");
@@ -1541,9 +1531,8 @@ nsresult
GetAllKeysHelper::UnpackResponseFromParentProcess(
                                            const ResponseValue& aResponseValue)
{
  MOZ_ASSERT(NS_IsMainThread());
  MOZ_ASSERT(!IndexedDatabaseManager::IsMainProcess());
  MOZ_ASSERT(aResponseValue.type() == ResponseValue::TGetAllKeysResponse);
  NS_ASSERTION(aResponseValue.type() == ResponseValue::TGetAllKeysResponse,
               "Bad response type!");

  mKeys.AppendElements(aResponseValue.get_GetAllKeysResponse().keys());
  return NS_OK;
@@ -1991,7 +1980,7 @@ OpenKeyCursorHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)

  PROFILER_MAIN_THREAD_LABEL("IndexedDB",
                             "OpenKeyCursorHelper::"
                             "PackArgumentsForParentProcess [IDBIndex.cpp]");
                             "PackArgumentsForParentProcess");

  OpenKeyCursorParams params;

+28 −767

File changed.

Preview size limit exceeded, changes collapsed.

+3 −29
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@

#include "mozilla/dom/indexedDB/IndexedDatabase.h"

#include "js/TypeDecls.h"
#include "mozilla/dom/IDBCursorBinding.h"
#include "mozilla/dom/IDBIndexBinding.h"
#include "mozilla/dom/IDBObjectStoreBinding.h"
@@ -221,11 +220,6 @@ public:
                 uint32_t aLimit,
                 ErrorResult& aRv);

  already_AddRefed<IDBRequest>
  GetAllKeysInternal(IDBKeyRange* aKeyRange,
                     uint32_t aLimit,
                     ErrorResult& aRv);

  already_AddRefed<IDBRequest>
  DeleteInternal(IDBKeyRange* aKeyRange,
                 ErrorResult& aRv);
@@ -239,13 +233,7 @@ public:
                     size_t aDirection,
                     ErrorResult& aRv);

  already_AddRefed<IDBRequest>
  OpenKeyCursorInternal(IDBKeyRange* aKeyRange,
                        size_t aDirection,
                        ErrorResult& aRv);

  nsresult
  OpenCursorFromChildProcess(
  nsresult OpenCursorFromChildProcess(
                            IDBRequest* aRequest,
                            size_t aDirection,
                            const Key& aKey,
@@ -253,12 +241,6 @@ public:
                            nsTArray<StructuredCloneFile>& aBlobs,
                            IDBCursor** _retval);

  nsresult
  OpenCursorFromChildProcess(IDBRequest* aRequest,
                             size_t aDirection,
                             const Key& aKey,
                             IDBCursor** _retval);

  void
  SetInfo(ObjectStoreInfo* aInfo);

@@ -354,14 +336,6 @@ public:
  GetAll(JSContext* aCx, const Optional<JS::Handle<JS::Value> >& aKey,
         const Optional<uint32_t >& aLimit, ErrorResult& aRv);

  already_AddRefed<IDBRequest>
  GetAllKeys(JSContext* aCx, const Optional<JS::HandleValue>& aKey,
             const Optional<uint32_t>& aLimit, ErrorResult& aRv);

  already_AddRefed<IDBRequest>
  OpenKeyCursor(JSContext* aCx, const Optional<JS::HandleValue>& aRange,
                IDBCursorDirection aDirection, ErrorResult& aRv);

protected:
  IDBObjectStore();
  ~IDBObjectStore();
Loading