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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |