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

Side by Side Diff: base/test/test_file_util_win.cc

Issue 1368293009: Fix -Wunused-const-variable warning in Win-Clang build (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | no next file » | 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 "base/test/test_file_util.h" 5 #include "base/test/test_file_util.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <aclapi.h> 8 #include <aclapi.h>
9 #include <shlwapi.h> 9 #include <shlwapi.h>
10 10
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/files/file_util.h" 14 #include "base/files/file_util.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "base/strings/string_split.h" 16 #include "base/strings/string_split.h"
17 #include "base/threading/platform_thread.h" 17 #include "base/threading/platform_thread.h"
18 #include "base/win/scoped_handle.h" 18 #include "base/win/scoped_handle.h"
19 19
20 namespace base { 20 namespace base {
21 21
22 static const ptrdiff_t kOneMB = 1024 * 1024;
23
24 namespace { 22 namespace {
25 23
26 struct PermissionInfo { 24 struct PermissionInfo {
27 PSECURITY_DESCRIPTOR security_descriptor; 25 PSECURITY_DESCRIPTOR security_descriptor;
28 ACL dacl; 26 ACL dacl;
29 }; 27 };
30 28
31 // Deny |permission| on the file |path|, for the current user. 29 // Deny |permission| on the file |path|, for the current user.
32 bool DenyFilePermission(const FilePath& path, DWORD permission) { 30 bool DenyFilePermission(const FilePath& path, DWORD permission) {
33 PACL old_dacl; 31 PACL old_dacl;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 DCHECK(info_ != NULL); 205 DCHECK(info_ != NULL);
208 DCHECK_NE(0u, length_); 206 DCHECK_NE(0u, length_);
209 } 207 }
210 208
211 FilePermissionRestorer::~FilePermissionRestorer() { 209 FilePermissionRestorer::~FilePermissionRestorer() {
212 if (!RestorePermissionInfo(path_, info_, length_)) 210 if (!RestorePermissionInfo(path_, info_, length_))
213 NOTREACHED(); 211 NOTREACHED();
214 } 212 }
215 213
216 } // namespace base 214 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698