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

Side by Side Diff: content/browser/media/android/media_resource_getter_impl.cc

Issue 1157333005: [net/http auth] Use strings to identify authentication schemes. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « chrome/browser/chromeos/login/profile_auth_data_unittest.cc ('k') | net/base/auth.h » ('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/browser/media/android/media_resource_getter_impl.h" 5 #include "content/browser/media/android/media_resource_getter_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 net::HttpAuthCache* auth_cache = 209 net::HttpAuthCache* auth_cache =
210 factory->GetSession()->http_auth_cache(); 210 factory->GetSession()->http_auth_cache();
211 if (!auth_cache) 211 if (!auth_cache)
212 return net::AuthCredentials(); 212 return net::AuthCredentials();
213 213
214 net::HttpAuthCache::Entry* entry = 214 net::HttpAuthCache::Entry* entry =
215 auth_cache->LookupByPath(url.GetOrigin(), url.path()); 215 auth_cache->LookupByPath(url.GetOrigin(), url.path());
216 216
217 // TODO(qinmin): handle other auth schemes. See http://crbug.com/395219. 217 // TODO(qinmin): handle other auth schemes. See http://crbug.com/395219.
218 if (entry && entry->scheme() == net::HttpAuth::AUTH_SCHEME_BASIC) 218 if (entry && entry->scheme() == "basic")
219 return entry->credentials(); 219 return entry->credentials();
220 else 220 else
221 return net::AuthCredentials(); 221 return net::AuthCredentials();
222 } 222 }
223 223
224 void MediaResourceGetterTask::RequestCookies( 224 void MediaResourceGetterTask::RequestCookies(
225 const GURL& url, const GURL& first_party_for_cookies, 225 const GURL& url, const GURL& first_party_for_cookies,
226 const media::MediaResourceGetter::GetCookieCB& callback) { 226 const media::MediaResourceGetter::GetCookieCB& callback) {
227 DCHECK_CURRENTLY_ON(BrowserThread::IO); 227 DCHECK_CURRENTLY_ON(BrowserThread::IO);
228 ChildProcessSecurityPolicyImpl* policy = 228 ChildProcessSecurityPolicyImpl* policy =
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 FROM_HERE, 378 FROM_HERE,
379 base::Bind(&GetMediaMetadataFromFd, fd, offset, size, callback)); 379 base::Bind(&GetMediaMetadataFromFd, fd, offset, size, callback));
380 } 380 }
381 381
382 // static 382 // static
383 bool MediaResourceGetterImpl::RegisterMediaResourceGetter(JNIEnv* env) { 383 bool MediaResourceGetterImpl::RegisterMediaResourceGetter(JNIEnv* env) {
384 return RegisterNativesImpl(env); 384 return RegisterNativesImpl(env);
385 } 385 }
386 386
387 } // namespace content 387 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/profile_auth_data_unittest.cc ('k') | net/base/auth.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698