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

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

Issue 12208089: Changing CloudPrintURLFetcher instantiation to be more testable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated Gene's suggestions Created 7 years, 10 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 | « chrome/service/cloud_print/job_status_updater.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/cloud_print/printer_job_handler.cc
diff --git a/chrome/service/cloud_print/printer_job_handler.cc b/chrome/service/cloud_print/printer_job_handler.cc
index 035355b077f00b3c534373925b0dc2dd9240907d..15773f042b233b769185cfdf8fada1a64bc2749e 100644
--- a/chrome/service/cloud_print/printer_job_handler.cc
+++ b/chrome/service/cloud_print/printer_job_handler.cc
@@ -281,7 +281,7 @@ PrinterJobHandler::HandleJobMetadataResponse(
}
}
SetNextDataHandler(&PrinterJobHandler::HandlePrintTicketResponse);
- request_ = new CloudPrintURLFetcher;
+ request_ = CloudPrintURLFetcher::Create();
request_->StartGetRequest(GURL(print_ticket_url.c_str()),
this,
kCloudPrintAPIMaxRetryCount,
@@ -308,7 +308,7 @@ PrinterJobHandler::HandlePrintTicketResponse(const net::URLFetcher* source,
if (print_system_->ValidatePrintTicket(printer_info_.printer_name, data)) {
job_details_.print_ticket_ = data;
SetNextDataHandler(&PrinterJobHandler::HandlePrintDataResponse);
- request_ = new CloudPrintURLFetcher;
+ request_ = CloudPrintURLFetcher::Create();
std::string accept_headers = "Accept: ";
accept_headers += print_system_->GetSupportedMimeTypes();
request_->StartGetRequest(GURL(print_data_url_.c_str()),
@@ -422,7 +422,7 @@ void PrinterJobHandler::Start() {
job_check_pending_ = false;
// We need to fetch any pending jobs for this printer
SetNextJSONHandler(&PrinterJobHandler::HandleJobMetadataResponse);
- request_ = new CloudPrintURLFetcher;
+ request_ = CloudPrintURLFetcher::Create();
request_->StartGetRequest(
GetUrlForJobFetch(
cloud_print_server_url_, printer_info_cloud_.printer_id,
@@ -504,7 +504,7 @@ void PrinterJobHandler::UpdateJobStatus(PrintJobStatus status,
SetNextJSONHandler(
&PrinterJobHandler::HandleFailureStatusUpdateResponse);
}
- request_ = new CloudPrintURLFetcher;
+ request_ = CloudPrintURLFetcher::Create();
request_->StartGetRequest(GetUrlForJobStatusUpdate(cloud_print_server_url_,
job_details_.job_id_,
status),
@@ -652,7 +652,7 @@ void PrinterJobHandler::OnReceivePrinterCaps(
std::string mime_type("multipart/form-data; boundary=");
mime_type += mime_boundary;
SetNextJSONHandler(&PrinterJobHandler::HandlePrinterUpdateResponse);
- request_ = new CloudPrintURLFetcher;
+ request_ = CloudPrintURLFetcher::Create();
request_->StartPostRequest(
GetUrlForPrinterUpdate(
cloud_print_server_url_, printer_info_cloud_.printer_id),
« no previous file with comments | « chrome/service/cloud_print/job_status_updater.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698