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

Side by Side Diff: webkit/browser/fileapi/external_mount_points.cc

Issue 15994002: Move more browser-specific webkit/fileapi code to webkit/browser/fileapi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "webkit/fileapi/external_mount_points.h" 5 #include "webkit/browser/fileapi/external_mount_points.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
11 #include "webkit/fileapi/file_system_url.h" 11 #include "webkit/fileapi/file_system_url.h"
12 #include "webkit/fileapi/remote_file_system_proxy.h" 12 #include "webkit/fileapi/remote_file_system_proxy.h"
13 13
14 namespace { 14 namespace {
15 15
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 return false; 168 return false;
169 169
170 // The virtual_path should comprise of <mount_name> and <relative_path> parts. 170 // The virtual_path should comprise of <mount_name> and <relative_path> parts.
171 std::vector<base::FilePath::StringType> components; 171 std::vector<base::FilePath::StringType> components;
172 virtual_path.GetComponents(&components); 172 virtual_path.GetComponents(&components);
173 if (components.size() < 1) 173 if (components.size() < 1)
174 return false; 174 return false;
175 175
176 std::vector<base::FilePath::StringType>::iterator component_iter = 176 std::vector<base::FilePath::StringType>::iterator component_iter =
177 components.begin(); 177 components.begin();
178 std::string maybe_mount_name = base::FilePath(*component_iter++).MaybeAsASCII( ); 178 std::string maybe_mount_name =
179 base::FilePath(*component_iter++).MaybeAsASCII();
179 if (maybe_mount_name.empty()) 180 if (maybe_mount_name.empty())
180 return false; 181 return false;
181 182
182 base::FilePath cracked_path; 183 base::FilePath cracked_path;
183 { 184 {
184 base::AutoLock locker(lock_); 185 base::AutoLock locker(lock_);
185 NameToInstance::const_iterator found_instance = 186 NameToInstance::const_iterator found_instance =
186 instance_map_.find(maybe_mount_name); 187 instance_map_.find(maybe_mount_name);
187 if (found_instance == instance_map_.end()) 188 if (found_instance == instance_map_.end())
188 return false; 189 return false;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 base::FilePath ScopedExternalFileSystem::GetVirtualRootPath() const { 350 base::FilePath ScopedExternalFileSystem::GetVirtualRootPath() const {
350 return ExternalMountPoints::GetSystemInstance()-> 351 return ExternalMountPoints::GetSystemInstance()->
351 CreateVirtualRootPath(mount_name_); 352 CreateVirtualRootPath(mount_name_);
352 } 353 }
353 354
354 ScopedExternalFileSystem::~ScopedExternalFileSystem() { 355 ScopedExternalFileSystem::~ScopedExternalFileSystem() {
355 ExternalMountPoints::GetSystemInstance()->RevokeFileSystem(mount_name_); 356 ExternalMountPoints::GetSystemInstance()->RevokeFileSystem(mount_name_);
356 } 357 }
357 358
358 } // namespace fileapi 359 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/external_mount_points.h ('k') | webkit/browser/fileapi/external_mount_points_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698