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

Side by Side Diff: cloud_print/virtual_driver/win/port_monitor/port_monitor.cc

Issue 100573002: Move directory creation 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 "cloud_print/virtual_driver/win/port_monitor/port_monitor.h" 5 #include "cloud_print/virtual_driver/win/port_monitor/port_monitor.h"
6 6
7 #include <lmcons.h> 7 #include <lmcons.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 #include <shlobj.h> 9 #include <shlobj.h>
10 #include <strsafe.h> 10 #include <strsafe.h>
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 // It just means we can't get the job title or tell the spooler that 421 // It just means we can't get the job title or tell the spooler that
422 // the print job is complete. 422 // the print job is complete.
423 // This is the normal flow during a unit test. 423 // This is the normal flow during a unit test.
424 port_data->printer_handle = NULL; 424 port_data->printer_handle = NULL;
425 } 425 }
426 base::FilePath& file_path = port_data->file_path; 426 base::FilePath& file_path = port_data->file_path;
427 base::FilePath app_data_dir = GetAppDataDir(); 427 base::FilePath app_data_dir = GetAppDataDir();
428 if (app_data_dir.empty()) 428 if (app_data_dir.empty())
429 return FALSE; 429 return FALSE;
430 DeleteLeakedFiles(app_data_dir); 430 DeleteLeakedFiles(app_data_dir);
431 if (!file_util::CreateDirectory(app_data_dir) || 431 if (!base::CreateDirectory(app_data_dir) ||
432 !base::CreateTemporaryFileInDir(app_data_dir, &file_path)) { 432 !base::CreateTemporaryFileInDir(app_data_dir, &file_path)) {
433 LOG(ERROR) << "Can't create temporary file in " << app_data_dir.value(); 433 LOG(ERROR) << "Can't create temporary file in " << app_data_dir.value();
434 return FALSE; 434 return FALSE;
435 } 435 }
436 port_data->file = file_util::OpenFile(file_path, "wb+"); 436 port_data->file = file_util::OpenFile(file_path, "wb+");
437 if (port_data->file == NULL) { 437 if (port_data->file == NULL) {
438 LOG(ERROR) << "Error opening file " << file_path.value() << "."; 438 LOG(ERROR) << "Error opening file " << file_path.value() << ".";
439 return FALSE; 439 return FALSE;
440 } 440 }
441 return TRUE; 441 return TRUE;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 // Single spooler.exe handles verbose users. 622 // Single spooler.exe handles verbose users.
623 PathService::DisableCache(); 623 PathService::DisableCache();
624 } 624 }
625 return &cloud_print::g_monitor_2; 625 return &cloud_print::g_monitor_2;
626 } 626 }
627 627
628 MONITORUI* WINAPI InitializePrintMonitorUI(void) { 628 MONITORUI* WINAPI InitializePrintMonitorUI(void) {
629 return &cloud_print::g_monitor_ui; 629 return &cloud_print::g_monitor_ui;
630 } 630 }
631 631
OLDNEW
« no previous file with comments | « cloud_print/service/win/service_listener.cc ('k') | cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698