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

Side by Side Diff: net/base/file_stream_context_posix.cc

Issue 23500006: URLFetcher won't call delegate until file is closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mmenke's 3rd review Created 7 years, 3 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 | « net/base/file_stream_context.cc ('k') | net/base/file_stream_context_win.cc » ('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 (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 // For 64-bit file access (off_t = off64_t, lseek64, etc). 5 // For 64-bit file access (off_t = off64_t, lseek64, etc).
6 #define _FILE_OFFSET_BITS 64 6 #define _FILE_OFFSET_BITS 64
7 7
8 #include "net/base/file_stream_context.h" 8 #include "net/base/file_stream_context.h"
9 9
10 #include <errno.h> 10 #include <errno.h>
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 FileStream::Context::IOResult FileStream::Context::WriteFileImpl( 177 FileStream::Context::IOResult FileStream::Context::WriteFileImpl(
178 scoped_refptr<IOBuffer> buf, 178 scoped_refptr<IOBuffer> buf,
179 int buf_len) { 179 int buf_len) {
180 ssize_t res = HANDLE_EINTR(write(file_, buf->data(), buf_len)); 180 ssize_t res = HANDLE_EINTR(write(file_, buf->data(), buf_len));
181 if (res == -1) 181 if (res == -1)
182 return IOResult::FromOSError(errno); 182 return IOResult::FromOSError(errno);
183 183
184 return IOResult(res, 0); 184 return IOResult(res, 0);
185 } 185 }
186 186
187 FileStream::Context::IOResult FileStream::Context::CloseFileImpl() {
188 bool success = base::ClosePlatformFile(file_);
189 file_ = base::kInvalidPlatformFileValue;
190 if (!success)
191 return IOResult::FromOSError(errno);
192
193 return IOResult(OK, 0);
194 }
195
187 } // namespace net 196 } // namespace net
OLDNEW
« no previous file with comments | « net/base/file_stream_context.cc ('k') | net/base/file_stream_context_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698