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

Unified Diff: chrome/browser/printing/print_dialog_cloud_win.cc

Issue 2965803002: Move more printing code off of the FILE thread. (Closed)
Patch Set: tweak Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/printing/printer_manager_dialog_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_dialog_cloud_win.cc
diff --git a/chrome/browser/printing/print_dialog_cloud_win.cc b/chrome/browser/printing/print_dialog_cloud_win.cc
index d868b7765973050cf336ef062c3f220f38fec04d..baecdb40dc60e3fbac356a942a3e51930e36c270 100644
--- a/chrome/browser/printing/print_dialog_cloud_win.cc
+++ b/chrome/browser/printing/print_dialog_cloud_win.cc
@@ -17,6 +17,7 @@
#include "base/memory/ref_counted_memory.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/task_scheduler/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
@@ -107,7 +108,6 @@ void CreatePrintDialog(content::BrowserContext* browser_context,
scoped_refptr<base::RefCountedMemory> ReadFile(
const base::FilePath& path_to_file) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
scoped_refptr<base::RefCountedMemory> data;
int64_t file_size = 0;
if (base::GetFileSize(path_to_file, &file_size) && file_size != 0) {
@@ -130,11 +130,11 @@ void CreatePrintDialogForFile(content::BrowserContext* browser_context,
const base::string16& print_ticket,
const std::string& file_type) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- content::BrowserThread::PostTaskAndReplyWithResult(
- content::BrowserThread::FILE, FROM_HERE,
+ base::PostTaskWithTraitsAndReplyWithResult(
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_BLOCKING},
base::Bind(&ReadFile, path_to_file),
- base::Bind(&CreatePrintDialog, browser_context,
- print_job_title, print_ticket, file_type));
+ base::Bind(&CreatePrintDialog, browser_context, print_job_title,
+ print_ticket, file_type));
}
} // namespace
« no previous file with comments | « no previous file | chrome/browser/printing/printer_manager_dialog_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698