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

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

Issue 1097393007: Update {virtual,override} to follow C++11 style in ppapi. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split off one file into separate review. Created 5 years, 8 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
« no previous file with comments | « ppapi/proxy/file_chooser_resource.h ('k') | ppapi/proxy/file_ref_resource.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 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 "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 12 matching lines...) Expand all
23 23
24 class TrackedCallback; 24 class TrackedCallback;
25 25
26 namespace proxy { 26 namespace proxy {
27 27
28 class PPAPI_PROXY_EXPORT FileIOResource 28 class PPAPI_PROXY_EXPORT FileIOResource
29 : public PluginResource, 29 : public PluginResource,
30 public thunk::PPB_FileIO_API { 30 public thunk::PPB_FileIO_API {
31 public: 31 public:
32 FileIOResource(Connection connection, PP_Instance instance); 32 FileIOResource(Connection connection, PP_Instance instance);
33 virtual ~FileIOResource(); 33 ~FileIOResource() override;
34 34
35 // Resource overrides. 35 // Resource overrides.
36 virtual thunk::PPB_FileIO_API* AsPPB_FileIO_API() override; 36 thunk::PPB_FileIO_API* AsPPB_FileIO_API() override;
37 37
38 // PPB_FileIO_API implementation. 38 // PPB_FileIO_API implementation.
39 virtual int32_t Open(PP_Resource file_ref, 39 int32_t Open(PP_Resource file_ref,
40 int32_t open_flags, 40 int32_t open_flags,
41 scoped_refptr<TrackedCallback> callback) override; 41 scoped_refptr<TrackedCallback> callback) override;
42 virtual int32_t Query(PP_FileInfo* info, 42 int32_t Query(PP_FileInfo* info,
43 scoped_refptr<TrackedCallback> callback) override; 43 scoped_refptr<TrackedCallback> callback) override;
44 virtual int32_t Touch(PP_Time last_access_time, 44 int32_t Touch(PP_Time last_access_time,
45 PP_Time last_modified_time, 45 PP_Time last_modified_time,
46 scoped_refptr<TrackedCallback> callback) override; 46 scoped_refptr<TrackedCallback> callback) override;
47 virtual int32_t Read(int64_t offset, 47 int32_t Read(int64_t offset,
48 char* buffer, 48 char* buffer,
49 int32_t bytes_to_read, 49 int32_t bytes_to_read,
50 scoped_refptr<TrackedCallback> callback) override; 50 scoped_refptr<TrackedCallback> callback) override;
51 virtual int32_t ReadToArray(int64_t offset, 51 int32_t ReadToArray(int64_t offset,
52 int32_t max_read_length, 52 int32_t max_read_length,
53 PP_ArrayOutput* array_output, 53 PP_ArrayOutput* array_output,
54 scoped_refptr<TrackedCallback> callback) override;
55 int32_t Write(int64_t offset,
56 const char* buffer,
57 int32_t bytes_to_write,
58 scoped_refptr<TrackedCallback> callback) override;
59 int32_t SetLength(int64_t length,
60 scoped_refptr<TrackedCallback> callback) override;
61 int64_t GetMaxWrittenOffset() const override;
62 int64_t GetAppendModeWriteAmount() const override;
63 void SetMaxWrittenOffset(int64_t max_written_offset) override;
64 void SetAppendModeWriteAmount(int64_t append_mode_write_amount) override;
65 int32_t Flush(scoped_refptr<TrackedCallback> callback) override;
66 void Close() override;
67 int32_t RequestOSFileHandle(PP_FileHandle* handle,
54 scoped_refptr<TrackedCallback> callback) override; 68 scoped_refptr<TrackedCallback> callback) override;
55 virtual int32_t Write(int64_t offset,
56 const char* buffer,
57 int32_t bytes_to_write,
58 scoped_refptr<TrackedCallback> callback) override;
59 virtual int32_t SetLength(int64_t length,
60 scoped_refptr<TrackedCallback> callback) override;
61 virtual int64_t GetMaxWrittenOffset() const override;
62 virtual int64_t GetAppendModeWriteAmount() const override;
63 virtual void SetMaxWrittenOffset(int64_t max_written_offset) override;
64 virtual void SetAppendModeWriteAmount(
65 int64_t append_mode_write_amount) override;
66 virtual int32_t Flush(scoped_refptr<TrackedCallback> callback) override;
67 virtual void Close() override;
68 virtual int32_t RequestOSFileHandle(
69 PP_FileHandle* handle,
70 scoped_refptr<TrackedCallback> callback) override;
71 69
72 // FileHolder is used to guarantee that file operations will have a valid FD 70 // FileHolder is used to guarantee that file operations will have a valid FD
73 // to operate on, even if they're in a different thread. 71 // to operate on, even if they're in a different thread.
74 // If instead we just passed the raw FD, the FD could be closed before the 72 // If instead we just passed the raw FD, the FD could be closed before the
75 // file operation has a chance to run. It could interact with an invalid FD, 73 // file operation has a chance to run. It could interact with an invalid FD,
76 // or worse, the FD value could be reused if another file is opened quickly 74 // or worse, the FD value could be reused if another file is opened quickly
77 // (POSIX is required to provide the lowest available value when opening a 75 // (POSIX is required to provide the lowest available value when opening a
78 // file). This could result in strange problems such as writing data to the 76 // file). This could result in strange problems such as writing data to the
79 // wrong file. 77 // wrong file.
80 // 78 //
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 bool check_quota_; 225 bool check_quota_;
228 bool called_close_; 226 bool called_close_;
229 227
230 DISALLOW_COPY_AND_ASSIGN(FileIOResource); 228 DISALLOW_COPY_AND_ASSIGN(FileIOResource);
231 }; 229 };
232 230
233 } // namespace proxy 231 } // namespace proxy
234 } // namespace ppapi 232 } // namespace ppapi
235 233
236 #endif // PPAPI_PROXY_FILE_IO_RESOURCE_H_ 234 #endif // PPAPI_PROXY_FILE_IO_RESOURCE_H_
OLDNEW
« no previous file with comments | « ppapi/proxy/file_chooser_resource.h ('k') | ppapi/proxy/file_ref_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698