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

Side by Side Diff: base/file_util_win.cc

Issue 6660001: Getting service process on Mac to handle having things moved/changed underneath it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed up phajdan's comments, got things working properly Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/file_util.h" 5 #include "base/file_util.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <propvarutil.h> 8 #include <propvarutil.h>
9 #include <psapi.h> 9 #include <psapi.h>
10 #include <shellapi.h> 10 #include <shellapi.h>
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 } else { 673 } else {
674 LOG(WARNING) << "Failed to create directory " << full_path_str 674 LOG(WARNING) << "Failed to create directory " << full_path_str
675 << ", last error is " << error_code << "."; 675 << ", last error is " << error_code << ".";
676 return false; 676 return false;
677 } 677 }
678 } else { 678 } else {
679 return true; 679 return true;
680 } 680 }
681 } 681 }
682 682
683 bool AreReferringToSameObject(const FilePath& a, const FilePath& b) {
684 FilePath normal_a;
685 FilePath normal_b;
686 if (file_util::NormalizeFilePath(a, &normal_a)) {
687 if (file_util::NormalizeFilePath(b, &normal_b)) {
688 return normal_a == normal_b;
689 }
690 }
691 return false;
692 }
693
683 bool GetFileInfo(const FilePath& file_path, base::PlatformFileInfo* results) { 694 bool GetFileInfo(const FilePath& file_path, base::PlatformFileInfo* results) {
684 base::ThreadRestrictions::AssertIOAllowed(); 695 base::ThreadRestrictions::AssertIOAllowed();
685 696
686 WIN32_FILE_ATTRIBUTE_DATA attr; 697 WIN32_FILE_ATTRIBUTE_DATA attr;
687 if (!GetFileAttributesEx(file_path.value().c_str(), 698 if (!GetFileAttributesEx(file_path.value().c_str(),
688 GetFileExInfoStandard, &attr)) { 699 GetFileExInfoStandard, &attr)) {
689 return false; 700 return false;
690 } 701 }
691 702
692 ULARGE_INTEGER size; 703 ULARGE_INTEGER size;
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 uint8 unused = *(touch + offset); 1152 uint8 unused = *(touch + offset);
1142 offset += step_size; 1153 offset += step_size;
1143 } 1154 }
1144 FreeLibrary(dll_module); 1155 FreeLibrary(dll_module);
1145 } 1156 }
1146 1157
1147 return true; 1158 return true;
1148 } 1159 }
1149 1160
1150 } // namespace file_util 1161 } // namespace file_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698