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

Side by Side Diff: content/browser/renderer_host/pepper/pepper_file_ref_host.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 "content/browser/renderer_host/pepper/pepper_file_ref_host.h" 5 #include "content/browser/renderer_host/pepper/pepper_file_ref_host.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "content/browser/renderer_host/pepper/pepper_external_file_ref_backend. h" 9 #include "content/browser/renderer_host/pepper/pepper_external_file_ref_backend. h"
10 #include "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h " 10 #include "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h "
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 OnReadDirectoryEntries); 173 OnReadDirectoryEntries);
174 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_FileRef_GetAbsolutePath, 174 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_FileRef_GetAbsolutePath,
175 OnGetAbsolutePath); 175 OnGetAbsolutePath);
176 176
177 IPC_END_MESSAGE_MAP() 177 IPC_END_MESSAGE_MAP()
178 return PP_ERROR_FAILED; 178 return PP_ERROR_FAILED;
179 } 179 }
180 180
181 int32_t PepperFileRefHost::OnMakeDirectory( 181 int32_t PepperFileRefHost::OnMakeDirectory(
182 ppapi::host::HostMessageContext* context, 182 ppapi::host::HostMessageContext* context,
183 bool exclusive,
183 bool make_ancestors) { 184 bool make_ancestors) {
184 int32_t rv = CanCreate(); 185 int32_t rv = CanCreate();
185 if (rv != PP_OK) 186 if (rv != PP_OK)
186 return rv; 187 return rv;
187 return backend_->MakeDirectory(context->MakeReplyMessageContext(), 188 return backend_->MakeDirectory(context->MakeReplyMessageContext(),
188 make_ancestors); 189 exclusive, make_ancestors);
189 } 190 }
190 191
191 int32_t PepperFileRefHost::OnTouch(ppapi::host::HostMessageContext* context, 192 int32_t PepperFileRefHost::OnTouch(ppapi::host::HostMessageContext* context,
192 PP_Time last_access_time, 193 PP_Time last_access_time,
193 PP_Time last_modified_time) { 194 PP_Time last_modified_time) {
194 // TODO(teravest): Change this to be kWriteFilePermissions here and in 195 // TODO(teravest): Change this to be kWriteFilePermissions here and in
195 // fileapi_message_filter. 196 // fileapi_message_filter.
196 int32_t rv = CanCreate(); 197 int32_t rv = CanCreate();
197 if (rv != PP_OK) 198 if (rv != PP_OK)
198 return rv; 199 return rv;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 251
251 int32_t PepperFileRefHost::OnGetAbsolutePath( 252 int32_t PepperFileRefHost::OnGetAbsolutePath(
252 ppapi::host::HostMessageContext* context) { 253 ppapi::host::HostMessageContext* context) {
253 if (!host_->GetPpapiHost()->permissions().HasPermission( 254 if (!host_->GetPpapiHost()->permissions().HasPermission(
254 ppapi::PERMISSION_PRIVATE)) 255 ppapi::PERMISSION_PRIVATE))
255 return PP_ERROR_NOACCESS; 256 return PP_ERROR_NOACCESS;
256 return backend_->GetAbsolutePath(context->MakeReplyMessageContext()); 257 return backend_->GetAbsolutePath(context->MakeReplyMessageContext());
257 } 258 }
258 259
259 } // namespace content 260 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698