Bug 674725 - Part AS - Remove SmsCursor.filter. r=sicking
authorMounir Lamouri <mounir.lamouri@gmail.com>
Mon, 19 Dec 2011 12:10:30 +0100
changeset 85955 d20eabae9a7fb9c45b4d8ff232268c8b7456196a
parent 85954 b045d642ed32cb932e9352c262496643ec917762
child 85956 157150fe0659918d5d1480a2de45d83d19c7bfa5
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs674725
milestone12.0a1
Bug 674725 - Part AS - Remove SmsCursor.filter. r=sicking
dom/sms/interfaces/nsIDOMSmsCursor.idl
dom/sms/src/SmsCursor.cpp
dom/sms/src/SmsCursor.h
dom/sms/src/SmsRequestManager.cpp
--- a/dom/sms/interfaces/nsIDOMSmsCursor.idl
+++ b/dom/sms/interfaces/nsIDOMSmsCursor.idl
@@ -34,16 +34,15 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsISupports.idl"
 
 interface nsIDOMMozSmsFilter;
 interface nsIDOMMozSmsMessage;
 
-[scriptable, function, uuid(5000ce1d-2ed3-4be5-b34c-439907489995)]
+[scriptable, function, uuid(77b41d7e-ccb1-4480-8322-2af7bc437a3c)]
 interface nsIDOMMozSmsCursor : nsISupports
 {
-  readonly attribute nsIDOMMozSmsFilter  filter;
   // Can be null if there is no more results.
   readonly attribute nsIDOMMozSmsMessage message;
                                     void continue();
 };
--- a/dom/sms/src/SmsCursor.cpp
+++ b/dom/sms/src/SmsCursor.cpp
@@ -33,17 +33,16 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "SmsCursor.h"
 #include "nsIDOMClassInfo.h"
 #include "nsDOMError.h"
-#include "nsIDOMSmsFilter.h"
 #include "nsIDOMSmsMessage.h"
 #include "nsIDOMSmsRequest.h"
 #include "SmsRequest.h"
 #include "SmsRequestManager.h"
 #include "nsISmsDatabaseService.h"
 
 DOMCI_DATA(MozSmsCursor, mozilla::dom::sms::SmsCursor)
 
@@ -52,51 +51,42 @@ namespace dom {
 namespace sms {
 
 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_3(SmsCursor, mFilter, mRequest, mMessage)
+NS_IMPL_CYCLE_COLLECTION_2(SmsCursor, mRequest, mMessage)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(SmsCursor)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(SmsCursor)
 
-SmsCursor::SmsCursor(nsIDOMMozSmsFilter* aFilter)
+SmsCursor::SmsCursor()
   : mListId(-1)
-  , mFilter(aFilter)
 {
 }
 
-SmsCursor::SmsCursor(PRInt32 aListId, nsIDOMMozSmsFilter* aFilter, nsIDOMMozSmsRequest* aRequest)
+SmsCursor::SmsCursor(PRInt32 aListId, nsIDOMMozSmsRequest* aRequest)
   : mListId(aListId)
-  , mFilter(aFilter)
   , mRequest(aRequest)
 {
 }
 
 void
 SmsCursor::Disconnect()
 {
   NS_ASSERTION(!mMessage, "mMessage shouldn't be set!");
 
   mRequest = nsnull;
   mListId = -1;
 }
 
 NS_IMETHODIMP
-SmsCursor::GetFilter(nsIDOMMozSmsFilter** aFilter)
-{
-  NS_ADDREF(*aFilter = mFilter);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 SmsCursor::GetMessage(nsIDOMMozSmsMessage** aMessage)
 {
   NS_IF_ADDREF(*aMessage = mMessage);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 SmsCursor::Continue()
--- a/dom/sms/src/SmsCursor.h
+++ b/dom/sms/src/SmsCursor.h
@@ -37,42 +37,40 @@
 
 #ifndef mozilla_dom_sms_SmsCursor_h
 #define mozilla_dom_sms_SmsCursor_h
 
 #include "nsIDOMSmsCursor.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsCOMPtr.h"
 
-class nsIDOMMozSmsFilter;
 class nsIDOMMozSmsMessage;
 class nsIDOMMozSmsRequest;
 
 namespace mozilla {
 namespace dom {
 namespace sms {
 
 class SmsCursor : public nsIDOMMozSmsCursor
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_NSIDOMMOZSMSCURSOR
 
   NS_DECL_CYCLE_COLLECTION_CLASS(SmsCursor)
 
-  SmsCursor(nsIDOMMozSmsFilter* aFilter);
-  SmsCursor(PRInt32 aListId, nsIDOMMozSmsFilter* aFilter, nsIDOMMozSmsRequest* aRequest);
+  SmsCursor();
+  SmsCursor(PRInt32 aListId, nsIDOMMozSmsRequest* aRequest);
 
   void SetMessage(nsIDOMMozSmsMessage* aMessage);
 
   void Disconnect();
 
 private:
   PRInt32                       mListId;
-  nsCOMPtr<nsIDOMMozSmsFilter>  mFilter;
   nsCOMPtr<nsIDOMMozSmsRequest> mRequest;
   nsCOMPtr<nsIDOMMozSmsMessage> mMessage;
 };
 
 inline void
 SmsCursor::SetMessage(nsIDOMMozSmsMessage* aMessage)
 {
   mMessage = aMessage;
--- a/dom/sms/src/SmsRequestManager.cpp
+++ b/dom/sms/src/SmsRequestManager.cpp
@@ -206,37 +206,35 @@ void
 SmsRequestManager::NotifySmsDeleteFailed(PRInt32 aRequestId, SmsRequest::ErrorType aError)
 {
   NotifyError(aRequestId, aError);
 }
 
 void
 SmsRequestManager::NotifyNoMessageInList(PRInt32 aRequestId)
 {
-  // TODO: use Filter!
   SmsRequest* request = GetRequest(aRequestId);
 
   nsCOMPtr<nsIDOMMozSmsCursor> cursor = request->GetCursor();
   if (!cursor) {
-    cursor = new SmsCursor(nsnull);
+    cursor = new SmsCursor();
   } else {
     static_cast<SmsCursor*>(cursor.get())->Disconnect();
   }
 
   NotifySuccess<nsIDOMMozSmsCursor*>(aRequestId, cursor);
 }
 
 void
 SmsRequestManager::NotifyCreateMessageList(PRInt32 aRequestId, PRInt32 aListId,
                                            nsIDOMMozSmsMessage* aMessage)
 {
-  // TODO: use Filter!
   SmsRequest* request = GetRequest(aRequestId);
 
-  nsCOMPtr<SmsCursor> cursor = new SmsCursor(aListId, nsnull, request);
+  nsCOMPtr<SmsCursor> cursor = new SmsCursor(aListId, request);
   cursor->SetMessage(aMessage);
 
   NotifySuccess<nsIDOMMozSmsCursor*>(aRequestId, cursor);
 }
 
 void
 SmsRequestManager::NotifyGotNextMessage(PRInt32 aRequestId, nsIDOMMozSmsMessage* aMessage)
 {