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

Unified Diff: chrome/service/cloud_print/print_system_cups.cc

Issue 1907083002: Cloud Print Proxy: Delete print jobs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/service/cloud_print/print_system_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/cloud_print/print_system_cups.cc
diff --git a/chrome/service/cloud_print/print_system_cups.cc b/chrome/service/cloud_print/print_system_cups.cc
index ec9d187c41f9dbbf5c94af8724266d3646c4c07a..d1e476884d7dda3ce782c79f6aec6f77825cc30a 100644
--- a/chrome/service/cloud_print/print_system_cups.cc
+++ b/chrome/service/cloud_print/print_system_cups.cc
@@ -16,6 +16,7 @@
#include "base/bind.h"
#include "base/files/file_path.h"
+#include "base/files/file_util.h"
#include "base/json/json_reader.h"
#include "base/location.h"
#include "base/logging.h"
@@ -719,26 +720,26 @@ int PrintSystemCUPS::PrintFile(const GURL& url, http_encryption_t encryption,
const char* name, const char* filename,
const char* title, int num_options,
cups_option_t* options) {
- if (url.is_empty()) { // Use default (local) print server.
+ // Use default (local) print server.
+ if (url.is_empty())
return cupsPrintFile(name, filename, title, num_options, options);
- } else {
- printing::HttpConnectionCUPS http(url, encryption);
- http.SetBlocking(false);
- return cupsPrintFile2(http.http(), name, filename,
- title, num_options, options);
- }
+
+ printing::HttpConnectionCUPS http(url, encryption);
+ http.SetBlocking(false);
+ return cupsPrintFile2(http.http(), name, filename, title, num_options,
+ options);
}
int PrintSystemCUPS::GetJobs(cups_job_t** jobs, const GURL& url,
http_encryption_t encryption,
const char* name, int myjobs, int whichjobs) {
- if (url.is_empty()) { // Use default (local) print server.
+ // Use default (local) print server.
+ if (url.is_empty())
return cupsGetJobs(jobs, name, myjobs, whichjobs);
- } else {
- printing::HttpConnectionCUPS http(url, encryption);
- http.SetBlocking(false);
- return cupsGetJobs2(http.http(), jobs, name, myjobs, whichjobs);
- }
+
+ printing::HttpConnectionCUPS http(url, encryption);
+ http.SetBlocking(false);
+ return cupsGetJobs2(http.http(), jobs, name, myjobs, whichjobs);
}
PlatformJobId PrintSystemCUPS::SpoolPrintJob(
@@ -788,6 +789,7 @@ PlatformJobId PrintSystemCUPS::SpoolPrintJob(
PrintFile(server_info->url, cups_encryption_, short_printer_name.c_str(),
print_data_file_path.value().c_str(), job_title.c_str(),
cups_options.size(), cups_options.data());
+ base::DeleteFile(print_data_file_path, false);
// TODO(alexyu): Output printer id.
VLOG(1) << "CP_CUPS: Job spooled"
« no previous file with comments | « no previous file | chrome/service/cloud_print/print_system_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698