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

Side by Side Diff: webkit/browser/fileapi/file_system_operation.h

Issue 33053002: Pepper: Move FileIO host from renderer to browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 1 month 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 | « ppapi/proxy/file_io_resource.cc ('k') | webkit/browser/fileapi/file_system_operation_impl.h » ('j') | 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 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_H_ 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_H_
6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_H_ 6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 typedef base::Callback< 73 typedef base::Callback<
74 void(base::PlatformFileError result, 74 void(base::PlatformFileError result,
75 const base::PlatformFileInfo& file_info)> GetMetadataCallback; 75 const base::PlatformFileInfo& file_info)> GetMetadataCallback;
76 76
77 // Used for OpenFile(). |result| is the return code of the operation. 77 // Used for OpenFile(). |result| is the return code of the operation.
78 // |on_close_callback| will be called after the file is closed in the child 78 // |on_close_callback| will be called after the file is closed in the child
79 // process. It can be null, if no operation is needed on closing a file. 79 // process. It can be null, if no operation is needed on closing a file.
80 typedef base::Callback< 80 typedef base::Callback<
81 void(base::PlatformFileError result, 81 void(base::PlatformFileError result,
82 base::PlatformFile file, 82 base::PlatformFile file,
83 const base::Closure& on_close_callback, 83 const base::Closure& on_close_callback)> OpenFileCallback;
84 base::ProcessHandle peer_handle)> OpenFileCallback;
85 84
86 // Used for ReadDirectoryCallback. 85 // Used for ReadDirectoryCallback.
87 typedef std::vector<DirectoryEntry> FileEntryList; 86 typedef std::vector<DirectoryEntry> FileEntryList;
88 87
89 // Used for ReadDirectory(). |result| is the return code of the operation, 88 // Used for ReadDirectory(). |result| is the return code of the operation,
90 // |file_list| is the list of files read, and |has_more| is true if some files 89 // |file_list| is the list of files read, and |has_more| is true if some files
91 // are yet to be read. 90 // are yet to be read.
92 typedef base::Callback< 91 typedef base::Callback<
93 void(base::PlatformFileError result, 92 void(base::PlatformFileError result,
94 const FileEntryList& file_list, 93 const FileEntryList& file_list,
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 // 347 //
349 // This function is used only by Pepper as of writing. 348 // This function is used only by Pepper as of writing.
350 virtual void TouchFile(const FileSystemURL& path, 349 virtual void TouchFile(const FileSystemURL& path,
351 const base::Time& last_access_time, 350 const base::Time& last_access_time,
352 const base::Time& last_modified_time, 351 const base::Time& last_modified_time,
353 const StatusCallback& callback) = 0; 352 const StatusCallback& callback) = 0;
354 353
355 // Opens a file at |path| with |file_flags|, where flags are OR'ed 354 // Opens a file at |path| with |file_flags|, where flags are OR'ed
356 // values of base::PlatformFileFlags. 355 // values of base::PlatformFileFlags.
357 // 356 //
358 // |peer_handle| is the process handle of a pepper plugin process, which
359 // is necessary for underlying IPC calls with Pepper plugins.
360 //
361 // This function is used only by Pepper as of writing. 357 // This function is used only by Pepper as of writing.
362 virtual void OpenFile(const FileSystemURL& path, 358 virtual void OpenFile(const FileSystemURL& path,
363 int file_flags, 359 int file_flags,
364 base::ProcessHandle peer_handle,
365 const OpenFileCallback& callback) = 0; 360 const OpenFileCallback& callback) = 0;
366 361
367 // Creates a local snapshot file for a given |path| and returns the 362 // Creates a local snapshot file for a given |path| and returns the
368 // metadata and platform path of the snapshot file via |callback|. 363 // metadata and platform path of the snapshot file via |callback|.
369 // In local filesystem cases the implementation may simply return 364 // In local filesystem cases the implementation may simply return
370 // the metadata of the file itself (as well as GetMetadata does), 365 // the metadata of the file itself (as well as GetMetadata does),
371 // while in remote filesystem case the backend may want to download the file 366 // while in remote filesystem case the backend may want to download the file
372 // into a temporary snapshot file and return the metadata of the 367 // into a temporary snapshot file and return the metadata of the
373 // temporary file. Or if the implementaiton already has the local cache 368 // temporary file. Or if the implementaiton already has the local cache
374 // data for |path| it can simply return the path to the cache. 369 // data for |path| it can simply return the path to the cache.
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 kOperationOpenFile, 477 kOperationOpenFile,
483 kOperationCloseFile, 478 kOperationCloseFile,
484 kOperationGetLocalPath, 479 kOperationGetLocalPath,
485 kOperationCancel, 480 kOperationCancel,
486 }; 481 };
487 }; 482 };
488 483
489 } // namespace fileapi 484 } // namespace fileapi
490 485
491 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_H_ 486 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_H_
OLDNEW
« no previous file with comments | « ppapi/proxy/file_io_resource.cc ('k') | webkit/browser/fileapi/file_system_operation_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698