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

Unified Diff: webkit/browser/fileapi/file_stream_writer.h

Issue 539143002: Migrate webkit/browser/ to storage/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android build Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/browser/fileapi/file_permission_policy.h ('k') | webkit/browser/fileapi/file_system_backend.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/browser/fileapi/file_stream_writer.h
diff --git a/webkit/browser/fileapi/file_stream_writer.h b/webkit/browser/fileapi/file_stream_writer.h
index d2467b392726b4bb9a4723a0af85566e4b98e63e..9a6e6f3457f55fb85b6f23b4e692a7876eeeda25 100644
--- a/webkit/browser/fileapi/file_stream_writer.h
+++ b/webkit/browser/fileapi/file_stream_writer.h
@@ -1,87 +1,5 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef WEBKIT_BROWSER_FILEAPI_FILE_STREAM_WRITER_H_
-#define WEBKIT_BROWSER_FILEAPI_FILE_STREAM_WRITER_H_
-
-#include "base/basictypes.h"
-#include "net/base/completion_callback.h"
-#include "webkit/browser/storage_browser_export.h"
-
-namespace base {
-class FilePath;
-class TaskRunner;
-}
-
-namespace net {
-class IOBuffer;
-}
-
-namespace storage {
-
-// A generic interface for writing to a file-like object.
-class FileStreamWriter {
- public:
- enum OpenOrCreate { OPEN_EXISTING_FILE, CREATE_NEW_FILE };
-
- // Creates a writer for the existing file in the path |file_path| starting
- // from |initial_offset|. Uses |task_runner| for async file operations.
- STORAGE_EXPORT static FileStreamWriter* CreateForLocalFile(
- base::TaskRunner* task_runner,
- const base::FilePath& file_path,
- int64 initial_offset,
- OpenOrCreate open_or_create);
-
- // Closes the file. If there's an in-flight operation, it is canceled (i.e.,
- // the callback function associated with the operation is not called).
- virtual ~FileStreamWriter() {}
-
- // Writes to the current cursor position asynchronously.
- //
- // Up to buf_len bytes will be written. (In other words, partial
- // writes are allowed.) If the write completed synchronously, it returns
- // the number of bytes written. If the operation could not be performed, it
- // returns an error code. Otherwise, net::ERR_IO_PENDING is returned, and the
- // callback will be run on the thread where Write() was called when the write
- // has completed.
- //
- // This errors out (either synchronously or via callback) with:
- // net::ERR_FILE_NOT_FOUND: When the target file is not found.
- // net::ERR_ACCESS_DENIED: When the target file is a directory or
- // the writer has no permission on the file.
- // net::ERR_FILE_NO_SPACE: When the write will result in out of quota
- // or there is not enough room left on the disk.
- //
- // It is invalid to call Write while there is an in-flight async operation.
- virtual int Write(net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) = 0;
-
- // Cancels an in-flight async operation.
- //
- // If the cancel is finished synchronously, it returns net::OK. If the
- // cancel could not be performed, it returns an error code. Especially when
- // there is no in-flight operation, net::ERR_UNEXPECTED is returned.
- // Otherwise, net::ERR_IO_PENDING is returned, and the callback will be run on
- // the thread where Cancel() was called when the cancel has completed. It is
- // invalid to call Cancel() more than once on the same async operation.
- //
- // In either case, the callback function passed to the in-flight async
- // operation is dismissed immediately when Cancel() is called, and thus
- // will never be called.
- virtual int Cancel(const net::CompletionCallback& callback) = 0;
-
- // Flushes the data written so far.
- //
- // If the flush finished synchronously, it return net::OK. If the flush could
- // not be performed, it returns an error code. Otherwise, net::ERR_IO_PENDING
- // is returned, and the callback will be run on the thread where Flush() was
- // called when the flush has completed.
- //
- // It is invalid to call Flush while there is an in-flight async operation.
- virtual int Flush(const net::CompletionCallback& callback) = 0;
-};
-
-} // namespace storage
-
-#endif // WEBKIT_BROWSER_FILEAPI_FILE_STREAM_WRITER_H_
+#include "storage/browser/fileapi/file_stream_writer.h"
« no previous file with comments | « webkit/browser/fileapi/file_permission_policy.h ('k') | webkit/browser/fileapi/file_system_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698