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

Side by Side Diff: base/files/file.cc

Issue 1103733002: Make unused InitializeUnsafe private and rename to DoInitialize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@less-base
Patch Set: based on topic branch Created 5 years, 8 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
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/files/file.h" 5 #include "base/files/file.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/timer/elapsed_timer.h" 8 #include "base/timer/elapsed_timer.h"
9 9
10 #if defined(OS_POSIX) 10 #if defined(OS_POSIX)
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 return *this; 82 return *this;
83 } 83 }
84 84
85 #if !defined(OS_NACL) 85 #if !defined(OS_NACL)
86 void File::Initialize(const FilePath& name, uint32 flags) { 86 void File::Initialize(const FilePath& name, uint32 flags) {
87 if (name.ReferencesParent()) { 87 if (name.ReferencesParent()) {
88 error_details_ = FILE_ERROR_ACCESS_DENIED; 88 error_details_ = FILE_ERROR_ACCESS_DENIED;
89 return; 89 return;
90 } 90 }
91 InitializeUnsafe(name, flags); 91 DoInitialize(name, flags);
92 } 92 }
93 #endif 93 #endif
94 94
95 std::string File::ErrorToString(Error error) { 95 std::string File::ErrorToString(Error error) {
96 switch (error) { 96 switch (error) {
97 case FILE_OK: 97 case FILE_OK:
98 return "FILE_OK"; 98 return "FILE_OK";
99 case FILE_ERROR_FAILED: 99 case FILE_ERROR_FAILED:
100 return "FILE_ERROR_FAILED"; 100 return "FILE_ERROR_FAILED";
101 case FILE_ERROR_IN_USE: 101 case FILE_ERROR_IN_USE:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 137 }
138 138
139 bool File::Flush() { 139 bool File::Flush() {
140 ElapsedTimer timer; 140 ElapsedTimer timer;
141 bool return_value = DoFlush(); 141 bool return_value = DoFlush();
142 UMA_HISTOGRAM_TIMES("PlatformFile.FlushTime", timer.Elapsed()); 142 UMA_HISTOGRAM_TIMES("PlatformFile.FlushTime", timer.Elapsed());
143 return return_value; 143 return return_value;
144 } 144 }
145 145
146 } // namespace base 146 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file.h ('k') | base/files/file_posix.cc » ('j') | base/files/file_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698