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

Side by Side Diff: chrome/browser/chromeos/drive/drive_file_system_proxy.cc

Issue 12258021: Fix filesystem API file_handlers to work for drive on ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/external_filesystem_apitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/chromeos/drive/drive_file_system_proxy.h" 5 #include "chrome/browser/chromeos/drive/drive_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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 690 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
691 } 691 }
692 692
693 // static. 693 // static.
694 bool DriveFileSystemProxy::ValidateUrl( 694 bool DriveFileSystemProxy::ValidateUrl(
695 const FileSystemURL& url, base::FilePath* file_path) { 695 const FileSystemURL& url, base::FilePath* file_path) {
696 // what platform you're on. 696 // what platform you're on.
697 if (!url.is_valid() || url.type() != fileapi::kFileSystemTypeDrive) { 697 if (!url.is_valid() || url.type() != fileapi::kFileSystemTypeDrive) {
698 return false; 698 return false;
699 } 699 }
700 *file_path = url.virtual_path(); 700
701 return true; 701 // |url.virtual_path()| cannot be used directly because in the case the url is
702 // isolated file system url, the virtual path will be formatted as
703 // <isolated_file_system_id>/<file_name> and thus unusable by drive file
704 // system.
705 // TODO(kinaba): fix other uses of virtual_path() as in
706 // https://codereview.chromium.org/12483010/
707 *file_path = util::ExtractDrivePath(url.path());
708 return !file_path->empty();
702 } 709 }
703 710
704 void DriveFileSystemProxy::CallDriveFileSystemMethodOnUIThread( 711 void DriveFileSystemProxy::CallDriveFileSystemMethodOnUIThread(
705 const base::Closure& method_call) { 712 const base::Closure& method_call) {
706 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 713 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
707 BrowserThread::PostTask( 714 BrowserThread::PostTask(
708 BrowserThread::UI, 715 BrowserThread::UI,
709 FROM_HERE, 716 FROM_HERE,
710 base::Bind( 717 base::Bind(
711 &DriveFileSystemProxy::CallDriveFileSystemMethodOnUIThreadInternal, 718 &DriveFileSystemProxy::CallDriveFileSystemMethodOnUIThreadInternal,
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 CallDriveFileSystemMethodOnUIThread( 817 CallDriveFileSystemMethodOnUIThread(
811 base::Bind(&DriveFileSystemInterface::CloseFile, 818 base::Bind(&DriveFileSystemInterface::CloseFile,
812 base::Unretained(file_system_), 819 base::Unretained(file_system_),
813 virtual_path, 820 virtual_path,
814 google_apis::CreateRelayCallback( 821 google_apis::CreateRelayCallback(
815 base::Bind(&EmitDebugLogForCloseFile, 822 base::Bind(&EmitDebugLogForCloseFile,
816 virtual_path)))); 823 virtual_path))));
817 } 824 }
818 825
819 } // namespace drive 826 } // namespace drive
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/external_filesystem_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698