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

Side by Side Diff: printing/backend/cups_helper.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | printing/image.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "printing/backend/cups_helper.h" 5 #include "printing/backend/cups_helper.h"
6 6
7 #include <cups/ppd.h> 7 #include <cups/ppd.h>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 338
339 bool ParsePpdCapabilities( 339 bool ParsePpdCapabilities(
340 const std::string& printer_name, 340 const std::string& printer_name,
341 const std::string& printer_capabilities, 341 const std::string& printer_capabilities,
342 PrinterSemanticCapsAndDefaults* printer_info) { 342 PrinterSemanticCapsAndDefaults* printer_info) {
343 base::FilePath ppd_file_path; 343 base::FilePath ppd_file_path;
344 if (!base::CreateTemporaryFile(&ppd_file_path)) 344 if (!base::CreateTemporaryFile(&ppd_file_path))
345 return false; 345 return false;
346 346
347 int data_size = printer_capabilities.length(); 347 int data_size = printer_capabilities.length();
348 if (data_size != file_util::WriteFile( 348 if (data_size != base::WriteFile(
349 ppd_file_path, 349 ppd_file_path,
350 printer_capabilities.data(), 350 printer_capabilities.data(),
351 data_size)) { 351 data_size)) {
352 base::DeleteFile(ppd_file_path, false); 352 base::DeleteFile(ppd_file_path, false);
353 return false; 353 return false;
354 } 354 }
355 355
356 ppd_file_t* ppd = ppdOpenFile(ppd_file_path.value().c_str()); 356 ppd_file_t* ppd = ppdOpenFile(ppd_file_path.value().c_str());
357 if (!ppd) 357 if (!ppd)
358 return false; 358 return false;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 caps.bw_model = cm_black; 390 caps.bw_model = cm_black;
391 391
392 ppdClose(ppd); 392 ppdClose(ppd);
393 base::DeleteFile(ppd_file_path, false); 393 base::DeleteFile(ppd_file_path, false);
394 394
395 *printer_info = caps; 395 *printer_info = caps;
396 return true; 396 return true;
397 } 397 }
398 398
399 } // namespace printing 399 } // namespace printing
OLDNEW
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | printing/image.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698