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

Side by Side Diff: ppapi/proxy/file_ref_resource.cc

Issue 113363004: PPAPI: Add new PPB_FileRef.MakeDirectory to support exclusive operation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix Created 6 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "ppapi/proxy/file_ref_resource.h" 5 #include "ppapi/proxy/file_ref_resource.h"
6 6
7 #include "ppapi/c/pp_directory_entry.h" 7 #include "ppapi/c/pp_directory_entry.h"
8 #include "ppapi/c/pp_instance.h" 8 #include "ppapi/c/pp_instance.h"
9 #include "ppapi/c/pp_resource.h" 9 #include "ppapi/c/pp_resource.h"
10 #include "ppapi/proxy/ppapi_messages.h" 10 #include "ppapi/proxy/ppapi_messages.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 parent_info.display_name = GetNameForInternalFilePath(parent_path); 122 parent_info.display_name = GetNameForInternalFilePath(parent_path);
123 parent_info.file_system_plugin_resource = 123 parent_info.file_system_plugin_resource =
124 create_info_.file_system_plugin_resource; 124 create_info_.file_system_plugin_resource;
125 125
126 return (new FileRefResource(connection(), 126 return (new FileRefResource(connection(),
127 pp_instance(), 127 pp_instance(),
128 parent_info))->GetReference(); 128 parent_info))->GetReference();
129 } 129 }
130 130
131 int32_t FileRefResource::MakeDirectory( 131 int32_t FileRefResource::MakeDirectory(
132 PP_Bool exclusive,
132 PP_Bool make_ancestors, 133 PP_Bool make_ancestors,
133 scoped_refptr<TrackedCallback> callback) { 134 scoped_refptr<TrackedCallback> callback) {
134 Call<PpapiPluginMsg_FileRef_MakeDirectoryReply>( 135 Call<PpapiPluginMsg_FileRef_MakeDirectoryReply>(
135 BROWSER, 136 BROWSER,
136 PpapiHostMsg_FileRef_MakeDirectory(PP_TRUE == make_ancestors), 137 PpapiHostMsg_FileRef_MakeDirectory(
138 PP_TRUE == exclusive, PP_TRUE == make_ancestors),
137 base::Bind(&FileRefResource::RunTrackedCallback, this, callback)); 139 base::Bind(&FileRefResource::RunTrackedCallback, this, callback));
138 return PP_OK_COMPLETIONPENDING; 140 return PP_OK_COMPLETIONPENDING;
139 } 141 }
140 142
141 int32_t FileRefResource::Touch(PP_Time last_access_time, 143 int32_t FileRefResource::Touch(PP_Time last_access_time,
142 PP_Time last_modified_time, 144 PP_Time last_modified_time,
143 scoped_refptr<TrackedCallback> callback) { 145 scoped_refptr<TrackedCallback> callback) {
144 Call<PpapiPluginMsg_FileRef_TouchReply>( 146 Call<PpapiPluginMsg_FileRef_TouchReply>(
145 BROWSER, 147 BROWSER,
146 PpapiHostMsg_FileRef_Touch(last_access_time, 148 PpapiHostMsg_FileRef_Touch(last_access_time,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 entries.push_back(entry); 253 entries.push_back(entry);
252 } 254 }
253 255
254 writer.StoreVector(entries); 256 writer.StoreVector(entries);
255 } 257 }
256 callback->Run(params.result()); 258 callback->Run(params.result());
257 } 259 }
258 260
259 } // namespace proxy 261 } // namespace proxy
260 } // namespace ppapi 262 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698