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

Side by Side Diff: cloud_print/service/win/chrome_launcher.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
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 "cloud_print/service/win/chrome_launcher.h" 5 #include "cloud_print/service/win/chrome_launcher.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 LOG(ERROR) << "Can't find Chrome."; 285 LOG(ERROR) << "Can't find Chrome.";
286 return result; 286 return result;
287 } 287 }
288 288
289 base::FilePath printers_file = temp_user_data.path().Append(L"printers.json"); 289 base::FilePath printers_file = temp_user_data.path().Append(L"printers.json");
290 290
291 base::ListValue printer_list; 291 base::ListValue printer_list;
292 printer_list.AppendStrings(printers); 292 printer_list.AppendStrings(printers);
293 std::string printers_json; 293 std::string printers_json;
294 base::JSONWriter::Write(&printer_list, &printers_json); 294 base::JSONWriter::Write(&printer_list, &printers_json);
295 size_t written = file_util::WriteFile(printers_file, 295 size_t written = base::WriteFile(printers_file,
296 printers_json.c_str(), 296 printers_json.c_str(),
297 printers_json.size()); 297 printers_json.size());
298 if (written != printers_json.size()) { 298 if (written != printers_json.size()) {
299 LOG(ERROR) << "Can't write file."; 299 LOG(ERROR) << "Can't write file.";
300 return result; 300 return result;
301 } 301 }
302 302
303 CommandLine cmd(chrome_path); 303 CommandLine cmd(chrome_path);
304 CopyChromeSwitchesFromCurrentProcess(&cmd); 304 CopyChromeSwitchesFromCurrentProcess(&cmd);
305 cmd.AppendSwitchPath(switches::kUserDataDir, temp_user_data.path()); 305 cmd.AppendSwitchPath(switches::kUserDataDir, temp_user_data.path());
306 cmd.AppendSwitchPath(switches::kCloudPrintSetupProxy, printers_file); 306 cmd.AppendSwitchPath(switches::kCloudPrintSetupProxy, printers_file);
307 cmd.AppendSwitch(switches::kNoServiceAutorun); 307 cmd.AppendSwitch(switches::kNoServiceAutorun);
(...skipping 30 matching lines...) Expand all
338 } 338 }
339 } else { 339 } else {
340 LOG(ERROR) << "Chrome launch failed."; 340 LOG(ERROR) << "Chrome launch failed.";
341 return result; 341 return result;
342 } 342 }
343 } 343 }
344 NOTREACHED(); 344 NOTREACHED();
345 return std::string(); 345 return std::string();
346 } 346 }
347 347
OLDNEW
« no previous file with comments | « cloud_print/gcp20/prototype/printer_state.cc ('k') | cloud_print/service/win/cloud_print_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698