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

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

Issue 942633004: IndexedDB: Fixed support for empty blobs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | storage/browser/blob/blob_data_builder.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 #include "net/base/file_stream_context.h" 5 #include "net/base/file_stream_context.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 int res = file_.ReadAtCurrentPosNoBestEffort(buf->data(), buf_len); 96 int res = file_.ReadAtCurrentPosNoBestEffort(buf->data(), buf_len);
97 if (res == -1) 97 if (res == -1)
98 return IOResult::FromOSError(errno); 98 return IOResult::FromOSError(errno);
99 99
100 return IOResult(res, 0); 100 return IOResult(res, 0);
101 } 101 }
102 102
103 FileStream::Context::IOResult FileStream::Context::WriteFileImpl( 103 FileStream::Context::IOResult FileStream::Context::WriteFileImpl(
104 scoped_refptr<IOBuffer> buf, 104 scoped_refptr<IOBuffer> buf,
105 int buf_len) { 105 int buf_len) {
106 if (buf_len == 0)
jsbell 2015/02/24 18:37:36 Can you explain why we need this special case? Doe
cmumford 2015/02/24 22:40:52 buf refers to a NULL IOBuffer in this case. So ope
jsbell 2015/02/25 00:10:30 Although you took a different approach, it is weir
107 return IOResult(0, 0);
106 int res = file_.WriteAtCurrentPosNoBestEffort(buf->data(), buf_len); 108 int res = file_.WriteAtCurrentPosNoBestEffort(buf->data(), buf_len);
107 if (res == -1) 109 if (res == -1)
108 return IOResult::FromOSError(errno); 110 return IOResult::FromOSError(errno);
109 111
110 return IOResult(res, 0); 112 return IOResult(res, 0);
111 } 113 }
112 114
113 } // namespace net 115 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | storage/browser/blob/blob_data_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698