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 "webkit/renderer/media/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/web/WebFrame.h" | |
11 #include "third_party/WebKit/public/platform/WebURLError.h" | 10 #include "third_party/WebKit/public/platform/WebURLError.h" |
12 #include "third_party/WebKit/public/platform/WebURLLoader.h" | 11 #include "third_party/WebKit/public/platform/WebURLLoader.h" |
13 #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" |
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; |
21 | 22 |
22 namespace webkit_media { | 23 namespace content { |
23 | 24 |
24 static const int kHttpOK = 200; | 25 static const int kHttpOK = 200; |
25 | 26 |
26 MediaInfoLoader::MediaInfoLoader( | 27 MediaInfoLoader::MediaInfoLoader( |
27 const GURL& url, | 28 const GURL& url, |
28 WebKit::WebMediaPlayer::CORSMode cors_mode, | 29 WebKit::WebMediaPlayer::CORSMode cors_mode, |
29 const ReadyCB& ready_cb) | 30 const ReadyCB& ready_cb) |
30 : loader_failed_(false), | 31 : loader_failed_(false), |
31 url_(url), | 32 url_(url), |
32 cors_mode_(cors_mode), | 33 cors_mode_(cors_mode), |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // Helper methods. | 176 // Helper methods. |
176 | 177 |
177 void MediaInfoLoader::DidBecomeReady(Status status) { | 178 void MediaInfoLoader::DidBecomeReady(Status status) { |
178 UMA_HISTOGRAM_TIMES("Media.InfoLoadDelay", | 179 UMA_HISTOGRAM_TIMES("Media.InfoLoadDelay", |
179 base::TimeTicks::Now() - start_time_); | 180 base::TimeTicks::Now() - start_time_); |
180 active_loader_.reset(); | 181 active_loader_.reset(); |
181 if (!ready_cb_.is_null()) | 182 if (!ready_cb_.is_null()) |
182 base::ResetAndReturn(&ready_cb_).Run(status); | 183 base::ResetAndReturn(&ready_cb_).Run(status); |
183 } | 184 } |
184 | 185 |
185 } // namespace webkit_media | 186 } // namespace content |
OLD | NEW |