Bug 1240264 - Annotate intentional switch fallthroughs in dom/media/. r=cpearce
authorChris Peterson <cpeterson@mozilla.com>
Thu, 14 Jan 2016 01:42:18 -0800
changeset 280349 bbbedf2904265027f7406f2c4935518b7c863765
parent 280348 3667aeb5ab27856095c3be52cc618415971f5527
child 280350 73c6bdc7aa58f9139eb2d72377cffb56ad461f83
push id70410
push usercpeterson@mozilla.com
push dateMon, 18 Jan 2016 07:26:57 +0000
treeherdermozilla-inbound@bbbedf290426 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1240264
milestone46.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 1240264 - Annotate intentional switch fallthroughs in dom/media/. r=cpearce dom/media/MediaManager.cpp:1905:7 [-Wimplicit-fallthrough] unannotated fall-through between switch labels dom/media/webm/WebMBufferedParser.cpp:133:7 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/media/MediaManager.cpp
dom/media/VideoUtils.cpp
dom/media/webaudio/AudioEventTimeline.h
dom/media/webaudio/MediaBufferDecoder.cpp
dom/media/webm/WebMBufferedParser.cpp
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -1920,18 +1920,17 @@ MediaManager::GetUserMedia(nsPIDOMWindow
       case dom::MediaSourceEnum::Browser:
         // If no window id is passed in then default to the caller's window.
         // Functional defaults are helpful in tests, but also a natural outcome
         // of the constraints API's limited semantics for requiring input.
         if (!vc.mBrowserWindow.WasPassed()) {
           nsPIDOMWindow *outer = aWindow->GetOuterWindow();
           vc.mBrowserWindow.Construct(outer->WindowID());
         }
-        // | Fall through
-        // V
+        MOZ_FALLTHROUGH;
       case dom::MediaSourceEnum::Screen:
       case dom::MediaSourceEnum::Application:
       case dom::MediaSourceEnum::Window:
         // Deny screensharing request if support is disabled, or
         // the requesting document is not from a host on the whitelist, or
         // we're on Mac OSX 10.6 and WinXP until proved that they work
         if (!Preferences::GetBool(((videoType == dom::MediaSourceEnum::Browser)?
                                    "media.getusermedia.browser.enabled" :
--- a/dom/media/VideoUtils.cpp
+++ b/dom/media/VideoUtils.cpp
@@ -247,17 +247,17 @@ IsValidVideoRegion(const nsIntSize& aFra
 already_AddRefed<SharedThreadPool> GetMediaThreadPool(MediaThreadType aType)
 {
   const char *name;
   switch (aType) {
     case MediaThreadType::PLATFORM_DECODER:
       name = "MediaPDecoder";
       break;
     default:
-      MOZ_ASSERT(false);
+      MOZ_FALLTHROUGH_ASSERT("Unexpected MediaThreadType");
     case MediaThreadType::PLAYBACK:
       name = "MediaPlayback";
       break;
   }
   return SharedThreadPool::
     Get(nsDependentCString(name),
         Preferences::GetUint("media.num-decode-threads", 12));
 }
--- a/dom/media/webaudio/AudioEventTimeline.h
+++ b/dom/media/webaudio/AudioEventTimeline.h
@@ -564,17 +564,17 @@ public:
         case AudioTimelineEvent::ExponentialRamp:
           // The value will be constant after the last event
           return aPrevious->mValue;
         case AudioTimelineEvent::SetValueCurve:
           return ExtractValueFromCurve(aPrevious->template Time<TimeType>(),
                                        aPrevious->mCurve, aPrevious->mCurveLength,
                                        aPrevious->mDuration, aTime);
         case AudioTimelineEvent::SetTarget:
-          MOZ_ASSERT(false, "unreached");
+          MOZ_FALLTHROUGH_ASSERT("AudioTimelineEvent::SetTarget");
         case AudioTimelineEvent::SetValue:
         case AudioTimelineEvent::Cancel:
         case AudioTimelineEvent::Stream:
           MOZ_ASSERT(false, "Should have been handled earlier.");
       }
       MOZ_ASSERT(false, "unreached");
     }
 
@@ -612,17 +612,17 @@ public:
       // If the next event type is neither linear or exponential ramp, the
       // value is constant.
       return aPrevious->mValue;
     case AudioTimelineEvent::SetValueCurve:
       return ExtractValueFromCurve(aPrevious->template Time<TimeType>(),
                                    aPrevious->mCurve, aPrevious->mCurveLength,
                                    aPrevious->mDuration, aTime);
     case AudioTimelineEvent::SetTarget:
-      MOZ_ASSERT(false, "unreached");
+      MOZ_FALLTHROUGH_ASSERT("AudioTimelineEvent::SetTarget");
     case AudioTimelineEvent::SetValue:
     case AudioTimelineEvent::Cancel:
     case AudioTimelineEvent::Stream:
       MOZ_ASSERT(false, "Should have been handled earlier.");
     }
 
     MOZ_ASSERT(false, "unreached");
     return 0.0f;
--- a/dom/media/webaudio/MediaBufferDecoder.cpp
+++ b/dom/media/webaudio/MediaBufferDecoder.cpp
@@ -565,17 +565,17 @@ WebAudioDecodeJob::OnSuccess(ErrorCode a
 void
 WebAudioDecodeJob::OnFailure(ErrorCode aErrorCode)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   const char* errorMessage;
   switch (aErrorCode) {
   case NoError:
-    MOZ_ASSERT(false, "Who passed NoError to OnFailure?");
+    MOZ_FALLTHROUGH_ASSERT("Who passed NoError to OnFailure?");
     // Fall through to get some sort of a sane error message if this actually
     // happens at runtime.
   case UnknownError:
     errorMessage = "MediaDecodeAudioDataUnknownError";
     break;
   case UnknownContent:
     errorMessage = "MediaDecodeAudioDataUnknownContentType";
     break;
--- a/dom/media/webm/WebMBufferedParser.cpp
+++ b/dom/media/webm/WebMBufferedParser.cpp
@@ -128,17 +128,17 @@ void WebMBufferedParser::Append(const un
         break;
       case TRACKS_ID:
         mSkipBytes = mElement.mSize.mValue;
         mState = CHECK_INIT_FOUND;
         break;
       case EBML_ID:
         mLastInitStartOffset = mCurrentOffset + (p - aBuffer) -
                             (mElement.mID.mLength + mElement.mSize.mLength);
-        /* FALLTHROUGH */
+        MOZ_FALLTHROUGH;
       default:
         mSkipBytes = mElement.mSize.mValue;
         mState = SKIP_DATA;
         mNextState = READ_ELEMENT_ID;
         break;
       }
       break;
     case READ_VINT: {