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

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

Issue 10600013: Wired support for file truncating with RemoteFileSystemOperation::OpenFile() method (case when base… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/common/fileapi/file_system_dispatcher.h" 5 #include "content/common/fileapi/file_system_dispatcher.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/process.h" 8 #include "base/process.h"
9 #include "content/common/child_thread.h" 9 #include "content/common/child_thread.h"
10 #include "content/common/fileapi/file_system_messages.h" 10 #include "content/common/fileapi/file_system_messages.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 if (!ChildThread::current()->Send( 223 if (!ChildThread::current()->Send(
224 new FileSystemHostMsg_OpenFile( 224 new FileSystemHostMsg_OpenFile(
225 request_id, file_path, file_flags))) { 225 request_id, file_path, file_flags))) {
226 dispatchers_.Remove(request_id); // destroys |dispatcher| 226 dispatchers_.Remove(request_id); // destroys |dispatcher|
227 return false; 227 return false;
228 } 228 }
229 229
230 return true; 230 return true;
231 } 231 }
232 232
233 bool FileSystemDispatcher::NotifyFileClosed(
234 const GURL& path) {
235 return ChildThread::current()->Send(
236 new FileSystemHostMsg_NotifyFileClosed(path));
237 }
238
233 bool FileSystemDispatcher::CreateSnapshotFile( 239 bool FileSystemDispatcher::CreateSnapshotFile(
234 const GURL& blob_url, 240 const GURL& blob_url,
235 const GURL& file_path, 241 const GURL& file_path,
236 fileapi::FileSystemCallbackDispatcher* dispatcher) { 242 fileapi::FileSystemCallbackDispatcher* dispatcher) {
237 int request_id = dispatchers_.Add(dispatcher); 243 int request_id = dispatchers_.Add(dispatcher);
238 if (!ChildThread::current()->Send( 244 if (!ChildThread::current()->Send(
239 new FileSystemHostMsg_CreateSnapshotFile( 245 new FileSystemHostMsg_CreateSnapshotFile(
240 request_id, blob_url, file_path))) { 246 request_id, blob_url, file_path))) {
241 dispatchers_.Remove(request_id); // destroys |dispatcher| 247 dispatchers_.Remove(request_id); // destroys |dispatcher|
242 return false; 248 return false;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 } 310 }
305 311
306 void FileSystemDispatcher::OnDidOpenFile( 312 void FileSystemDispatcher::OnDidOpenFile(
307 int request_id, IPC::PlatformFileForTransit file) { 313 int request_id, IPC::PlatformFileForTransit file) {
308 fileapi::FileSystemCallbackDispatcher* dispatcher = 314 fileapi::FileSystemCallbackDispatcher* dispatcher =
309 dispatchers_.Lookup(request_id); 315 dispatchers_.Lookup(request_id);
310 DCHECK(dispatcher); 316 DCHECK(dispatcher);
311 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file)); 317 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file));
312 dispatchers_.Remove(request_id); 318 dispatchers_.Remove(request_id);
313 } 319 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698