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

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

Issue 492873002: Collapse fileapi, webkit_blob, webkit_database, quota, and webkit_common namespaces into single sto… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos build Created 6 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 | Annotate | Revision Log
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/file_writer_delegate.h" 5 #include "webkit/browser/fileapi/file_writer_delegate.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file_util_proxy.h" 9 #include "base/files/file_util_proxy.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/message_loop/message_loop_proxy.h" 11 #include "base/message_loop/message_loop_proxy.h"
12 #include "base/sequenced_task_runner.h" 12 #include "base/sequenced_task_runner.h"
13 #include "base/threading/thread_restrictions.h" 13 #include "base/threading/thread_restrictions.h"
14 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
15 #include "webkit/browser/fileapi/file_stream_writer.h" 15 #include "webkit/browser/fileapi/file_stream_writer.h"
16 #include "webkit/browser/fileapi/file_system_context.h" 16 #include "webkit/browser/fileapi/file_system_context.h"
17 #include "webkit/common/fileapi/file_system_util.h" 17 #include "webkit/common/fileapi/file_system_util.h"
18 18
19 namespace fileapi { 19 namespace storage {
20 20
21 static const int kReadBufSize = 32768; 21 static const int kReadBufSize = 32768;
22 22
23 FileWriterDelegate::FileWriterDelegate( 23 FileWriterDelegate::FileWriterDelegate(
24 scoped_ptr<FileStreamWriter> file_stream_writer, 24 scoped_ptr<FileStreamWriter> file_stream_writer,
25 FlushPolicy flush_policy) 25 FlushPolicy flush_policy)
26 : file_stream_writer_(file_stream_writer.Pass()), 26 : file_stream_writer_(file_stream_writer.Pass()),
27 writing_started_(false), 27 writing_started_(false),
28 flush_policy_(flush_policy), 28 flush_policy_(flush_policy),
29 bytes_written_backlog_(0), 29 bytes_written_backlog_(0),
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 int flush_error) { 234 int flush_error) {
235 if (error == base::File::FILE_OK && flush_error != net::OK) { 235 if (error == base::File::FILE_OK && flush_error != net::OK) {
236 // If the Flush introduced an error, overwrite the status. 236 // If the Flush introduced an error, overwrite the status.
237 // Otherwise, keep the original error status. 237 // Otherwise, keep the original error status.
238 error = NetErrorToFileError(flush_error); 238 error = NetErrorToFileError(flush_error);
239 progress_status = GetCompletionStatusOnError(); 239 progress_status = GetCompletionStatusOnError();
240 } 240 }
241 write_callback_.Run(error, bytes_written, progress_status); 241 write_callback_.Run(error, bytes_written, progress_status);
242 } 242 }
243 243
244 } // namespace fileapi 244 } // namespace storage
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/file_writer_delegate.h ('k') | webkit/browser/fileapi/isolated_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698