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

Side by Side Diff: ppapi/cpp/file_io.h

Issue 9381010: Convert resources to take an instance key instead of an Instance*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 8 years, 10 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_CPP_FILE_IO_H_ 5 #ifndef PPAPI_CPP_FILE_IO_H_
6 #define PPAPI_CPP_FILE_IO_H_ 6 #define PPAPI_CPP_FILE_IO_H_
7 7
8 #include "ppapi/c/pp_time.h" 8 #include "ppapi/c/pp_time.h"
9 #include "ppapi/cpp/resource.h" 9 #include "ppapi/cpp/resource.h"
10 10
11 /// @file 11 /// @file
12 /// This file defines the API to create a file i/o object. 12 /// This file defines the API to create a file i/o object.
13 13
14 struct PP_FileInfo; 14 struct PP_FileInfo;
15 15
16 namespace pp { 16 namespace pp {
17 17
18 class CompletionCallback; 18 class CompletionCallback;
19 class FileRef; 19 class FileRef;
20 class Instance; 20 class InstanceHandle;
21 21
22 /// The <code>FileIO</code> class represents a regular file. 22 /// The <code>FileIO</code> class represents a regular file.
23 class FileIO : public Resource { 23 class FileIO : public Resource {
24 public: 24 public:
25 /// Default constructor for creating an is_null() <code>FileIO</code> 25 /// Default constructor for creating an is_null() <code>FileIO</code>
26 /// object. 26 /// object.
27 FileIO(); 27 FileIO();
28 28
29 /// A constructor used to create a <code>FileIO</code> and associate it with 29 /// A constructor used to create a <code>FileIO</code> and associate it with
30 /// the provided <code>Instance</code>. 30 /// the provided <code>Instance</code>.
31 /// 31 ///
32 /// @param[in] instance An <code>Instance</code>. 32 /// @param[in] instance The instance with which this resource will be
33 FileIO(Instance* instance); 33 /// associated.
34 FileIO(const InstanceHandle& instance);
dmichael (off chromium) 2012/02/22 21:38:44 explicit
34 35
35 /// The copy constructor for <code>FileIO</code>. 36 /// The copy constructor for <code>FileIO</code>.
36 /// 37 ///
37 /// @param[in] other A pointer to a <code>FileIO</code>. 38 /// @param[in] other A pointer to a <code>FileIO</code>.
38 FileIO(const FileIO& other); 39 FileIO(const FileIO& other);
39 40
40 /// Open() opens the specified regular file for I/O according to the given 41 /// Open() opens the specified regular file for I/O according to the given
41 /// open flags, which is a bit-mask of the PP_FileOpenFlags values. Upon 42 /// open flags, which is a bit-mask of the PP_FileOpenFlags values. Upon
42 /// success, the corresponding file is classified as "in use" by this FileIO 43 /// success, the corresponding file is classified as "in use" by this FileIO
43 /// object until such time as the FileIO object is closed or destroyed. 44 /// object until such time as the FileIO object is closed or destroyed.
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 /// 151 ///
151 /// <strong>Note:</strong> If the FileIO object is destroyed, and it is still 152 /// <strong>Note:</strong> If the FileIO object is destroyed, and it is still
152 /// open, then it will be implicitly closed, so you are not required to call 153 /// open, then it will be implicitly closed, so you are not required to call
153 /// Close(). 154 /// Close().
154 void Close(); 155 void Close();
155 }; 156 };
156 157
157 } // namespace pp 158 } // namespace pp
158 159
159 #endif // PPAPI_CPP_FILE_IO_H_ 160 #endif // PPAPI_CPP_FILE_IO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698