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

Side by Side Diff: ppapi/proxy/file_io_resource.h

Issue 18063005: Do PPB_FileIO Query and Read in the plugin process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rethink - Just optimize the blocking callback case. Created 7 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 #ifndef PPAPI_PROXY_FILE_IO_RESOURCE_H_ 5 #ifndef PPAPI_PROXY_FILE_IO_RESOURCE_H_
6 #define PPAPI_PROXY_FILE_IO_RESOURCE_H_ 6 #define PPAPI_PROXY_FILE_IO_RESOURCE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "ppapi/c/private/pp_file_handle.h" 10 #include "ppapi/c/private/pp_file_handle.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 virtual int32_t WillSetLength( 65 virtual int32_t WillSetLength(
66 int64_t length, 66 int64_t length,
67 scoped_refptr<TrackedCallback> callback) OVERRIDE; 67 scoped_refptr<TrackedCallback> callback) OVERRIDE;
68 68
69 private: 69 private:
70 int32_t ReadValidated(int64_t offset, 70 int32_t ReadValidated(int64_t offset,
71 int32_t bytes_to_read, 71 int32_t bytes_to_read,
72 const PP_ArrayOutput& array_output, 72 const PP_ArrayOutput& array_output,
73 scoped_refptr<TrackedCallback> callback); 73 scoped_refptr<TrackedCallback> callback);
74 74
75 // Handlers of reply messages. Note that all of them have a callback 75 void CloseFileHandle();
76 // parameters bound when call to the host. 76
77 // Reply message handlers for operations that are done in the host.
77 void OnPluginMsgGeneralComplete(scoped_refptr<TrackedCallback> callback, 78 void OnPluginMsgGeneralComplete(scoped_refptr<TrackedCallback> callback,
78 const ResourceMessageReplyParams& params); 79 const ResourceMessageReplyParams& params);
79 void OnPluginMsgOpenFileComplete(scoped_refptr<TrackedCallback> callback, 80 void OnPluginMsgOpenFileComplete(scoped_refptr<TrackedCallback> callback,
80 const ResourceMessageReplyParams& params); 81 const ResourceMessageReplyParams& params);
81 void OnPluginMsgQueryComplete(scoped_refptr<TrackedCallback> callback, 82 void OnPluginMsgQueryComplete(scoped_refptr<TrackedCallback> callback,
82 PP_FileInfo* output_info_, 83 PP_FileInfo* output_info_,
83 const ResourceMessageReplyParams& params, 84 const ResourceMessageReplyParams& params,
84 const PP_FileInfo& info); 85 const PP_FileInfo& info);
85 void OnPluginMsgReadComplete(scoped_refptr<TrackedCallback> callback, 86 void OnPluginMsgReadComplete(scoped_refptr<TrackedCallback> callback,
86 PP_ArrayOutput array_output, 87 PP_ArrayOutput array_output,
87 const ResourceMessageReplyParams& params, 88 const ResourceMessageReplyParams& params,
88 const std::string& data); 89 const std::string& data);
89 void OnPluginMsgRequestOSFileHandleComplete( 90 void OnPluginMsgRequestOSFileHandleComplete(
90 scoped_refptr<TrackedCallback> callback, 91 scoped_refptr<TrackedCallback> callback,
91 PP_FileHandle* output_handle, 92 PP_FileHandle* output_handle,
92 const ResourceMessageReplyParams& params); 93 const ResourceMessageReplyParams& params);
93 94
95 PP_FileHandle file_handle_;
96 PP_FileSystemType file_system_type_;
94 FileIOStateManager state_manager_; 97 FileIOStateManager state_manager_;
95 98
96 DISALLOW_COPY_AND_ASSIGN(FileIOResource); 99 DISALLOW_COPY_AND_ASSIGN(FileIOResource);
97 }; 100 };
98 101
99 } // namespace proxy 102 } // namespace proxy
100 } // namespace ppapi 103 } // namespace ppapi
101 104
102 #endif // PPAPI_PROXY_FILE_IO_RESOURCE_H_ 105 #endif // PPAPI_PROXY_FILE_IO_RESOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698