Chromium Code Reviews| Index: media/blink/webmediaplayer_util.cc |
| diff --git a/content/renderer/media/webmediaplayer_util.cc b/media/blink/webmediaplayer_util.cc |
| similarity index 74% |
| rename from content/renderer/media/webmediaplayer_util.cc |
| rename to media/blink/webmediaplayer_util.cc |
| index 6d1b1e25aa8953fbb077d134477899a091bac40c..bcaf13567aa21e143f2ae637bd50367953d8454d 100644 |
| --- a/content/renderer/media/webmediaplayer_util.cc |
| +++ b/media/blink/webmediaplayer_util.cc |
| @@ -2,7 +2,7 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "content/renderer/media/webmediaplayer_util.h" |
| +#include "media/blink/webmediaplayer_util.h" |
| #include <math.h> |
| @@ -10,14 +10,14 @@ |
| #include "media/base/media_keys.h" |
| #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" |
| -namespace content { |
| +namespace media { |
| // Compile asserts shared by all platforms. |
| #define COMPILE_ASSERT_MATCHING_ENUM(name) \ |
| COMPILE_ASSERT( \ |
| static_cast<int>(blink::WebMediaPlayerClient::MediaKeyErrorCode ## name) == \ |
| - static_cast<int>(media::MediaKeys::k ## name ## Error), \ |
| + static_cast<int>(MediaKeys::k ## name ## Error), \ |
| mismatching_enums) |
| COMPILE_ASSERT_MATCHING_ENUM(Unknown); |
| COMPILE_ASSERT_MATCHING_ENUM(Client); |
| @@ -30,7 +30,7 @@ base::TimeDelta ConvertSecondsToTimestamp(double seconds) { |
| } |
| blink::WebTimeRanges ConvertToWebTimeRanges( |
| - const media::Ranges<base::TimeDelta>& ranges) { |
| + const Ranges<base::TimeDelta>& ranges) { |
| blink::WebTimeRanges result(ranges.size()); |
| for (size_t i = 0; i < ranges.size(); ++i) { |
| result[i].start = ranges.start(i).InSecondsF(); |
| @@ -40,38 +40,38 @@ blink::WebTimeRanges ConvertToWebTimeRanges( |
| } |
| blink::WebMediaPlayer::NetworkState PipelineErrorToNetworkState( |
| - media::PipelineStatus error) { |
| - DCHECK_NE(error, media::PIPELINE_OK); |
| + PipelineStatus error) { |
| + DCHECK_NE(error, PIPELINE_OK); |
| switch (error) { |
| - case media::PIPELINE_ERROR_NETWORK: |
| - case media::PIPELINE_ERROR_READ: |
| + case PIPELINE_ERROR_NETWORK: |
| + case PIPELINE_ERROR_READ: |
| return blink::WebMediaPlayer::NetworkStateNetworkError; |
| // TODO(vrk): Because OnPipelineInitialize() directly reports the |
| // NetworkStateFormatError instead of calling OnPipelineError(), I believe |
| // this block can be deleted. Should look into it! (crbug.com/126070) |
| - case media::PIPELINE_ERROR_INITIALIZATION_FAILED: |
| - case media::PIPELINE_ERROR_COULD_NOT_RENDER: |
| - case media::PIPELINE_ERROR_URL_NOT_FOUND: |
| - case media::DEMUXER_ERROR_COULD_NOT_OPEN: |
| - case media::DEMUXER_ERROR_COULD_NOT_PARSE: |
| - case media::DEMUXER_ERROR_NO_SUPPORTED_STREAMS: |
| - case media::DECODER_ERROR_NOT_SUPPORTED: |
| + case PIPELINE_ERROR_INITIALIZATION_FAILED: |
| + case PIPELINE_ERROR_COULD_NOT_RENDER: |
| + case PIPELINE_ERROR_URL_NOT_FOUND: |
| + case DEMUXER_ERROR_COULD_NOT_OPEN: |
| + case DEMUXER_ERROR_COULD_NOT_PARSE: |
| + case DEMUXER_ERROR_NO_SUPPORTED_STREAMS: |
| + case DECODER_ERROR_NOT_SUPPORTED: |
| return blink::WebMediaPlayer::NetworkStateFormatError; |
| - case media::PIPELINE_ERROR_DECODE: |
| - case media::PIPELINE_ERROR_ABORT: |
| - case media::PIPELINE_ERROR_OPERATION_PENDING: |
| - case media::PIPELINE_ERROR_INVALID_STATE: |
| + case PIPELINE_ERROR_DECODE: |
| + case PIPELINE_ERROR_ABORT: |
| + case PIPELINE_ERROR_OPERATION_PENDING: |
| + case PIPELINE_ERROR_INVALID_STATE: |
| return blink::WebMediaPlayer::NetworkStateDecodeError; |
| - case media::PIPELINE_ERROR_DECRYPT: |
| + case PIPELINE_ERROR_DECRYPT: |
| // TODO(xhwang): Change to use NetworkStateDecryptError once it's added in |
| // Webkit (see http://crbug.com/124486). |
| return blink::WebMediaPlayer::NetworkStateDecodeError; |
| - case media::PIPELINE_OK: |
| + case PIPELINE_OK: |
| NOTREACHED() << "Unexpected status! " << error; |
| } |
| return blink::WebMediaPlayer::NetworkStateFormatError; |
| @@ -113,7 +113,8 @@ URLSchemeForHistogram URLScheme(const GURL& url) { |
| } // namespace |
| void ReportMediaSchemeUma(const GURL& url) { |
| - UMA_HISTOGRAM_ENUMERATION("Media.URLScheme", URLScheme(url), kMaxURLScheme); |
| + UMA_HISTOGRAM_ENUMERATION("Media.URLScheme", URLScheme(url), |
| + kMaxURLScheme + 1); |
|
scherkus (not reviewing)
2014/09/04 23:00:36
+ 1 here intentional?
acolwell GONE FROM CHROMIUM
2014/09/05 00:23:44
Yes. This fixes a bug that was caught by Riley's U
|
| } |
| -} // namespace content |
| +} // namespace media |