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

Side by Side Diff: storage/browser/fileapi/sandbox_file_stream_writer.cc

Issue 1159553007: Move Tuple to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 | « storage/browser/fileapi/obfuscated_file_util.cc ('k') | testing/generate_gmock_mutant.py » ('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 "storage/browser/fileapi/sandbox_file_stream_writer.h" 5 #include "storage/browser/fileapi/sandbox_file_stream_writer.h"
6 6
7 #include "base/files/file_util_proxy.h" 7 #include "base/files/file_util_proxy.h"
8 #include "base/sequenced_task_runner.h" 8 #include "base/sequenced_task_runner.h"
9 #include "net/base/io_buffer.h" 9 #include "net/base/io_buffer.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 return; 205 return;
206 callback.Run(write_response); 206 callback.Run(write_response);
207 return; 207 return;
208 } 208 }
209 209
210 if (total_bytes_written_ + write_response + initial_offset_ > file_size_) { 210 if (total_bytes_written_ + write_response + initial_offset_ > file_size_) {
211 int overlapped = file_size_ - total_bytes_written_ - initial_offset_; 211 int overlapped = file_size_ - total_bytes_written_ - initial_offset_;
212 if (overlapped < 0) 212 if (overlapped < 0)
213 overlapped = 0; 213 overlapped = 0;
214 observers_.Notify(&FileUpdateObserver::OnUpdate, 214 observers_.Notify(&FileUpdateObserver::OnUpdate,
215 MakeTuple(url_, write_response - overlapped)); 215 base::MakeTuple(url_, write_response - overlapped));
216 } 216 }
217 total_bytes_written_ += write_response; 217 total_bytes_written_ += write_response;
218 218
219 if (CancelIfRequested()) 219 if (CancelIfRequested())
220 return; 220 return;
221 callback.Run(write_response); 221 callback.Run(write_response);
222 } 222 }
223 223
224 bool SandboxFileStreamWriter::CancelIfRequested() { 224 bool SandboxFileStreamWriter::CancelIfRequested() {
225 if (cancel_callback_.is_null()) 225 if (cancel_callback_.is_null())
(...skipping 11 matching lines...) Expand all
237 DCHECK(cancel_callback_.is_null()); 237 DCHECK(cancel_callback_.is_null());
238 238
239 // Write() is not called yet, so there's nothing to flush. 239 // Write() is not called yet, so there's nothing to flush.
240 if (!local_file_writer_) 240 if (!local_file_writer_)
241 return net::OK; 241 return net::OK;
242 242
243 return local_file_writer_->Flush(callback); 243 return local_file_writer_->Flush(callback);
244 } 244 }
245 245
246 } // namespace storage 246 } // namespace storage
OLDNEW
« no previous file with comments | « storage/browser/fileapi/obfuscated_file_util.cc ('k') | testing/generate_gmock_mutant.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698