OLD | NEW |
---|---|
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 "chrome/browser/chromeos/gdata/gdata_file_system_proxy.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_file_system_proxy.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
382 } | 382 } |
383 | 383 |
384 file_system_->GetFileByPath(file_path, | 384 file_system_->GetFileByPath(file_path, |
385 base::Bind(&OnGetFileByPathForOpen, | 385 base::Bind(&OnGetFileByPathForOpen, |
386 callback, | 386 callback, |
387 file_flags, | 387 file_flags, |
388 peer_handle), | 388 peer_handle), |
389 GetDownloadDataCallback()); | 389 GetDownloadDataCallback()); |
390 } | 390 } |
391 | 391 |
392 void GDataFileSystemProxy::NotifyCloseFile(const GURL& file_url) { | |
393 // TODO(kinaba,zelidrag): crbug.com/132236. | |
394 // Once OpenFile() for writing is implemented, we also need to implement the | |
395 // corresponding NotifyCloseFile for committing dirty cache. | |
zel
2012/06/27 00:08:03
please see how I implemented this method at: https
kinaba
2012/06/27 03:47:42
Thanks, it is the exact implementation I imagined!
| |
396 } | |
397 | |
kinuko
2012/06/26 11:13:36
nit: extra empty line
kinaba
2012/06/27 03:47:42
Done.
| |
398 | |
392 void GDataFileSystemProxy::CreateSnapshotFile( | 399 void GDataFileSystemProxy::CreateSnapshotFile( |
393 const GURL& file_url, | 400 const GURL& file_url, |
394 const FileSystemOperationInterface::SnapshotFileCallback& callback) { | 401 const FileSystemOperationInterface::SnapshotFileCallback& callback) { |
395 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 402 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
396 | 403 |
397 FilePath file_path; | 404 FilePath file_path; |
398 if (!ValidateUrl(file_url, &file_path)) { | 405 if (!ValidateUrl(file_url, &file_path)) { |
399 MessageLoopProxy::current()->PostTask(FROM_HERE, | 406 MessageLoopProxy::current()->PostTask(FROM_HERE, |
400 base::Bind(callback, | 407 base::Bind(callback, |
401 base::PLATFORM_FILE_ERROR_NOT_FOUND, | 408 base::PLATFORM_FILE_ERROR_NOT_FOUND, |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
552 | 559 |
553 void GDataFileSystemProxy::CloseWritableSnapshotFile( | 560 void GDataFileSystemProxy::CloseWritableSnapshotFile( |
554 const FilePath& virtual_path, | 561 const FilePath& virtual_path, |
555 const FilePath& local_path) { | 562 const FilePath& local_path) { |
556 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 563 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
557 | 564 |
558 file_system_->CloseFile(virtual_path, base::Bind(&OnClose, virtual_path)); | 565 file_system_->CloseFile(virtual_path, base::Bind(&OnClose, virtual_path)); |
559 } | 566 } |
560 | 567 |
561 } // namespace gdata | 568 } // namespace gdata |
OLD | NEW |