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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 = |
229 ChildProcessSecurityPolicyImpl::GetInstance(); | 229 ChildProcessSecurityPolicyImpl::GetInstance(); |
230 if (!policy->CanAccessCookiesForOrigin(render_process_id_, url)) { | 230 if (!policy->CanAccessDataForOrigin(render_process_id_, url)) { |
231 callback.Run(std::string()); | 231 callback.Run(std::string()); |
232 return; | 232 return; |
233 } | 233 } |
234 | 234 |
235 net::CookieStore* cookie_store = | 235 net::CookieStore* cookie_store = |
236 context_getter_->GetURLRequestContext()->cookie_store(); | 236 context_getter_->GetURLRequestContext()->cookie_store(); |
237 if (!cookie_store) { | 237 if (!cookie_store) { |
238 callback.Run(std::string()); | 238 callback.Run(std::string()); |
239 return; | 239 return; |
240 } | 240 } |
(...skipping 137 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 |