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

Side by Side Diff: webkit/fileapi/isolated_context.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
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 "webkit/fileapi/isolated_context.h" 5 #include "webkit/fileapi/isolated_context.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 std::string mount_name; 316 std::string mount_name;
317 FileSystemType cracked_type; 317 FileSystemType cracked_type;
318 base::FilePath cracked_path; 318 base::FilePath cracked_path;
319 if (!CrackVirtualPath(path, &mount_name, &cracked_type, &cracked_path)) 319 if (!CrackVirtualPath(path, &mount_name, &cracked_type, &cracked_path))
320 return FileSystemURL(); 320 return FileSystemURL();
321 321
322 return FileSystemURL(origin, type, path, 322 return FileSystemURL(origin, type, path,
323 mount_name, cracked_type, cracked_path); 323 mount_name, cracked_type, cracked_path);
324 } 324 }
325 325
326 bool IsolatedContext::GetVirtualPath(const base::FilePath& full_path,
327 base::FilePath* virtual_path) const {
328 return false;
329 }
330
326 void IsolatedContext::RevokeFileSystemByPath(const base::FilePath& path_in) { 331 void IsolatedContext::RevokeFileSystemByPath(const base::FilePath& path_in) {
327 base::AutoLock locker(lock_); 332 base::AutoLock locker(lock_);
328 base::FilePath path(path_in.NormalizePathSeparators()); 333 base::FilePath path(path_in.NormalizePathSeparators());
329 PathToID::iterator ids_iter = path_to_id_map_.find(path); 334 PathToID::iterator ids_iter = path_to_id_map_.find(path);
330 if (ids_iter == path_to_id_map_.end()) 335 if (ids_iter == path_to_id_map_.end())
331 return; 336 return;
332 std::set<std::string>& ids = ids_iter->second; 337 std::set<std::string>& ids = ids_iter->second;
333 for (std::set<std::string>::iterator iter = ids.begin(); 338 for (std::set<std::string>::iterator iter = ids.begin();
334 iter != ids.end(); ++iter) { 339 iter != ids.end(); ++iter) {
335 IDToInstance::iterator found = instance_map_.find(*iter); 340 IDToInstance::iterator found = instance_map_.find(*iter);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 uint32 random_data[4]; 420 uint32 random_data[4];
416 std::string id; 421 std::string id;
417 do { 422 do {
418 base::RandBytes(random_data, sizeof(random_data)); 423 base::RandBytes(random_data, sizeof(random_data));
419 id = base::HexEncode(random_data, sizeof(random_data)); 424 id = base::HexEncode(random_data, sizeof(random_data));
420 } while (instance_map_.find(id) != instance_map_.end()); 425 } while (instance_map_.find(id) != instance_map_.end());
421 return id; 426 return id;
422 } 427 }
423 428
424 } // namespace fileapi 429 } // namespace fileapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698