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

Unified Diff: webkit/fileapi/local_file_stream_writer.h

Issue 15859007: Move browser-specific FileAPI code from webkit/fileapi to webkit/browser/fileapi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dump_file_system build fix Created 7 years, 7 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/fileapi/file_writer_delegate_unittest.cc ('k') | webkit/fileapi/local_file_stream_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/local_file_stream_writer.h
diff --git a/webkit/fileapi/local_file_stream_writer.h b/webkit/fileapi/local_file_stream_writer.h
deleted file mode 100644
index b12c8ed259731b61bcc3c1162e25b7965f9cedcb..0000000000000000000000000000000000000000
--- a/webkit/fileapi/local_file_stream_writer.h
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright (c) 2012 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_FILEAPI_LOCAL_FILE_STREAM_WRITER_H_
-#define WEBKIT_FILEAPI_LOCAL_FILE_STREAM_WRITER_H_
-
-#include <utility>
-
-#include "base/callback.h"
-#include "base/compiler_specific.h"
-#include "base/files/file_path.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/memory/weak_ptr.h"
-#include "base/platform_file.h"
-#include "webkit/fileapi/file_stream_writer.h"
-#include "webkit/storage/webkit_storage_export.h"
-
-namespace net {
-class FileStream;
-}
-
-namespace fileapi {
-
-// This class is a thin wrapper around net::FileStream for writing local files.
-class WEBKIT_STORAGE_EXPORT_PRIVATE LocalFileStreamWriter
- : public FileStreamWriter {
- public:
- // Create a writer for the existing file in the path |file_path| starting from
- // |initial_offset|.
- LocalFileStreamWriter(const base::FilePath& file_path, int64 initial_offset);
- virtual ~LocalFileStreamWriter();
-
- // FileStreamWriter overrides.
- virtual int Write(net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) OVERRIDE;
- virtual int Cancel(const net::CompletionCallback& callback) OVERRIDE;
- virtual int Flush(const net::CompletionCallback& callback) OVERRIDE;
-
- private:
- // Opens |file_path_| and if it succeeds, proceeds to InitiateSeek().
- // If failed, the error code is returned by calling |error_callback|.
- int InitiateOpen(const net::CompletionCallback& error_callback,
- const base::Closure& main_operation);
- void DidOpen(const net::CompletionCallback& error_callback,
- const base::Closure& main_operation,
- int result);
-
- // Seeks to |initial_offset_| and proceeds to |main_operation| if it succeeds.
- // If failed, the error code is returned by calling |error_callback|.
- void InitiateSeek(const net::CompletionCallback& error_callback,
- const base::Closure& main_operation);
- void DidSeek(const net::CompletionCallback& error_callback,
- const base::Closure& main_operation,
- int64 result);
-
- // Passed as the |main_operation| of InitiateOpen() function.
- void ReadyToWrite(net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback);
-
- // Writes asynchronously to the file.
- int InitiateWrite(net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback);
- void DidWrite(const net::CompletionCallback& callback, int result);
-
- // Flushes asynchronously to the file.
- int InitiateFlush(const net::CompletionCallback& callback);
- void DidFlush(const net::CompletionCallback& callback, int result);
-
- // Stops the in-flight operation and calls |cancel_callback_| if it has been
- // set by Cancel() for the current operation.
- bool CancelIfRequested();
-
- // Initialization parameters.
- const base::FilePath file_path_;
- const int64 initial_offset_;
-
- // Current states of the operation.
- bool has_pending_operation_;
- scoped_ptr<net::FileStream> stream_impl_;
- net::CompletionCallback cancel_callback_;
-
- base::WeakPtrFactory<LocalFileStreamWriter> weak_factory_;
- DISALLOW_COPY_AND_ASSIGN(LocalFileStreamWriter);
-};
-
-} // namespace fileapi
-
-#endif // WEBKIT_FILEAPI_LOCAL_FILE_STREAM_WRITER_H_
« no previous file with comments | « webkit/fileapi/file_writer_delegate_unittest.cc ('k') | webkit/fileapi/local_file_stream_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698