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

Side by Side Diff: chrome/service/cloud_print/printer_job_handler.cc

Issue 99923002: Move temp file functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/service/cloud_print/printer_job_handler.h" 5 #include "chrome/service/cloud_print/printer_job_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 360 }
361 return CloudPrintURLFetcher::STOP_PROCESSING; 361 return CloudPrintURLFetcher::STOP_PROCESSING;
362 } 362 }
363 363
364 CloudPrintURLFetcher::ResponseAction 364 CloudPrintURLFetcher::ResponseAction
365 PrinterJobHandler::HandlePrintDataResponse(const net::URLFetcher* source, 365 PrinterJobHandler::HandlePrintDataResponse(const net::URLFetcher* source,
366 const GURL& url, 366 const GURL& url,
367 const std::string& data) { 367 const std::string& data) {
368 VLOG(1) << "CP_CONNECTOR: Handling print data response" 368 VLOG(1) << "CP_CONNECTOR: Handling print data response"
369 << ", printer id: " << printer_info_cloud_.printer_id; 369 << ", printer id: " << printer_info_cloud_.printer_id;
370 if (file_util::CreateTemporaryFile(&job_details_.print_data_file_path_)) { 370 if (base::CreateTemporaryFile(&job_details_.print_data_file_path_)) {
371 UMA_HISTOGRAM_ENUMERATION("CloudPrint.JobHandlerEvent", JOB_HANDLER_DATA, 371 UMA_HISTOGRAM_ENUMERATION("CloudPrint.JobHandlerEvent", JOB_HANDLER_DATA,
372 JOB_HANDLER_MAX); 372 JOB_HANDLER_MAX);
373 int ret = file_util::WriteFile(job_details_.print_data_file_path_, 373 int ret = file_util::WriteFile(job_details_.print_data_file_path_,
374 data.c_str(), data.length()); 374 data.c_str(), data.length());
375 source->GetResponseHeaders()->GetMimeType( 375 source->GetResponseHeaders()->GetMimeType(
376 &job_details_.print_data_mime_type_); 376 &job_details_.print_data_mime_type_);
377 DCHECK(ret == static_cast<int>(data.length())); 377 DCHECK(ret == static_cast<int>(data.length()));
378 if (ret == static_cast<int>(data.length())) { 378 if (ret == static_cast<int>(data.length())) {
379 UpdateJobStatus(PRINT_JOB_STATUS_IN_PROGRESS, JOB_SUCCESS); 379 UpdateJobStatus(PRINT_JOB_STATUS_IN_PROGRESS, JOB_SUCCESS);
380 return CloudPrintURLFetcher::STOP_PROCESSING; 380 return CloudPrintURLFetcher::STOP_PROCESSING;
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 job_details.print_data_mime_type_, 780 job_details.print_data_mime_type_,
781 printer_name, 781 printer_name,
782 UTF16ToUTF8(document_name), 782 UTF16ToUTF8(document_name),
783 job_details.tags_, 783 job_details.tags_,
784 this)) { 784 this)) {
785 OnJobSpoolFailed(); 785 OnJobSpoolFailed();
786 } 786 }
787 } 787 }
788 788
789 } // namespace cloud_print 789 } // namespace cloud_print
OLDNEW
« no previous file with comments | « chrome/renderer/printing/print_web_view_helper_browsertest.cc ('k') | chrome/service/service_utility_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698