Bug 1032118 - Remove the nsresult return value from nsMediaList::SetStyleSheet; r=dbaron
authorMs2ger <ms2ger@gmail.com>
Wed, 02 Jul 2014 12:53:41 +0200
changeset 191897 325dbad04552506a712da56310519ce2878d34a5
parent 191896 4f7db7e63a84f12c9dad67dbf39ca214236f1fc0
child 191898 3081a82b0ae324967974c90f92dbbc62b0f6314a
push id27068
push userkwierso@gmail.com
push dateWed, 02 Jul 2014 23:31:32 +0000
treeherdermozilla-central@ff731ea82e4d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1032118
milestone33.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 1032118 - Remove the nsresult return value from nsMediaList::SetStyleSheet; r=dbaron It is never checked, and only ever returns NS_OK.
layout/style/CSSStyleSheet.cpp
layout/style/nsIMediaList.h
--- a/layout/style/CSSStyleSheet.cpp
+++ b/layout/style/CSSStyleSheet.cpp
@@ -538,23 +538,22 @@ nsMediaList::Matches(nsPresContext* aPre
   for (int32_t i = 0, i_end = mArray.Length(); i < i_end; ++i) {
     if (mArray[i]->Matches(aPresContext, aKey)) {
       return true;
     }
   }
   return mArray.IsEmpty();
 }
 
-nsresult
+void
 nsMediaList::SetStyleSheet(CSSStyleSheet* aSheet)
 {
   NS_ASSERTION(aSheet == mStyleSheet || !aSheet || !mStyleSheet,
                "multiple style sheets competing for one media list");
   mStyleSheet = aSheet;
-  return NS_OK;
 }
 
 already_AddRefed<nsMediaList>
 nsMediaList::Clone()
 {
   nsRefPtr<nsMediaList> result = new nsMediaList();
   result->mArray.AppendElements(mArray.Length());
   for (uint32_t i = 0, i_end = mArray.Length(); i < i_end; ++i) {
--- a/layout/style/nsIMediaList.h
+++ b/layout/style/nsIMediaList.h
@@ -171,17 +171,17 @@ public:
   void GetText(nsAString& aMediaText);
   void SetText(const nsAString& aMediaText);
 
   // Does this query apply to the presentation?
   // If |aKey| is non-null, add cache information to it.
   bool Matches(nsPresContext* aPresContext,
                  nsMediaQueryResultCacheKey* aKey);
 
-  nsresult SetStyleSheet(mozilla::CSSStyleSheet* aSheet);
+  void SetStyleSheet(mozilla::CSSStyleSheet* aSheet);
   void AppendQuery(nsAutoPtr<nsMediaQuery>& aQuery) {
     // Takes ownership of aQuery
     mArray.AppendElement(aQuery.forget());
   }
 
   already_AddRefed<nsMediaList> Clone();
 
   nsMediaQuery* MediumAt(int32_t aIndex) { return mArray[aIndex]; }