Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: content/renderer/media/android/media_info_loader.cc

Issue 392333004: Drop 'WebURLRequest::setTargetType' from various content/renderer files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pepper_url_loader_host Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/renderer/media/buffered_resource_loader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 26 matching lines...) Expand all
37 37
38 void MediaInfoLoader::Start(blink::WebFrame* frame) { 38 void MediaInfoLoader::Start(blink::WebFrame* frame) {
39 // Make sure we have not started. 39 // Make sure we have not started.
40 DCHECK(!ready_cb_.is_null()); 40 DCHECK(!ready_cb_.is_null());
41 CHECK(frame); 41 CHECK(frame);
42 42
43 start_time_ = base::TimeTicks::Now(); 43 start_time_ = base::TimeTicks::Now();
44 44
45 // Prepare the request. 45 // Prepare the request.
46 WebURLRequest request(url_); 46 WebURLRequest request(url_);
47 request.setTargetType(WebURLRequest::TargetIsMedia); 47 // TODO(mkwst): Split this into video/audio.
48 request.setRequestContext(WebURLRequest::RequestContextVideo);
48 frame->setReferrerForRequest(request, blink::WebURL()); 49 frame->setReferrerForRequest(request, blink::WebURL());
49 50
50 scoped_ptr<WebURLLoader> loader; 51 scoped_ptr<WebURLLoader> loader;
51 if (test_loader_) { 52 if (test_loader_) {
52 loader = test_loader_.Pass(); 53 loader = test_loader_.Pass();
53 } else { 54 } else {
54 WebURLLoaderOptions options; 55 WebURLLoaderOptions options;
55 if (cors_mode_ == blink::WebMediaPlayer::CORSModeUnspecified) { 56 if (cors_mode_ == blink::WebMediaPlayer::CORSModeUnspecified) {
56 options.allowCredentials = true; 57 options.allowCredentials = true;
57 options.crossOriginRequestPolicy = 58 options.crossOriginRequestPolicy =
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 185
185 void MediaInfoLoader::DidBecomeReady(Status status) { 186 void MediaInfoLoader::DidBecomeReady(Status status) {
186 UMA_HISTOGRAM_TIMES("Media.InfoLoadDelay", 187 UMA_HISTOGRAM_TIMES("Media.InfoLoadDelay",
187 base::TimeTicks::Now() - start_time_); 188 base::TimeTicks::Now() - start_time_);
188 active_loader_.reset(); 189 active_loader_.reset();
189 if (!ready_cb_.is_null()) 190 if (!ready_cb_.is_null())
190 base::ResetAndReturn(&ready_cb_).Run(status); 191 base::ResetAndReturn(&ready_cb_).Run(status);
191 } 192 }
192 193
193 } // namespace content 194 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/buffered_resource_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698