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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/operations/write_file.h

Issue 442383002: Move storage-related files from webkit/ to new top-level directory storage/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_WRITE_FILE_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_WRITE_FILE_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_WRITE_FILE_H_ 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_WRITE_FILE_H_
7 7
8 #include "base/files/file.h" 8 #include "base/files/file.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/chromeos/file_system_provider/operations/operation.h" 11 #include "chrome/browser/chromeos/file_system_provider/operations/operation.h"
12 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info .h" 12 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info .h"
13 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h" 13 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h"
14 #include "chrome/browser/chromeos/file_system_provider/request_value.h" 14 #include "chrome/browser/chromeos/file_system_provider/request_value.h"
15 #include "net/base/io_buffer.h" 15 #include "net/base/io_buffer.h"
16 #include "webkit/browser/fileapi/async_file_util.h" 16 #include "storage/browser/fileapi/async_file_util.h"
17 17
18 namespace base { 18 namespace base {
19 class FilePath; 19 class FilePath;
20 } // namespace base 20 } // namespace base
21 21
22 namespace extensions { 22 namespace extensions {
23 class EventRouter; 23 class EventRouter;
24 } // namespace extensions 24 } // namespace extensions
25 25
26 namespace chromeos { 26 namespace chromeos {
27 namespace file_system_provider { 27 namespace file_system_provider {
28 namespace operations { 28 namespace operations {
29 29
30 // Bridge between fileapi write file and providing extension's write fil 30 // Bridge between fileapi write file and providing extension's write fil
31 // request. 31 // request.
32 // Created per request. 32 // Created per request.
33 class WriteFile : public Operation { 33 class WriteFile : public Operation {
34 public: 34 public:
35 WriteFile(extensions::EventRouter* event_router, 35 WriteFile(extensions::EventRouter* event_router,
36 const ProvidedFileSystemInfo& file_system_info, 36 const ProvidedFileSystemInfo& file_system_info,
37 int file_handle, 37 int file_handle,
38 scoped_refptr<net::IOBuffer> buffer, 38 scoped_refptr<net::IOBuffer> buffer,
39 int64 offset, 39 int64 offset,
40 int length, 40 int length,
41 const fileapi::AsyncFileUtil::StatusCallback& callback); 41 const storage::AsyncFileUtil::StatusCallback& callback);
42 virtual ~WriteFile(); 42 virtual ~WriteFile();
43 43
44 // Operation overrides. 44 // Operation overrides.
45 virtual bool Execute(int request_id) OVERRIDE; 45 virtual bool Execute(int request_id) OVERRIDE;
46 virtual void OnSuccess(int request_id, 46 virtual void OnSuccess(int request_id,
47 scoped_ptr<RequestValue> result, 47 scoped_ptr<RequestValue> result,
48 bool has_more) OVERRIDE; 48 bool has_more) OVERRIDE;
49 virtual void OnError(int request_id, 49 virtual void OnError(int request_id,
50 scoped_ptr<RequestValue> result, 50 scoped_ptr<RequestValue> result,
51 base::File::Error error) OVERRIDE; 51 base::File::Error error) OVERRIDE;
52 52
53 private: 53 private:
54 int file_handle_; 54 int file_handle_;
55 scoped_refptr<net::IOBuffer> buffer_; 55 scoped_refptr<net::IOBuffer> buffer_;
56 int64 offset_; 56 int64 offset_;
57 int length_; 57 int length_;
58 const fileapi::AsyncFileUtil::StatusCallback callback_; 58 const storage::AsyncFileUtil::StatusCallback callback_;
59 59
60 DISALLOW_COPY_AND_ASSIGN(WriteFile); 60 DISALLOW_COPY_AND_ASSIGN(WriteFile);
61 }; 61 };
62 62
63 } // namespace operations 63 } // namespace operations
64 } // namespace file_system_provider 64 } // namespace file_system_provider
65 } // namespace chromeos 65 } // namespace chromeos
66 66
67 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_WRITE_FILE_H_ 67 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_WRITE_FILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698