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" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 if (cors_mode_ == blink::WebMediaPlayer::CORSModeUseCredentials) { | 76 if (cors_mode_ == blink::WebMediaPlayer::CORSModeUseCredentials) { |
77 options.allowCredentials = true; | 77 options.allowCredentials = true; |
78 allow_stored_credentials_ = true; | 78 allow_stored_credentials_ = true; |
79 } | 79 } |
80 } | 80 } |
81 loader.reset(frame->createAssociatedURLLoader(options)); | 81 loader.reset(frame->createAssociatedURLLoader(options)); |
82 } | 82 } |
83 | 83 |
84 // Start the resource loading. | 84 // Start the resource loading. |
85 loader->loadAsynchronously(request, this); | 85 loader->loadAsynchronously(request, this); |
86 active_loader_.reset(new ActiveLoader(loader.Pass())); | 86 active_loader_.reset(new media::ActiveLoader(loader.Pass())); |
87 } | 87 } |
88 | 88 |
89 ///////////////////////////////////////////////////////////////////////////// | 89 ///////////////////////////////////////////////////////////////////////////// |
90 // blink::WebURLLoaderClient implementation. | 90 // blink::WebURLLoaderClient implementation. |
91 void MediaInfoLoader::willSendRequest( | 91 void MediaInfoLoader::willSendRequest( |
92 WebURLLoader* loader, | 92 WebURLLoader* loader, |
93 WebURLRequest& newRequest, | 93 WebURLRequest& newRequest, |
94 const WebURLResponse& redirectResponse) { | 94 const WebURLResponse& redirectResponse) { |
95 // The load may have been stopped and |ready_cb| is destroyed. | 95 // The load may have been stopped and |ready_cb| is destroyed. |
96 // In this case we shouldn't do anything. | 96 // In this case we shouldn't do anything. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 void MediaInfoLoader::DidBecomeReady(Status status) { | 201 void MediaInfoLoader::DidBecomeReady(Status status) { |
202 UMA_HISTOGRAM_TIMES("Media.InfoLoadDelay", | 202 UMA_HISTOGRAM_TIMES("Media.InfoLoadDelay", |
203 base::TimeTicks::Now() - start_time_); | 203 base::TimeTicks::Now() - start_time_); |
204 active_loader_.reset(); | 204 active_loader_.reset(); |
205 if (!ready_cb_.is_null()) | 205 if (!ready_cb_.is_null()) |
206 base::ResetAndReturn(&ready_cb_).Run(status, url_, first_party_url_, | 206 base::ResetAndReturn(&ready_cb_).Run(status, url_, first_party_url_, |
207 allow_stored_credentials_); | 207 allow_stored_credentials_); |
208 } | 208 } |
209 | 209 |
210 } // namespace content | 210 } // namespace content |
OLD | NEW |