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

Side by Side Diff: components/filesystem/file_impl.cc

Issue 1259253006: Reland of Enable C4018 globally for the GN build, and disable per-target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « build/config/compiler/BUILD.gn ('k') | third_party/leveldatabase/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/filesystem/file_impl.h" 5 #include "components/filesystem/file_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 const WriteCallback& callback) { 95 const WriteCallback& callback) {
96 DCHECK(!bytes_to_write.is_null()); 96 DCHECK(!bytes_to_write.is_null());
97 if (!file_.IsValid()) { 97 if (!file_.IsValid()) {
98 callback.Run(GetError(file_), 0); 98 callback.Run(GetError(file_), 0);
99 return; 99 return;
100 } 100 }
101 // Who knows what |write()| would return if the size is that big (and it 101 // Who knows what |write()| would return if the size is that big (and it
102 // actually wrote that much). 102 // actually wrote that much).
103 if (bytes_to_write.size() > 103 if (bytes_to_write.size() >
104 #if defined(OS_WIN) 104 #if defined(OS_WIN)
105 std::numeric_limits<INT>::max()) { 105 static_cast<size_t>(std::numeric_limits<int>::max())) {
106 #else 106 #else
107 static_cast<size_t>(std::numeric_limits<ssize_t>::max())) { 107 static_cast<size_t>(std::numeric_limits<ssize_t>::max())) {
108 #endif 108 #endif
109 callback.Run(FILE_ERROR_INVALID_OPERATION, 0); 109 callback.Run(FILE_ERROR_INVALID_OPERATION, 0);
110 return; 110 return;
111 } 111 }
112 if (FileError error = IsOffsetValid(offset)) { 112 if (FileError error = IsOffsetValid(offset)) {
113 callback.Run(error, 0); 113 callback.Run(error, 0);
114 return; 114 return;
115 } 115 }
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 new_file.TakePlatformFile(), &mojo_handle); 302 new_file.TakePlatformFile(), &mojo_handle);
303 if (create_result != MOJO_RESULT_OK) { 303 if (create_result != MOJO_RESULT_OK) {
304 callback.Run(FILE_ERROR_FAILED, ScopedHandle()); 304 callback.Run(FILE_ERROR_FAILED, ScopedHandle());
305 return; 305 return;
306 } 306 }
307 307
308 callback.Run(FILE_ERROR_OK, ScopedHandle(mojo::Handle(mojo_handle)).Pass()); 308 callback.Run(FILE_ERROR_OK, ScopedHandle(mojo::Handle(mojo_handle)).Pass());
309 } 309 }
310 310
311 } // namespace filesystem 311 } // namespace filesystem
OLDNEW
« no previous file with comments | « build/config/compiler/BUILD.gn ('k') | third_party/leveldatabase/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698