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

Side by Side Diff: base/file_util_win.cc

Issue 7085005: Disallow links from being seen by the extensions via the fileapi. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change fileapi to use IsLink on all platforms. Created 9 years, 6 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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 } else { 695 } else {
696 LOG(WARNING) << "Failed to create directory " << full_path_str 696 LOG(WARNING) << "Failed to create directory " << full_path_str
697 << ", last error is " << error_code << "."; 697 << ", last error is " << error_code << ".";
698 return false; 698 return false;
699 } 699 }
700 } else { 700 } else {
701 return true; 701 return true;
702 } 702 }
703 } 703 }
704 704
705 // No symlinks on windows
Evan Martin 2011/05/31 21:22:32 This isn't quite true -- NTFS supports junctions:
rkc 2011/05/31 21:49:56 Done. On 2011/05/31 21:22:32, Evan Martin wrote:
706 bool IsLink(const FilePath& file_path) {
707 return false;
708 }
709
705 bool GetFileInfo(const FilePath& file_path, base::PlatformFileInfo* results) { 710 bool GetFileInfo(const FilePath& file_path, base::PlatformFileInfo* results) {
706 base::ThreadRestrictions::AssertIOAllowed(); 711 base::ThreadRestrictions::AssertIOAllowed();
707 712
708 WIN32_FILE_ATTRIBUTE_DATA attr; 713 WIN32_FILE_ATTRIBUTE_DATA attr;
709 if (!GetFileAttributesEx(file_path.value().c_str(), 714 if (!GetFileAttributesEx(file_path.value().c_str(),
710 GetFileExInfoStandard, &attr)) { 715 GetFileExInfoStandard, &attr)) {
711 return false; 716 return false;
712 } 717 }
713 718
714 ULARGE_INTEGER size; 719 ULARGE_INTEGER size;
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 uint8 unused = *(touch + offset); 1167 uint8 unused = *(touch + offset);
1163 offset += step_size; 1168 offset += step_size;
1164 } 1169 }
1165 FreeLibrary(dll_module); 1170 FreeLibrary(dll_module);
1166 } 1171 }
1167 1172
1168 return true; 1173 return true;
1169 } 1174 }
1170 1175
1171 } // namespace file_util 1176 } // namespace file_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698