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

Side by Side Diff: chrome/browser/chromeos/fileapi/file_system_backend.cc

Issue 18300006: FileAPI: Factor out getting root URI and FS name parts into each FS backend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/media_file_system_backend.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 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 "chrome/browser/chromeos/fileapi/file_system_backend.h" 5 #include "chrome/browser/chromeos/fileapi/file_system_backend.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 106 }
107 } 107 }
108 108
109 void FileSystemBackend::OpenFileSystem( 109 void FileSystemBackend::OpenFileSystem(
110 const GURL& origin_url, 110 const GURL& origin_url,
111 fileapi::FileSystemType type, 111 fileapi::FileSystemType type,
112 fileapi::OpenFileSystemMode mode, 112 fileapi::OpenFileSystemMode mode,
113 const OpenFileSystemCallback& callback) { 113 const OpenFileSystemCallback& callback) {
114 DCHECK(fileapi::IsolatedContext::IsIsolatedType(type)); 114 DCHECK(fileapi::IsolatedContext::IsIsolatedType(type));
115 // Nothing to validate for external filesystem. 115 // Nothing to validate for external filesystem.
116 callback.Run(base::PLATFORM_FILE_OK); 116 callback.Run(GetFileSystemRootURI(origin_url, type),
117 GetFileSystemName(origin_url, type),
118 base::PLATFORM_FILE_OK);
117 } 119 }
118 120
119 fileapi::FileSystemQuotaUtil* FileSystemBackend::GetQuotaUtil() { 121 fileapi::FileSystemQuotaUtil* FileSystemBackend::GetQuotaUtil() {
120 // No quota support. 122 // No quota support.
121 return NULL; 123 return NULL;
122 } 124 }
123 125
124 bool FileSystemBackend::IsAccessAllowed( 126 bool FileSystemBackend::IsAccessAllowed(
125 const fileapi::FileSystemURL& url) const { 127 const fileapi::FileSystemURL& url) const {
126 if (!url.is_valid()) 128 if (!url.is_valid())
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 std::string mount_name = url.filesystem_id(); 314 std::string mount_name = url.filesystem_id();
313 if (!mount_points_->GetRegisteredPath(mount_name, &root_path) && 315 if (!mount_points_->GetRegisteredPath(mount_name, &root_path) &&
314 !system_mount_points_->GetRegisteredPath(mount_name, &root_path)) { 316 !system_mount_points_->GetRegisteredPath(mount_name, &root_path)) {
315 return base::FilePath(); 317 return base::FilePath();
316 } 318 }
317 319
318 return root_path.DirName(); 320 return root_path.DirName();
319 } 321 }
320 322
321 } // namespace chromeos 323 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/media_file_system_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698