| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/android/media_info_loader.h" | 5 #include "content/renderer/media/android/media_info_loader.h" |
| 6 | 6 |
| 7 #include "base/bits.h" | 7 #include "base/bits.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "third_party/WebKit/public/platform/WebURLError.h" | 10 #include "third_party/WebKit/public/platform/WebURLError.h" |
| 11 #include "third_party/WebKit/public/platform/WebURLLoader.h" | 11 #include "third_party/WebKit/public/platform/WebURLLoader.h" |
| 12 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 12 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 13 #include "third_party/WebKit/public/web/WebFrame.h" | 13 #include "third_party/WebKit/public/web/WebFrame.h" |
| 14 | 14 |
| 15 using WebKit::WebFrame; | 15 using WebKit::WebFrame; |
| 16 using WebKit::WebURLError; | 16 using WebKit::WebURLError; |
| 17 using WebKit::WebURLLoader; | 17 using WebKit::WebURLLoader; |
| 18 using WebKit::WebURLLoaderOptions; | 18 using WebKit::WebURLLoaderOptions; |
| 19 using WebKit::WebURLRequest; | 19 using WebKit::WebURLRequest; |
| 20 using WebKit::WebURLResponse; | 20 using WebKit::WebURLResponse; |
| 21 using webkit_media::ActiveLoader; | |
| 22 | 21 |
| 23 namespace content { | 22 namespace content { |
| 24 | 23 |
| 25 static const int kHttpOK = 200; | 24 static const int kHttpOK = 200; |
| 26 | 25 |
| 27 MediaInfoLoader::MediaInfoLoader( | 26 MediaInfoLoader::MediaInfoLoader( |
| 28 const GURL& url, | 27 const GURL& url, |
| 29 WebKit::WebMediaPlayer::CORSMode cors_mode, | 28 WebKit::WebMediaPlayer::CORSMode cors_mode, |
| 30 const ReadyCB& ready_cb) | 29 const ReadyCB& ready_cb) |
| 31 : loader_failed_(false), | 30 : loader_failed_(false), |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 176 |
| 178 void MediaInfoLoader::DidBecomeReady(Status status) { | 177 void MediaInfoLoader::DidBecomeReady(Status status) { |
| 179 UMA_HISTOGRAM_TIMES("Media.InfoLoadDelay", | 178 UMA_HISTOGRAM_TIMES("Media.InfoLoadDelay", |
| 180 base::TimeTicks::Now() - start_time_); | 179 base::TimeTicks::Now() - start_time_); |
| 181 active_loader_.reset(); | 180 active_loader_.reset(); |
| 182 if (!ready_cb_.is_null()) | 181 if (!ready_cb_.is_null()) |
| 183 base::ResetAndReturn(&ready_cb_).Run(status); | 182 base::ResetAndReturn(&ready_cb_).Run(status); |
| 184 } | 183 } |
| 185 | 184 |
| 186 } // namespace content | 185 } // namespace content |
| OLD | NEW |