Bug 838467 2/5: DOM implementation. r=sicking,bent
authorVicamo Yang <vyang@mozilla.com>
Tue, 09 Apr 2013 10:21:31 +0800
changeset 139038 14846076568807b64055626f6183628ab3452f55
parent 139037 cc3d0f45fd4aad4e905530346bea0c4596930da2
child 139039 705364b9c45cf4d788084643eed066cec6992b3e
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking, bent
bugs838467
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 838467 2/5: DOM implementation. r=sicking,bent
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfoClasses.h
dom/mobilemessage/interfaces/moz.build
dom/mobilemessage/src/Makefile.in
dom/mobilemessage/src/MobileMessageCallback.cpp
dom/mobilemessage/src/MobileMessageCursorCallback.cpp
dom/mobilemessage/src/MobileMessageCursorCallback.h
dom/mobilemessage/src/MobileMessageManager.cpp
dom/mobilemessage/src/SmsCursor.cpp
dom/mobilemessage/src/SmsCursor.h
dom/mobilemessage/src/SmsFilter.h
dom/mobilemessage/src/SmsManager.cpp
dom/mobilemessage/src/SmsMessage.h
dom/mobilemessage/src/SmsRequest.cpp
dom/mobilemessage/src/SmsRequest.h
dom/mobilemessage/src/android/MobileMessageDatabaseService.cpp
dom/mobilemessage/src/fallback/MobileMessageDatabaseService.cpp
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -329,17 +329,16 @@ using mozilla::dom::workers::ResolveWork
 #include "nsIDOMPowerManager.h"
 #include "nsIDOMWakeLock.h"
 #include "nsIDOMSmsManager.h"
 #include "nsIDOMMobileMessageManager.h"
 #include "nsIDOMMozSmsMessage.h"
 #include "nsIDOMMozMmsMessage.h"
 #include "nsIDOMSmsRequest.h"
 #include "nsIDOMSmsFilter.h"
-#include "nsIDOMSmsCursor.h"
 #include "nsIDOMSmsSegmentInfo.h"
 #include "nsIDOMConnection.h"
 #include "mozilla/dom/network/Utils.h"
 
 #ifdef MOZ_B2G_RIL
 #include "Telephony.h"
 #include "TelephonyCall.h"
 #include "nsIDOMMozVoicemail.h"
@@ -913,19 +912,16 @@ static nsDOMClassInfoData sClassInfoData
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(MozSmsRequest, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(MozSmsFilter, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
-  NS_DEFINE_CLASSINFO_DATA(MozSmsCursor, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-
   NS_DEFINE_CLASSINFO_DATA(MozSmsSegmentInfo, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(MozConnection, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
 #ifdef MOZ_B2G_RIL
   NS_DEFINE_CLASSINFO_DATA(MozMobileConnection, nsDOMGenericSH,
@@ -2362,20 +2358,16 @@ nsDOMClassInfo::Init()
      DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozSmsRequest)
      DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(MozSmsFilter, nsIDOMMozSmsFilter)
      DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozSmsFilter)
   DOM_CLASSINFO_MAP_END
 
-  DOM_CLASSINFO_MAP_BEGIN(MozSmsCursor, nsIDOMMozSmsCursor)
-     DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozSmsCursor)
-  DOM_CLASSINFO_MAP_END
-
   DOM_CLASSINFO_MAP_BEGIN(MozSmsSegmentInfo, nsIDOMMozSmsSegmentInfo)
      DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozSmsSegmentInfo)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(MozConnection, nsIDOMMozConnection)
      DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozConnection)
      DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
   DOM_CLASSINFO_MAP_END
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -187,17 +187,16 @@ DOMCI_CLASS(MozPowerManager)
 DOMCI_CLASS(MozWakeLock)
 
 DOMCI_CLASS(MozSmsManager)
 DOMCI_CLASS(MozMobileMessageManager)
 DOMCI_CLASS(MozSmsMessage)
 DOMCI_CLASS(MozMmsMessage)
 DOMCI_CLASS(MozSmsRequest)
 DOMCI_CLASS(MozSmsFilter)
-DOMCI_CLASS(MozSmsCursor)
 DOMCI_CLASS(MozSmsSegmentInfo)
 
 DOMCI_CLASS(MozConnection)
 #ifdef MOZ_B2G_RIL
 DOMCI_CLASS(MozMobileConnection)
 DOMCI_CLASS(MozCellBroadcast)
 #endif
 
--- a/dom/mobilemessage/interfaces/moz.build
+++ b/dom/mobilemessage/interfaces/moz.build
@@ -7,22 +7,22 @@
 XPIDL_SOURCES += [
     'nsIDOMMobileMessageManager.idl',
     'nsIDOMMozMmsEvent.idl',
     'nsIDOMMozMmsMessage.idl',
     'nsIDOMMozSmsEvent.idl',
     'nsIDOMMozSmsMessage.idl',
     'nsIDOMNavigatorMobileMessage.idl',
     'nsIDOMNavigatorSms.idl',
-    'nsIDOMSmsCursor.idl',
     'nsIDOMSmsFilter.idl',
     'nsIDOMSmsManager.idl',
     'nsIDOMSmsRequest.idl',
     'nsIDOMSmsSegmentInfo.idl',
     'nsIMobileMessageCallback.idl',
+    'nsIMobileMessageCursorCallback.idl',
     'nsIMobileMessageDatabaseService.idl',
     'nsIMobileMessageService.idl',
     'nsISmsService.idl',
 ]
 
 if CONFIG['MOZ_B2G_RIL']:
     XPIDL_SOURCES += [
         'nsIRilMobileMessageDatabaseService.idl',
--- a/dom/mobilemessage/src/Makefile.in
+++ b/dom/mobilemessage/src/Makefile.in
@@ -48,32 +48,32 @@ EXPORTS_mozilla/dom/mobilemessage = \
   MobileMessageService.h \
   SmsServicesFactory.h \
   Constants.h \
   Types.h \
   MobileMessageCallback.h \
   $(NULL)
 
 CPPSRCS = \
+  MobileMessageCursorCallback.cpp \
   SmsManager.cpp \
   MobileMessageManager.cpp \
   SmsService.cpp \
   MobileMessageService.cpp \
   SmsIPCService.cpp \
   SmsServicesFactory.cpp \
   SmsParent.cpp \
   SmsMessage.cpp \
   MmsMessage.cpp \
   Constants.cpp \
   SmsChild.cpp \
   SmsRequest.cpp \
   MobileMessageCallback.cpp \
   SmsFilter.cpp \
   SmsSegmentInfo.cpp \
-  SmsCursor.cpp \
   $(NULL)
 
 LOCAL_INCLUDES = \
   -I$(topsrcdir)/content/events/src \
   -I$(topsrcdir)/dom/base \
   $(NULL)
 
 # Add VPATH to LOCAL_INCLUDES so we are going to include the correct backend
--- a/dom/mobilemessage/src/MobileMessageCallback.cpp
+++ b/dom/mobilemessage/src/MobileMessageCallback.cpp
@@ -34,58 +34,63 @@ MobileMessageCallback::MobileMessageCall
 MobileMessageCallback::~MobileMessageCallback()
 {
 }
 
 
 nsresult
 MobileMessageCallback::NotifySuccess(const JS::Value& aResult)
 {
-  nsCOMPtr<nsIDOMRequestService> rs = do_GetService(DOMREQUEST_SERVICE_CONTRACTID);
-  return rs ? rs->FireSuccess(mDOMRequest, aResult) : NS_ERROR_FAILURE;
+  mDOMRequest->FireSuccess(aResult);
+  return NS_OK;
 }
 
 nsresult
 MobileMessageCallback::NotifySuccess(nsISupports *aMessage)
 {
   nsresult rv;
   nsIScriptContext* scriptContext = mDOMRequest->GetContextForEventHandlers(&rv);
   NS_ENSURE_SUCCESS(rv, rv);
   NS_ENSURE_TRUE(scriptContext, NS_ERROR_FAILURE);
 
   AutoPushJSContext cx(scriptContext->GetNativeContext());
   NS_ENSURE_TRUE(cx, NS_ERROR_FAILURE);
 
+  JSObject* global = scriptContext->GetNativeGlobal();
+  NS_ENSURE_TRUE(global, NS_ERROR_FAILURE);
+
+  JSAutoRequest ar(cx);
+  JSAutoCompartment ac(cx, global);
+
   JS::Value wrappedMessage;
-  rv = nsContentUtils::WrapNative(cx,
-                                  JS_GetGlobalObject(cx),
-                                  aMessage,
-                                  &wrappedMessage);
+  rv = nsContentUtils::WrapNative(cx, global, aMessage, &wrappedMessage);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NotifySuccess(wrappedMessage);
 }
 
 nsresult
 MobileMessageCallback::NotifyError(int32_t aError)
 {
-  nsCOMPtr<nsIDOMRequestService> rs = do_GetService(DOMREQUEST_SERVICE_CONTRACTID);
-  NS_ENSURE_TRUE(rs, NS_ERROR_FAILURE);
-
   switch (aError) {
     case nsIMobileMessageCallback::NO_SIGNAL_ERROR:
-      return rs->FireError(mDOMRequest, NS_LITERAL_STRING("NoSignalError"));
+      mDOMRequest->FireError(NS_LITERAL_STRING("NoSignalError"));
+      break;
     case nsIMobileMessageCallback::NOT_FOUND_ERROR:
-      return rs->FireError(mDOMRequest, NS_LITERAL_STRING("NotFoundError"));
+      mDOMRequest->FireError(NS_LITERAL_STRING("NotFoundError"));
+      break;
     case nsIMobileMessageCallback::UNKNOWN_ERROR:
-      return rs->FireError(mDOMRequest, NS_LITERAL_STRING("UnknownError"));
+      mDOMRequest->FireError(NS_LITERAL_STRING("UnknownError"));
+      break;
     case nsIMobileMessageCallback::INTERNAL_ERROR:
-      return rs->FireError(mDOMRequest, NS_LITERAL_STRING("InternalError"));
+      mDOMRequest->FireError(NS_LITERAL_STRING("InternalError"));
+      break;
     default: // SUCCESS_NO_ERROR is handled above.
-      MOZ_ASSERT(false, "Unknown error value.");
+      MOZ_NOT_REACHED("Should never get here!");
+      return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 MobileMessageCallback::NotifyMessageSent(nsISupports *aMessage)
 {
@@ -118,41 +123,16 @@ MobileMessageCallback::NotifyMessageDele
 
 NS_IMETHODIMP
 MobileMessageCallback::NotifyDeleteMessageFailed(int32_t aError)
 {
   return NotifyError(aError);
 }
 
 NS_IMETHODIMP
-MobileMessageCallback::NotifyMessageListCreated(int32_t aListId,
-                                                nsISupports *aMessage)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-MobileMessageCallback::NotifyReadMessageListFailed(int32_t aError)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-MobileMessageCallback::NotifyNextMessageInListGot(nsISupports *aMessage)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-MobileMessageCallback::NotifyNoMessageInList()
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
 MobileMessageCallback::NotifyMessageMarkedRead(bool aRead)
 {
   return NotifySuccess(aRead ? JSVAL_TRUE : JSVAL_FALSE);
 }
 
 NS_IMETHODIMP
 MobileMessageCallback::NotifyMarkMessageReadFailed(int32_t aError)
 {
new file mode 100644
--- /dev/null
+++ b/dom/mobilemessage/src/MobileMessageCursorCallback.cpp
@@ -0,0 +1,97 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "MobileMessageCursorCallback.h"
+#include "nsIDOMDOMRequest.h"
+#include "nsIDOMMozSmsMessage.h"
+#include "nsIMobileMessageCallback.h"
+#include "DOMCursor.h"
+#include "nsServiceManagerUtils.h"      // for do_GetService
+
+namespace mozilla {
+namespace dom {
+namespace mobilemessage {
+
+NS_IMPL_CYCLE_COLLECTION_1(MobileMessageCursorCallback, mDOMCursor)
+
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MobileMessageCursorCallback)
+  NS_INTERFACE_MAP_ENTRY(nsIMobileMessageCursorCallback)
+  NS_INTERFACE_MAP_ENTRY(nsISupports)
+NS_INTERFACE_MAP_END
+
+NS_IMPL_CYCLE_COLLECTING_ADDREF(MobileMessageCursorCallback)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(MobileMessageCursorCallback)
+
+// nsIMobileMessageCursorCallback
+
+NS_IMETHODIMP
+MobileMessageCursorCallback::NotifyCursorError(int32_t aError)
+{
+  MOZ_ASSERT(mDOMCursor);
+
+  nsRefPtr<DOMCursor> cursor = mDOMCursor.forget();
+
+  switch (aError) {
+    case nsIMobileMessageCallback::NO_SIGNAL_ERROR:
+      cursor->FireError(NS_LITERAL_STRING("NoSignalError"));
+      break;
+    case nsIMobileMessageCallback::NOT_FOUND_ERROR:
+      cursor->FireError(NS_LITERAL_STRING("NotFoundError"));
+      break;
+    case nsIMobileMessageCallback::UNKNOWN_ERROR:
+      cursor->FireError(NS_LITERAL_STRING("UnknownError"));
+      break;
+    case nsIMobileMessageCallback::INTERNAL_ERROR:
+      cursor->FireError(NS_LITERAL_STRING("InternalError"));
+      break;
+    default: // SUCCESS_NO_ERROR is handled above.
+      MOZ_NOT_REACHED("Should never get here!");
+      return NS_ERROR_FAILURE;
+  }
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+MobileMessageCursorCallback::NotifyCursorResult(nsISupports* aResult)
+{
+  MOZ_ASSERT(mDOMCursor);
+
+  nsresult rv;
+  nsIScriptContext* scriptContext = mDOMCursor->GetContextForEventHandlers(&rv);
+  NS_ENSURE_SUCCESS(rv, rv);
+  NS_ENSURE_TRUE(scriptContext, NS_ERROR_FAILURE);
+
+  AutoPushJSContext cx(scriptContext->GetNativeContext());
+  NS_ENSURE_TRUE(cx, NS_ERROR_FAILURE);
+
+  JSObject* global = scriptContext->GetNativeGlobal();
+  NS_ENSURE_TRUE(global, NS_ERROR_FAILURE);
+
+  JSAutoRequest ar(cx);
+  JSAutoCompartment ac(cx, global);
+
+  JS::Value wrappedResult;
+  rv = nsContentUtils::WrapNative(cx, global, aResult, &wrappedResult);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  mDOMCursor->FireSuccess(wrappedResult);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+MobileMessageCursorCallback::NotifyCursorDone()
+{
+  MOZ_ASSERT(mDOMCursor);
+
+  nsRefPtr<DOMCursor> cursor = mDOMCursor.forget();
+  cursor->FireDone();
+
+  return NS_OK;
+}
+
+} // namespace mobilemessage
+} // namespace dom
+} // namespace mozilla
new file mode 100644
--- /dev/null
+++ b/dom/mobilemessage/src/MobileMessageCursorCallback.h
@@ -0,0 +1,55 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef mozilla_dom_mobilemessage_MobileMessageCursorCallback_h
+#define mozilla_dom_mobilemessage_MobileMessageCursorCallback_h
+
+#include "nsIMobileMessageCursorCallback.h"
+#include "nsCycleCollectionParticipant.h"
+#include "nsCOMPtr.h"
+#include "nsAutoPtr.h"
+
+class nsICursorContinueCallback;
+
+namespace mozilla {
+namespace dom {
+
+class DOMCursor;
+class MobileMessageManager;
+class SmsManager;
+
+namespace mobilemessage {
+
+class MobileMessageCursorCallback : public nsIMobileMessageCursorCallback
+{
+  friend class mozilla::dom::MobileMessageManager;
+  friend class mozilla::dom::SmsManager;
+
+public:
+  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+  NS_DECL_NSIMOBILEMESSAGECURSORCALLBACK
+
+  NS_DECL_CYCLE_COLLECTION_CLASS(MobileMessageCursorCallback)
+
+  MobileMessageCursorCallback()
+  {
+    MOZ_COUNT_CTOR(MobileMessageCursorCallback);
+  }
+
+private:
+  virtual ~MobileMessageCursorCallback()
+  {
+    MOZ_COUNT_DTOR(MobileMessageCursorCallback);
+  }
+
+  nsRefPtr<DOMCursor> mDOMCursor;
+};
+
+} // namespace mobilemessage
+} // namespace dom
+} // namespace mozilla
+
+#endif // mozilla_dom_mobilemessage_MobileMessageCursorCallback_h
+
--- a/dom/mobilemessage/src/MobileMessageManager.cpp
+++ b/dom/mobilemessage/src/MobileMessageManager.cpp
@@ -21,16 +21,18 @@
 #include "nsContentUtils.h"
 #include "nsIMobileMessageDatabaseService.h"
 #include "nsIXPConnect.h"
 #include "nsIPermissionManager.h"
 #include "GeneratedEvents.h"
 #include "DOMRequest.h"
 #include "nsIMobileMessageCallback.h"
 #include "MobileMessageCallback.h"
+#include "MobileMessageCursorCallback.h"
+#include "DOMCursor.h"
 
 #define RECEIVED_EVENT_NAME         NS_LITERAL_STRING("received")
 #define SENDING_EVENT_NAME          NS_LITERAL_STRING("sending")
 #define SENT_EVENT_NAME             NS_LITERAL_STRING("sent")
 #define FAILED_EVENT_NAME           NS_LITERAL_STRING("failed")
 #define DELIVERY_SUCCESS_EVENT_NAME NS_LITERAL_STRING("deliverysuccess")
 #define DELIVERY_ERROR_EVENT_NAME   NS_LITERAL_STRING("deliveryerror")
 
@@ -266,33 +268,40 @@ MobileMessageManager::Delete(const JS::V
       return NS_ERROR_INVALID_ARG;
     }
   }
 
   return Delete(id, aRequest);
 }
 
 NS_IMETHODIMP
-MobileMessageManager::GetMessages(nsIDOMMozSmsFilter* aFilter, bool aReverse,
-                                  nsIDOMMozSmsRequest** aRequest)
+MobileMessageManager::GetMessages(nsIDOMMozSmsFilter* aFilter,
+                                  bool aReverse,
+                                  nsIDOMDOMCursor** aCursor)
 {
+  nsCOMPtr<nsIMobileMessageDatabaseService> dbService =
+    do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID);
+  NS_ENSURE_TRUE(dbService, NS_ERROR_FAILURE);
+
   nsCOMPtr<nsIDOMMozSmsFilter> filter = aFilter;
-  
   if (!filter) {
     filter = new SmsFilter();
   }
 
-  nsCOMPtr<nsIDOMMozSmsRequest> req = SmsRequest::Create(this);
-  nsCOMPtr<nsIMobileMessageDatabaseService> mobileMessageDBService =
-    do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID);
-  NS_ENSURE_TRUE(mobileMessageDBService, NS_ERROR_FAILURE);
-  nsCOMPtr<nsIMobileMessageCallback> forwarder =
-    new SmsRequestForwarder(static_cast<SmsRequest*>(req.get()));
-  mobileMessageDBService->CreateMessageList(filter, aReverse, forwarder);
-  req.forget(aRequest);
+  nsRefPtr<MobileMessageCursorCallback> cursorCallback =
+    new MobileMessageCursorCallback();
+
+  nsCOMPtr<nsICursorContinueCallback> continueCallback;
+  nsresult rv = dbService->CreateMessageCursor(filter, aReverse, cursorCallback,
+                                               getter_AddRefs(continueCallback));
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  cursorCallback->mDOMCursor = new DOMCursor(GetOwner(), continueCallback);
+  NS_ADDREF(*aCursor = cursorCallback->mDOMCursor);
+
   return NS_OK;
 }
 
 NS_IMETHODIMP
 MobileMessageManager::MarkMessageRead(int32_t aId, bool aValue,
                                       nsIDOMDOMRequest** aRequest)
 {
   nsCOMPtr<nsIMobileMessageDatabaseService> mobileMessageDBService =
deleted file mode 100644
--- a/dom/mobilemessage/src/SmsCursor.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "SmsCursor.h"
-#include "nsIDOMClassInfo.h"
-#include "nsError.h"
-#include "nsIDOMMozSmsMessage.h"
-#include "SmsRequest.h"
-#include "nsIMobileMessageDatabaseService.h"
-
-DOMCI_DATA(MozSmsCursor, mozilla::dom::SmsCursor)
-
-namespace mozilla {
-namespace dom {
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SmsCursor)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMMozSmsCursor)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozSmsCursor)
-NS_INTERFACE_MAP_END
-
-NS_IMPL_CYCLE_COLLECTION_2(SmsCursor, mRequest, mMessage)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(SmsCursor)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(SmsCursor)
-
-SmsCursor::SmsCursor()
-  : mListId(-1)
-{
-}
-
-SmsCursor::SmsCursor(int32_t aListId, nsIMobileMessageCallback* aRequest)
-  : mListId(aListId)
-  , mRequest(aRequest)
-{
-}
-
-SmsCursor::~SmsCursor()
-{
-  NS_ASSERTION(!mMessage, "mMessage shouldn't be set!");
-
-  if (mListId != -1) {
-    nsCOMPtr<nsIMobileMessageDatabaseService> mobileMessageDBService =
-      do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID);
-
-    if (!mobileMessageDBService) {
-      NS_ERROR("Can't find MobileMessageDBService!");
-    }
-
-    mobileMessageDBService->ClearMessageList(mListId);
-  }
-}
-
-void
-SmsCursor::Disconnect()
-{
-  NS_ASSERTION(!mMessage, "mMessage shouldn't be set!");
-
-  mRequest = nullptr;
-  mListId = -1;
-}
-
-NS_IMETHODIMP
-SmsCursor::GetMessage(nsIDOMMozSmsMessage** aMessage)
-{
-  NS_IF_ADDREF(*aMessage = mMessage);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-SmsCursor::Continue()
-{
-  // No message means we are waiting for a message or we got the last one.
-  if (!mMessage) {
-    return NS_ERROR_DOM_INVALID_STATE_ERR;
-  }
-
-  nsRefPtr<SmsRequest> request = static_cast<SmsRequest*>(mRequest.get());
-
-  mMessage = nullptr;
-  request->Reset();
-
-  nsCOMPtr<nsIMobileMessageDatabaseService> mobileMessageDBService =
-    do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID);
-  NS_ENSURE_TRUE(mobileMessageDBService, NS_ERROR_FAILURE);
-
-  nsCOMPtr<nsIMobileMessageCallback> forwarder = new SmsRequestForwarder(request);
-  mobileMessageDBService->GetNextMessageInList(mListId, forwarder);
-
-  // We intenionally increase the refcount. The release will be called
-  // in the corresponding callback.
-  request.forget();
-  return NS_OK;
-}
-
-} // namespace dom
-} // namespace mozilla
-
deleted file mode 100644
--- a/dom/mobilemessage/src/SmsCursor.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_mobilemessage_SmsCursor_h
-#define mozilla_dom_mobilemessage_SmsCursor_h
-
-#include "nsIDOMSmsCursor.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsCOMPtr.h"
-#include "mozilla/Attributes.h"
-
-class nsIDOMMozSmsMessage;
-class nsIMobileMessageCallback;
-
-namespace mozilla {
-namespace dom {
-
-class SmsCursor MOZ_FINAL : public nsIDOMMozSmsCursor
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_NSIDOMMOZSMSCURSOR
-
-  NS_DECL_CYCLE_COLLECTION_CLASS(SmsCursor)
-
-  SmsCursor();
-  SmsCursor(int32_t aListId, nsIMobileMessageCallback* aRequest);
-
-  ~SmsCursor();
-
-  void SetMessage(nsIDOMMozSmsMessage* aMessage);
-
-  void Disconnect();
-
-private:
-  int32_t                            mListId;
-  nsCOMPtr<nsIMobileMessageCallback> mRequest;
-  nsCOMPtr<nsIDOMMozSmsMessage>      mMessage;
-};
-
-inline void
-SmsCursor::SetMessage(nsIDOMMozSmsMessage* aMessage)
-{
-  mMessage = aMessage;
-}
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_mobilemessage_SmsCursor_h
--- a/dom/mobilemessage/src/SmsFilter.h
+++ b/dom/mobilemessage/src/SmsFilter.h
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_mobilemessage_SmsFilter_h
 #define mozilla_dom_mobilemessage_SmsFilter_h
 
-#include "mozilla/dom/mobilemessage/PSms.h"
+#include "mozilla/dom/mobilemessage/SmsTypes.h"
 #include "nsIDOMSmsFilter.h"
 #include "Types.h"
 #include "mozilla/Attributes.h"
 
 namespace mozilla {
 namespace dom {
 
 class SmsFilter MOZ_FINAL : public nsIDOMMozSmsFilter
--- a/dom/mobilemessage/src/SmsManager.cpp
+++ b/dom/mobilemessage/src/SmsManager.cpp
@@ -15,16 +15,18 @@
 #include "nsIDOMMozSmsMessage.h"
 #include "SmsRequest.h"
 #include "nsJSUtils.h"
 #include "nsContentUtils.h"
 #include "nsIMobileMessageDatabaseService.h"
 #include "nsIXPConnect.h"
 #include "nsIPermissionManager.h"
 #include "GeneratedEvents.h"
+#include "MobileMessageCursorCallback.h"
+#include "DOMCursor.h"
 
 #define RECEIVED_EVENT_NAME         NS_LITERAL_STRING("received")
 #define SENDING_EVENT_NAME          NS_LITERAL_STRING("sending")
 #define SENT_EVENT_NAME             NS_LITERAL_STRING("sent")
 #define FAILED_EVENT_NAME           NS_LITERAL_STRING("failed")
 #define DELIVERY_SUCCESS_EVENT_NAME NS_LITERAL_STRING("deliverysuccess")
 #define DELIVERY_ERROR_EVENT_NAME   NS_LITERAL_STRING("deliveryerror")
 
@@ -264,33 +266,40 @@ SmsManager::Delete(const JS::Value& aPar
 
   int32_t id;
   message->GetId(&id);
 
   return Delete(id, aRequest);
 }
 
 NS_IMETHODIMP
-SmsManager::GetMessages(nsIDOMMozSmsFilter* aFilter, bool aReverse,
-                        nsIDOMMozSmsRequest** aRequest)
+SmsManager::GetMessages(nsIDOMMozSmsFilter* aFilter,
+                        bool aReverse,
+                        nsIDOMDOMCursor** aCursor)
 {
+  nsCOMPtr<nsIMobileMessageDatabaseService> dbService =
+    do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID);
+  NS_ENSURE_TRUE(dbService, NS_ERROR_FAILURE);
+
   nsCOMPtr<nsIDOMMozSmsFilter> filter = aFilter;
-  
   if (!filter) {
     filter = new SmsFilter();
   }
 
-  nsCOMPtr<nsIDOMMozSmsRequest> req = SmsRequest::Create(this);
-  nsCOMPtr<nsIMobileMessageDatabaseService> mobileMessageDBService =
-    do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID);
-  NS_ENSURE_TRUE(mobileMessageDBService, NS_ERROR_FAILURE);
-  nsCOMPtr<nsIMobileMessageCallback> forwarder =
-    new SmsRequestForwarder(static_cast<SmsRequest*>(req.get()));
-  mobileMessageDBService->CreateMessageList(filter, aReverse, forwarder);
-  req.forget(aRequest);
+  nsRefPtr<MobileMessageCursorCallback> cursorCallback =
+    new MobileMessageCursorCallback();
+
+  nsCOMPtr<nsICursorContinueCallback> continueCallback;
+  nsresult rv = dbService->CreateMessageCursor(filter, aReverse, cursorCallback,
+                                               getter_AddRefs(continueCallback));
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  cursorCallback->mDOMCursor = new DOMCursor(GetOwner(), continueCallback);
+  NS_ADDREF(*aCursor = cursorCallback->mDOMCursor);
+
   return NS_OK;
 }
 
 NS_IMETHODIMP
 SmsManager::MarkMessageRead(int32_t aId, bool aValue,
                             nsIDOMMozSmsRequest** aRequest)
 {
   nsCOMPtr<nsIDOMMozSmsRequest> req = SmsRequest::Create(this);
--- a/dom/mobilemessage/src/SmsMessage.h
+++ b/dom/mobilemessage/src/SmsMessage.h
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_mobilemessage_SmsMessage_h
 #define mozilla_dom_mobilemessage_SmsMessage_h
 
-#include "mozilla/dom/mobilemessage/PSms.h"
+#include "mozilla/dom/mobilemessage/SmsTypes.h"
 #include "nsIDOMMozSmsMessage.h"
 #include "nsString.h"
 #include "jspubtd.h"
 #include "mozilla/dom/mobilemessage/Types.h"
 #include "mozilla/Attributes.h"
 
 namespace mozilla {
 namespace dom {
--- a/dom/mobilemessage/src/SmsRequest.cpp
+++ b/dom/mobilemessage/src/SmsRequest.cpp
@@ -6,17 +6,16 @@
 #include "SmsRequest.h"
 #include "nsIDOMClassInfo.h"
 #include "nsDOMEvent.h"
 #include "nsDOMString.h"
 #include "nsContentUtils.h"
 #include "nsIDOMMozSmsMessage.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsPIDOMWindow.h"
-#include "SmsCursor.h"
 #include "SmsMessage.h"
 #include "SmsManager.h"
 #include "MobileMessageManager.h"
 #include "mozilla/dom/DOMError.h"
 #include "SmsParent.h"
 #include "jsapi.h"
 #include "DictionaryHelpers.h"
 #include "xpcpublic.h"
@@ -31,24 +30,22 @@ DOMCI_DATA(MozSmsRequest, mozilla::dom::
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_ISUPPORTS1(SmsRequestForwarder, nsIMobileMessageCallback)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(SmsRequest,
                                                   nsDOMEventTargetHelper)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCursor)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mError)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(SmsRequest,
                                                 nsDOMEventTargetHelper)
   tmp->mResult = JSVAL_VOID;
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mCursor)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mError)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(SmsRequest,
                                                nsDOMEventTargetHelper)
   NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mResult)
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
@@ -138,31 +135,16 @@ SmsRequest::SetSuccess(nsIDOMMozSmsMessa
 
 void
 SmsRequest::SetSuccess(bool aResult)
 {
   SetSuccess(aResult ? JSVAL_TRUE : JSVAL_FALSE);
 }
 
 void
-SmsRequest::SetSuccess(nsIDOMMozSmsCursor* aCursor)
-{
-  if (!SetSuccessInternal(aCursor)) {
-    return;
-  }
-
-  NS_ASSERTION(!mCursor || mCursor == aCursor,
-               "SmsRequest can't change it's cursor!");
-
-  if (!mCursor) {
-    mCursor = aCursor;
-  }
-}
-
-void
 SmsRequest::SetSuccess(const JS::Value& aResult)
 {
   NS_PRECONDITION(!mDone, "mDone shouldn't have been set to true already!");
   NS_PRECONDITION(!mError, "mError shouldn't have been set!");
   NS_PRECONDITION(JSVAL_IS_VOID(mResult), "mResult shouldn't have been set!");
 
   mResult = aResult;
   mDone = true;
@@ -208,17 +190,16 @@ SmsRequest::SetError(int32_t aError)
 {
   NS_PRECONDITION(!mDone, "mDone shouldn't have been set to true already!");
   NS_PRECONDITION(!mError, "mError shouldn't have been set!");
   NS_PRECONDITION(mResult == JSVAL_VOID, "mResult shouldn't have been set!");
   NS_PRECONDITION(aError != nsIMobileMessageCallback::SUCCESS_NO_ERROR,
                   "Can't call SetError() with SUCCESS_NO_ERROR!");
 
   mDone = true;
-  mCursor = nullptr;
 
   switch (aError) {
     case nsIMobileMessageCallback::NO_SIGNAL_ERROR:
       mError = DOMError::CreateWithName(NS_LITERAL_STRING("NoSignalError"));
       break;
     case nsIMobileMessageCallback::NOT_FOUND_ERROR:
       mError = DOMError::CreateWithName(NS_LITERAL_STRING("NotFoundError"));
       break;
@@ -384,85 +365,16 @@ SmsRequest::NotifyDeleteMessageFailed(in
 {
   if (mParent) {
     return SendMessageReply(MessageReply(ReplyMessageDeleteFail(aError)));
   }
   return NotifyError(aError);
 }
 
 NS_IMETHODIMP
-SmsRequest::NotifyMessageListCreated(int32_t aListId, nsISupports *aMessage)
-{
-  // We only support nsIDOMMozSmsMessage for SmsRequest.
-  nsCOMPtr<nsIDOMMozSmsMessage> message(do_QueryInterface(aMessage));
-  if (!message) {
-    return NS_ERROR_NOT_IMPLEMENTED;
-  }
-
-  SmsMessage* smsMessage = static_cast<SmsMessage*>(message.get());
-
-  if (mParent) {
-    SmsMessageData data = SmsMessageData(smsMessage->GetData());
-    return SendMessageReply(MessageReply(ReplyCreateMessageList(aListId, data)));
-  } else {
-    nsCOMPtr<SmsCursor> cursor = new SmsCursor(aListId, this);
-    cursor->SetMessage(smsMessage);
-    return NotifySuccess<nsIDOMMozSmsCursor*>(cursor);
-  }
-}
-
-NS_IMETHODIMP
-SmsRequest::NotifyReadMessageListFailed(int32_t aError)
-{
-  if (mParent) {
-    return SendMessageReply(MessageReply(ReplyCreateMessageListFail(aError)));
-  }
-  if (mCursor) {
-    static_cast<SmsCursor*>(mCursor.get())->Disconnect();
-  }
-  return NotifyError(aError);
-}
-
-NS_IMETHODIMP
-SmsRequest::NotifyNextMessageInListGot(nsISupports *aMessage)
-{
-  // We only support nsIDOMMozSmsMessage for SmsRequest.
-  nsCOMPtr<nsIDOMMozSmsMessage> message(do_QueryInterface(aMessage));
-  if (!message) {
-    return NS_ERROR_NOT_IMPLEMENTED;
-  }
-
-  SmsMessage* smsMessage = static_cast<SmsMessage*>(message.get());
-
-  if (mParent) {
-    SmsMessageData data = SmsMessageData(smsMessage->GetData());
-    return SendMessageReply(MessageReply(ReplyGetNextMessage(data)));
-  }
-  nsCOMPtr<SmsCursor> cursor = static_cast<SmsCursor*>(mCursor.get());
-  NS_ASSERTION(cursor, "Request should have an cursor in that case!");
-  cursor->SetMessage(smsMessage);
-  return NotifySuccess<nsIDOMMozSmsCursor*>(cursor);
-}
-
-NS_IMETHODIMP
-SmsRequest::NotifyNoMessageInList()
-{
-  if (mParent) {
-    return SendMessageReply(MessageReply(ReplyNoMessageInList()));
-  }
-  nsCOMPtr<nsIDOMMozSmsCursor> cursor = mCursor;
-  if (!cursor) {
-    cursor = new SmsCursor();
-  } else {
-    static_cast<SmsCursor*>(cursor.get())->Disconnect();
-  }
-  return NotifySuccess<nsIDOMMozSmsCursor*>(cursor);
-}
-
-NS_IMETHODIMP
 SmsRequest::NotifyMessageMarkedRead(bool aRead)
 {
   if (mParent) {
     return SendMessageReply(MessageReply(ReplyMarkeMessageRead(aRead)));
   }
   return NotifySuccess<bool>(aRead);
 }
 
--- a/dom/mobilemessage/src/SmsRequest.h
+++ b/dom/mobilemessage/src/SmsRequest.h
@@ -6,17 +6,16 @@
 #ifndef mozilla_dom_mobilemessage_SmsRequest_h
 #define mozilla_dom_mobilemessage_SmsRequest_h
 
 #include "nsIDOMSmsRequest.h"
 #include "nsIMobileMessageCallback.h"
 #include "nsDOMEventTargetHelper.h"
 
 class nsIDOMMozSmsMessage;
-class nsIDOMMozSmsCursor;
 
 namespace mozilla {
 namespace dom {
 
 namespace mobilemessage {
   class SmsRequestChild;
   class SmsRequestParent;
   class MessageReply;
@@ -51,34 +50,30 @@ private:
 class SmsManager;
 class MobileMessageManager;
 
 class SmsRequest : public nsDOMEventTargetHelper
                  , public nsIDOMMozSmsRequest
                  , public nsIMobileMessageCallback
 {
 public:
-  friend class SmsCursor;
-
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMDOMREQUEST
   NS_DECL_NSIMOBILEMESSAGECALLBACK
   NS_DECL_NSIDOMMOZSMSREQUEST
 
   NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::)
 
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(SmsRequest,
                                                          nsDOMEventTargetHelper)
 
   static already_AddRefed<nsIDOMMozSmsRequest> Create(SmsManager* aManager);
   static already_AddRefed<nsIDOMMozSmsRequest> Create(MobileMessageManager* aManager);
 
   static already_AddRefed<SmsRequest> Create(mobilemessage::SmsRequestParent* requestParent);
-  void Reset();
-
   void SetActorDied() {
     mParentAlive = false;
   }
 
   void
   NotifyThreadList(const InfallibleTArray<mobilemessage::ThreadListItem>& aItems);
 
 private:
@@ -97,21 +92,16 @@ private:
   void SetSuccess(nsIDOMMozSmsMessage* aMessage);
 
   /**
    * Set the object in a success state with the result being a boolean.
    */
   void SetSuccess(bool aResult);
 
   /**
-   * Set the object in a success state with the result being a SmsCursor.
-   */
-  void SetSuccess(nsIDOMMozSmsCursor* aCursor);
-
-  /**
    * Set the object in a success state with the result being the given JS::Value.
    */
   void SetSuccess(const JS::Value& aVal);
 
   /**
    * Set the object in an error state with the error type being aError.
    */
   void SetError(int32_t aError);
@@ -129,15 +119,14 @@ private:
   nsresult NotifySuccess(T aParam);
   nsresult NotifyError(int32_t aError);
 
   JS::Value mResult;
   bool      mDone;
   bool      mParentAlive;
   mobilemessage::SmsRequestParent* mParent;
   nsCOMPtr<nsIDOMDOMError> mError;
-  nsCOMPtr<nsIDOMMozSmsCursor> mCursor;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_mobilemessage_SmsRequest_h
--- a/dom/mobilemessage/src/android/MobileMessageDatabaseService.cpp
+++ b/dom/mobilemessage/src/android/MobileMessageDatabaseService.cpp
@@ -33,50 +33,22 @@ MobileMessageDatabaseService::DeleteMess
     return NS_OK;
   }
 
   AndroidBridge::Bridge()->DeleteMessage(aMessageId, aRequest);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-MobileMessageDatabaseService::CreateMessageList(nsIDOMMozSmsFilter* aFilter,
-                                                bool aReverse,
-                                                nsIMobileMessageCallback* aRequest)
-{
-  if (!AndroidBridge::Bridge()) {
-    return NS_OK;
-  }
-
-  AndroidBridge::Bridge()->CreateMessageList(
-    static_cast<SmsFilter*>(aFilter)->GetData(), aReverse, aRequest);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-MobileMessageDatabaseService::GetNextMessageInList(int32_t aListId,
-                                                   nsIMobileMessageCallback* aRequest)
+MobileMessageDatabaseService::CreateMessageCursor(nsIDOMMozSmsFilter* aFilter,
+                                                  bool aReverse,
+                                                  nsIMobileMessageCursorCallback* aCallback,
+                                                  nsICursorContinueCallback** aResult)
 {
-  if (!AndroidBridge::Bridge()) {
-    return NS_OK;
-  }
-
-  AndroidBridge::Bridge()->GetNextMessageInList(aListId, aRequest);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-MobileMessageDatabaseService::ClearMessageList(int32_t aListId)
-{
-  if (!AndroidBridge::Bridge()) {
-    return NS_OK;
-  }
-
-  AndroidBridge::Bridge()->ClearMessageList(aListId);
-  return NS_OK;
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 MobileMessageDatabaseService::MarkMessageRead(int32_t aMessageId,
                                               bool aValue,
                                               nsIMobileMessageCallback* aRequest)
 {
   // TODO: This would need to be implemented as part of Bug 748391
--- a/dom/mobilemessage/src/fallback/MobileMessageDatabaseService.cpp
+++ b/dom/mobilemessage/src/fallback/MobileMessageDatabaseService.cpp
@@ -23,34 +23,20 @@ NS_IMETHODIMP
 MobileMessageDatabaseService::DeleteMessage(int32_t aMessageId,
                                             nsIMobileMessageCallback* aRequest)
 {
   NS_ERROR("We should not be here!");
   return NS_OK;
 }
 
 NS_IMETHODIMP
-MobileMessageDatabaseService::CreateMessageList(nsIDOMMozSmsFilter* aFilter,
-                                                bool aReverse,
-                                                nsIMobileMessageCallback* aRequest)
-{
-  NS_ERROR("We should not be here!");
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-MobileMessageDatabaseService::GetNextMessageInList(int32_t aListId,
-                                                   nsIMobileMessageCallback* aRequest)
-{
-  NS_ERROR("We should not be here!");
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-MobileMessageDatabaseService::ClearMessageList(int32_t aListId)
+MobileMessageDatabaseService::CreateMessageCursor(nsIDOMMozSmsFilter* aFilter,
+                                                  bool aReverse,
+                                                  nsIMobileMessageCursorCallback* aCallback,
+                                                  nsICursorContinueCallback** aResult)
 {
   NS_ERROR("We should not be here!");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 MobileMessageDatabaseService::MarkMessageRead(int32_t aMessageId,
                                               bool aValue,