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

Side by Side Diff: content/child/fileapi/file_system_dispatcher.cc

Issue 23760004: ChildProcessSecurityPolicy: Port FileAPIMessageFilter to use new checks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: apply kinuko suggestions on reducing sloc bloat Created 7 years, 3 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 #include "content/child/fileapi/file_system_dispatcher.h" 5 #include "content/child/fileapi/file_system_dispatcher.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/process/process.h" 10 #include "base/process/process.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 const GURL& path, 300 const GURL& path,
301 const base::Time& last_access_time, 301 const base::Time& last_access_time,
302 const base::Time& last_modified_time, 302 const base::Time& last_modified_time,
303 const StatusCallback& callback) { 303 const StatusCallback& callback) {
304 int request_id = dispatchers_.Add(CallbackDispatcher::Create(callback)); 304 int request_id = dispatchers_.Add(CallbackDispatcher::Create(callback));
305 ChildThread::current()->Send( 305 ChildThread::current()->Send(
306 new FileSystemHostMsg_TouchFile( 306 new FileSystemHostMsg_TouchFile(
307 request_id, path, last_access_time, last_modified_time)); 307 request_id, path, last_access_time, last_modified_time));
308 } 308 }
309 309
310 void FileSystemDispatcher::OpenFile( 310 void FileSystemDispatcher::OpenPepperFile(
311 const GURL& file_path, 311 const GURL& file_path,
312 int file_flags, 312 int pp_open_flags,
313 const OpenFileCallback& success_callback, 313 const OpenFileCallback& success_callback,
314 const StatusCallback& error_callback) { 314 const StatusCallback& error_callback) {
315 int request_id = dispatchers_.Add( 315 int request_id = dispatchers_.Add(
316 CallbackDispatcher::Create(success_callback, error_callback)); 316 CallbackDispatcher::Create(success_callback, error_callback));
317 ChildThread::current()->Send( 317 ChildThread::current()->Send(
318 new FileSystemHostMsg_OpenFile( 318 new FileSystemHostMsg_OpenPepperFile(
319 request_id, file_path, file_flags)); 319 request_id, file_path, pp_open_flags));
320 } 320 }
321 321
322 void FileSystemDispatcher::NotifyCloseFile(int file_open_id) { 322 void FileSystemDispatcher::NotifyCloseFile(int file_open_id) {
323 ChildThread::current()->Send( 323 ChildThread::current()->Send(
324 new FileSystemHostMsg_NotifyCloseFile(file_open_id)); 324 new FileSystemHostMsg_NotifyCloseFile(file_open_id));
325 } 325 }
326 326
327 void FileSystemDispatcher::CreateSnapshotFile( 327 void FileSystemDispatcher::CreateSnapshotFile(
328 const GURL& file_path, 328 const GURL& file_path,
329 const CreateSnapshotFileCallback& success_callback, 329 const CreateSnapshotFileCallback& success_callback,
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 quota::QuotaLimitType quota_policy) { 403 quota::QuotaLimitType quota_policy) {
404 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); 404 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id);
405 DCHECK(dispatcher); 405 DCHECK(dispatcher);
406 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file), 406 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file),
407 file_open_id, 407 file_open_id,
408 quota_policy); 408 quota_policy);
409 dispatchers_.Remove(request_id); 409 dispatchers_.Remove(request_id);
410 } 410 }
411 411
412 } // namespace content 412 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698