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

Side by Side Diff: chrome/browser/ui/webui/print_preview/extension_printer_handler.cc

Issue 2858073002: Use constexpr TaskTraits constructor in chrome. (Closed)
Patch Set: 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/ui/webui/print_preview/extension_printer_handler.h" 5 #include "chrome/browser/ui/webui/print_preview/extension_printer_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 std::unique_ptr<extensions::PrinterProviderPrintJob> job, 73 std::unique_ptr<extensions::PrinterProviderPrintJob> job,
74 const ExtensionPrinterHandler::PrintJobCallback& callback, 74 const ExtensionPrinterHandler::PrintJobCallback& callback,
75 bool success, 75 bool success,
76 const base::FilePath& pwg_file_path) { 76 const base::FilePath& pwg_file_path) {
77 if (!success) { 77 if (!success) {
78 callback.Run(std::move(job)); 78 callback.Run(std::move(job));
79 return; 79 return;
80 } 80 }
81 81
82 base::PostTaskWithTraitsAndReplyWithResult( 82 base::PostTaskWithTraitsAndReplyWithResult(
83 FROM_HERE, base::TaskTraits() 83 FROM_HERE,
84 .WithShutdownBehavior( 84 {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
85 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
86 .MayBlock(),
87 base::Bind(&UpdateJobFileInfoOnWorkerThread, pwg_file_path, 85 base::Bind(&UpdateJobFileInfoOnWorkerThread, pwg_file_path,
88 base::Passed(&job)), 86 base::Passed(&job)),
89 callback); 87 callback);
90 } 88 }
91 89
92 bool HasUsbPrinterProviderPermissions(const Extension* extension) { 90 bool HasUsbPrinterProviderPermissions(const Extension* extension) {
93 return extension->permissions_data() && 91 return extension->permissions_data() &&
94 extension->permissions_data()->HasAPIPermission( 92 extension->permissions_data()->HasAPIPermission(
95 extensions::APIPermission::kPrinterProvider) && 93 extensions::APIPermission::kPrinterProvider) &&
96 extension->permissions_data()->HasAPIPermission( 94 extension->permissions_data()->HasAPIPermission(
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 .Set("provisional", true) 361 .Set("provisional", true)
364 .Build()); 362 .Build());
365 } 363 }
366 } 364 }
367 } 365 }
368 366
369 DCHECK_GT(pending_enumeration_count_, 0); 367 DCHECK_GT(pending_enumeration_count_, 0);
370 pending_enumeration_count_--; 368 pending_enumeration_count_--;
371 callback.Run(*printer_list.Build().get(), pending_enumeration_count_ == 0); 369 callback.Run(*printer_list.Build().get(), pending_enumeration_count_ == 0);
372 } 370 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698