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

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

Issue 2868393006: Use TaskScheduler instead of SequencedWorkerPool in media_resource_getter_impl.cc. (Closed)
Patch Set: USER_VISIBLE Created 3 years, 7 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 | « no previous file | no next file » | 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/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/threading/sequenced_worker_pool.h" 13 #include "base/task_scheduler/post_task.h"
14 #include "content/browser/blob_storage/chrome_blob_storage_context.h" 14 #include "content/browser/blob_storage/chrome_blob_storage_context.h"
15 #include "content/browser/child_process_security_policy_impl.h" 15 #include "content/browser/child_process_security_policy_impl.h"
16 #include "content/browser/fileapi/browser_file_system_helper.h" 16 #include "content/browser/fileapi/browser_file_system_helper.h"
17 #include "content/browser/resource_context_impl.h" 17 #include "content/browser/resource_context_impl.h"
18 #include "content/public/browser/browser_context.h" 18 #include "content/public/browser/browser_context.h"
19 #include "content/public/browser/browser_thread.h" 19 #include "content/public/browser/browser_thread.h"
20 #include "content/public/browser/content_browser_client.h" 20 #include "content/public/browser/content_browser_client.h"
21 #include "content/public/browser/storage_partition.h" 21 #include "content/public/browser/storage_partition.h"
22 #include "content/public/common/content_client.h" 22 #include "content/public/common/content_client.h"
23 #include "content/public/common/url_constants.h" 23 #include "content/public/common/url_constants.h"
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 void MediaResourceGetterImpl::GetPlatformPathCallback( 353 void MediaResourceGetterImpl::GetPlatformPathCallback(
354 const GetPlatformPathCB& callback, const std::string& platform_path) { 354 const GetPlatformPathCB& callback, const std::string& platform_path) {
355 DCHECK_CURRENTLY_ON(BrowserThread::UI); 355 DCHECK_CURRENTLY_ON(BrowserThread::UI);
356 callback.Run(platform_path); 356 callback.Run(platform_path);
357 } 357 }
358 358
359 void MediaResourceGetterImpl::ExtractMediaMetadata( 359 void MediaResourceGetterImpl::ExtractMediaMetadata(
360 const std::string& url, const std::string& cookies, 360 const std::string& url, const std::string& cookies,
361 const std::string& user_agent, const ExtractMediaMetadataCB& callback) { 361 const std::string& user_agent, const ExtractMediaMetadataCB& callback) {
362 DCHECK_CURRENTLY_ON(BrowserThread::UI); 362 DCHECK_CURRENTLY_ON(BrowserThread::UI);
363 base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool(); 363 base::PostTaskWithTraits(
364 pool->PostWorkerTask( 364 FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE},
365 FROM_HERE, 365 base::BindOnce(&GetMediaMetadata, url, cookies, user_agent, callback));
366 base::Bind(&GetMediaMetadata, url, cookies, user_agent, callback));
367 } 366 }
368 367
369 void MediaResourceGetterImpl::ExtractMediaMetadata( 368 void MediaResourceGetterImpl::ExtractMediaMetadata(
370 const int fd, 369 const int fd,
371 const int64_t offset, 370 const int64_t offset,
372 const int64_t size, 371 const int64_t size,
373 const ExtractMediaMetadataCB& callback) { 372 const ExtractMediaMetadataCB& callback) {
374 DCHECK_CURRENTLY_ON(BrowserThread::UI); 373 DCHECK_CURRENTLY_ON(BrowserThread::UI);
375 base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool(); 374 base::PostTaskWithTraits(
376 pool->PostWorkerTask( 375 FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE},
377 FROM_HERE, 376 base::BindOnce(&GetMediaMetadataFromFd, fd, offset, size, callback));
378 base::Bind(&GetMediaMetadataFromFd, fd, offset, size, callback));
379 } 377 }
380 378
381 } // namespace content 379 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698