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

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

Issue 206073006: Revert of Add a parameter to FileStreamWriter::CreateForLocalFile to allow creating new (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « webkit/browser/fileapi/local_file_stream_writer_unittest.cc ('k') | no next file » | 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 "webkit/browser/fileapi/sandbox_file_stream_writer.h" 5 #include "webkit/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/platform_file.h" 8 #include "base/platform_file.h"
9 #include "base/sequenced_task_runner.h" 9 #include "base/sequenced_task_runner.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 131 }
132 file_size_ = file_info.size; 132 file_size_ = file_info.size;
133 if (initial_offset_ > file_size_) { 133 if (initial_offset_ > file_size_) {
134 LOG(ERROR) << initial_offset_ << ", " << file_size_; 134 LOG(ERROR) << initial_offset_ << ", " << file_size_;
135 // This shouldn't happen as long as we check offset in the renderer. 135 // This shouldn't happen as long as we check offset in the renderer.
136 NOTREACHED(); 136 NOTREACHED();
137 initial_offset_ = file_size_; 137 initial_offset_ = file_size_;
138 } 138 }
139 DCHECK(!local_file_writer_.get()); 139 DCHECK(!local_file_writer_.get());
140 local_file_writer_.reset(FileStreamWriter::CreateForLocalFile( 140 local_file_writer_.reset(FileStreamWriter::CreateForLocalFile(
141 file_system_context_->default_file_task_runner(), 141 file_system_context_->default_file_task_runner(), platform_path,
142 platform_path, 142 initial_offset_));
143 initial_offset_,
144 FileStreamWriter::OPEN_EXISTING_FILE));
145 143
146 quota::QuotaManagerProxy* quota_manager_proxy = 144 quota::QuotaManagerProxy* quota_manager_proxy =
147 file_system_context_->quota_manager_proxy(); 145 file_system_context_->quota_manager_proxy();
148 if (!quota_manager_proxy) { 146 if (!quota_manager_proxy) {
149 // If we don't have the quota manager or the requested filesystem type 147 // If we don't have the quota manager or the requested filesystem type
150 // does not support quota, we should be able to let it go. 148 // does not support quota, we should be able to let it go.
151 allowed_bytes_to_write_ = default_quota_; 149 allowed_bytes_to_write_ = default_quota_;
152 callback.Run(net::OK); 150 callback.Run(net::OK);
153 return; 151 return;
154 } 152 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 DCHECK(cancel_callback_.is_null()); 236 DCHECK(cancel_callback_.is_null());
239 237
240 // Write() is not called yet, so there's nothing to flush. 238 // Write() is not called yet, so there's nothing to flush.
241 if (!local_file_writer_) 239 if (!local_file_writer_)
242 return net::OK; 240 return net::OK;
243 241
244 return local_file_writer_->Flush(callback); 242 return local_file_writer_->Flush(callback);
245 } 243 }
246 244
247 } // namespace fileapi 245 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/local_file_stream_writer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698