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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 | 230 |
231 void MediaResourceGetterImpl::GetCookiesCallback( | 231 void MediaResourceGetterImpl::GetCookiesCallback( |
232 const GetCookieCB& callback, const std::string& cookies) { | 232 const GetCookieCB& callback, const std::string& cookies) { |
233 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 233 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
234 callback.Run(cookies); | 234 callback.Run(cookies); |
235 } | 235 } |
236 | 236 |
237 void MediaResourceGetterImpl::GetPlatformPathFromURL( | 237 void MediaResourceGetterImpl::GetPlatformPathFromURL( |
238 const GURL& url, const GetPlatformPathCB& callback) { | 238 const GURL& url, const GetPlatformPathCB& callback) { |
239 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 239 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
240 DCHECK(url.SchemeIsFileSystem() || url.SchemeIs(kBlobScheme)); | 240 DCHECK(url.SchemeIsFileSystem() || url.SchemeIs(url::kBlobScheme)); |
241 | 241 |
242 GetPlatformPathCB cb = | 242 GetPlatformPathCB cb = |
243 base::Bind(&MediaResourceGetterImpl::GetPlatformPathCallback, | 243 base::Bind(&MediaResourceGetterImpl::GetPlatformPathCallback, |
244 weak_factory_.GetWeakPtr(), | 244 weak_factory_.GetWeakPtr(), |
245 callback); | 245 callback); |
246 | 246 |
247 if (url.SchemeIs(kBlobScheme)) { | 247 if (url.SchemeIs(url::kBlobScheme)) { |
248 BrowserThread::PostTask( | 248 BrowserThread::PostTask( |
249 BrowserThread::IO, | 249 BrowserThread::IO, |
250 FROM_HERE, | 250 FROM_HERE, |
251 base::Bind(&RequestPlatformPathFromBlobURL, url, browser_context_, cb)); | 251 base::Bind(&RequestPlatformPathFromBlobURL, url, browser_context_, cb)); |
252 return; | 252 return; |
253 } | 253 } |
254 | 254 |
255 scoped_refptr<fileapi::FileSystemContext> context(file_system_context_); | 255 scoped_refptr<fileapi::FileSystemContext> context(file_system_context_); |
256 BrowserThread::PostTask( | 256 BrowserThread::PostTask( |
257 BrowserThread::FILE, | 257 BrowserThread::FILE, |
(...skipping 17 matching lines...) Expand all Loading... |
275 FROM_HERE, | 275 FROM_HERE, |
276 base::Bind(&GetMediaMetadata, url, cookies, user_agent, callback)); | 276 base::Bind(&GetMediaMetadata, url, cookies, user_agent, callback)); |
277 } | 277 } |
278 | 278 |
279 // static | 279 // static |
280 bool MediaResourceGetterImpl::RegisterMediaResourceGetter(JNIEnv* env) { | 280 bool MediaResourceGetterImpl::RegisterMediaResourceGetter(JNIEnv* env) { |
281 return RegisterNativesImpl(env); | 281 return RegisterNativesImpl(env); |
282 } | 282 } |
283 | 283 |
284 } // namespace content | 284 } // namespace content |
OLD | NEW |