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

Side by Side Diff: webkit/plugins/ppapi/ppb_file_ref_impl.h

Issue 14784002: Move DirectoryReader::ReadEntries to FileRef::ReadDirectoryEntries (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: address comments by dmichael and raymes Created 7 years, 7 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
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_PLUGINS_PPAPI_PPB_FILE_REF_IMPL_H_ 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_FILE_REF_IMPL_H_
6 #define WEBKIT_PLUGINS_PPAPI_PPB_FILE_REF_IMPL_H_ 6 #define WEBKIT_PLUGINS_PPAPI_PPB_FILE_REF_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector>
9 10
10 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/memory/linked_ptr.h"
11 #include "googleurl/src/gurl.h" 13 #include "googleurl/src/gurl.h"
12 #include "ppapi/c/pp_file_info.h" 14 #include "ppapi/c/pp_file_info.h"
13 #include "ppapi/c/ppb_file_ref.h" 15 #include "ppapi/c/ppb_file_ref.h"
14 #include "ppapi/shared_impl/ppb_file_ref_shared.h" 16 #include "ppapi/shared_impl/ppb_file_ref_shared.h"
15 #include "ppapi/shared_impl/scoped_pp_resource.h" 17 #include "ppapi/shared_impl/scoped_pp_resource.h"
16 #include "ppapi/shared_impl/var.h" 18 #include "ppapi/shared_impl/var.h"
17 #include "webkit/glue/webkit_glue_export.h" 19 #include "webkit/glue/webkit_glue_export.h"
20 #include "webkit/plugins/ppapi/file_callbacks.h"
18 21
19 namespace webkit { 22 namespace webkit {
20 namespace ppapi { 23 namespace ppapi {
21 24
22 using ::ppapi::StringVar; 25 using ::ppapi::StringVar;
23 26
24 class PPB_FileSystem_Impl; 27 class PPB_FileSystem_Impl;
25 28
26 class WEBKIT_GLUE_EXPORT PPB_FileRef_Impl 29 class WEBKIT_GLUE_EXPORT PPB_FileRef_Impl
27 : public ::ppapi::PPB_FileRef_Shared { 30 : public ::ppapi::PPB_FileRef_Shared {
(...skipping 25 matching lines...) Expand all
53 PP_Time last_modified_time, 56 PP_Time last_modified_time,
54 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE; 57 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE;
55 virtual int32_t Delete( 58 virtual int32_t Delete(
56 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE; 59 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE;
57 virtual int32_t Rename( 60 virtual int32_t Rename(
58 PP_Resource new_file_ref, 61 PP_Resource new_file_ref,
59 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE; 62 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE;
60 virtual int32_t Query( 63 virtual int32_t Query(
61 PP_FileInfo* info, 64 PP_FileInfo* info,
62 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE; 65 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE;
66 virtual int32_t ReadDirectoryEntries(
67 const PP_ArrayOutput& output,
68 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE;
69 virtual int32_t QueryInHost(
70 linked_ptr<PP_FileInfo> info,
71 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE;
72 virtual int32_t ReadDirectoryEntriesInHost(
73 linked_ptr<std::vector< ::ppapi::PPB_FileRef_CreateInfo> > files,
74 linked_ptr<std::vector<PP_FileType> > file_types,
75 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE;
63 virtual PP_Var GetAbsolutePath(); 76 virtual PP_Var GetAbsolutePath();
64 77
65 PP_Resource file_system_resource() const { return file_system_; } 78 PP_Resource file_system_resource() const { return file_system_; }
66 79
67 // Returns the system path corresponding to this file. Valid only for 80 // Returns the system path corresponding to this file. Valid only for
68 // external filesystems. 81 // external filesystems.
69 base::FilePath GetSystemPath() const; 82 base::FilePath GetSystemPath() const;
70 83
71 // Returns the FileSystem API URL corresponding to this file. 84 // Returns the FileSystem API URL corresponding to this file.
72 GURL GetFileSystemURL() const; 85 GURL GetFileSystemURL() const;
73 86
74 // Checks if file ref has file system instance and if the instance is opened. 87 // Checks if file ref has file system instance and if the instance is opened.
75 bool HasValidFileSystem() const; 88 bool HasValidFileSystem() const;
76 89
77 void AddFileSystemRefCount() { 90 void AddFileSystemRefCount() {
78 file_system_ref_ = file_system_; 91 file_system_ref_ = file_system_;
79 } 92 }
80 93
81 private: 94 private:
95 virtual int32_t QueryImpl(
96 maybe_linked_ptr<PP_FileInfo> info,
97 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE;
98
82 // Many mutation functions are allow only to non-external filesystems, This 99 // Many mutation functions are allow only to non-external filesystems, This
83 // function returns true if the filesystem is opened and isn't external as an 100 // function returns true if the filesystem is opened and isn't external as an
84 // access check for these functions. 101 // access check for these functions.
85 bool IsValidNonExternalFileSystem() const; 102 bool IsValidNonExternalFileSystem() const;
86 103
87 // 0 for external filesystems. This is a plugin side resource that we don't 104 // 0 for external filesystems. This is a plugin side resource that we don't
88 // hold a reference here, so file_system_ could be destroyed earlier than 105 // hold a reference here, so file_system_ could be destroyed earlier than
89 // this object. Right now we checked the existance in plugin delegate before 106 // this object. Right now we checked the existance in plugin delegate before
90 // use. But it's better to hold a reference once we migrate FileRef to the 107 // use. But it's better to hold a reference once we migrate FileRef to the
91 // new design. 108 // new design.
(...skipping 14 matching lines...) Expand all
106 // return the identical string object every time it is requested. 123 // return the identical string object every time it is requested.
107 scoped_refptr<StringVar> external_path_var_; 124 scoped_refptr<StringVar> external_path_var_;
108 125
109 DISALLOW_COPY_AND_ASSIGN(PPB_FileRef_Impl); 126 DISALLOW_COPY_AND_ASSIGN(PPB_FileRef_Impl);
110 }; 127 };
111 128
112 } // namespace ppapi 129 } // namespace ppapi
113 } // namespace webkit 130 } // namespace webkit
114 131
115 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FILE_REF_IMPL_H_ 132 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FILE_REF_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698