| 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 "storage/browser/fileapi/isolated_context.h" | 5 #include "storage/browser/fileapi/isolated_context.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 | 417 |
| 418 base::FilePath IsolatedContext::CreateVirtualRootPath( | 418 base::FilePath IsolatedContext::CreateVirtualRootPath( |
| 419 const std::string& filesystem_id) const { | 419 const std::string& filesystem_id) const { |
| 420 return base::FilePath().AppendASCII(filesystem_id); | 420 return base::FilePath().AppendASCII(filesystem_id); |
| 421 } | 421 } |
| 422 | 422 |
| 423 IsolatedContext::IsolatedContext() { | 423 IsolatedContext::IsolatedContext() { |
| 424 } | 424 } |
| 425 | 425 |
| 426 IsolatedContext::~IsolatedContext() { | 426 IsolatedContext::~IsolatedContext() { |
| 427 STLDeleteContainerPairSecondPointers(instance_map_.begin(), | 427 base::STLDeleteContainerPairSecondPointers(instance_map_.begin(), |
| 428 instance_map_.end()); | 428 instance_map_.end()); |
| 429 } | 429 } |
| 430 | 430 |
| 431 FileSystemURL IsolatedContext::CrackFileSystemURL( | 431 FileSystemURL IsolatedContext::CrackFileSystemURL( |
| 432 const FileSystemURL& url) const { | 432 const FileSystemURL& url) const { |
| 433 if (!HandlesFileSystemMountType(url.type())) | 433 if (!HandlesFileSystemMountType(url.type())) |
| 434 return FileSystemURL(); | 434 return FileSystemURL(); |
| 435 | 435 |
| 436 std::string mount_name; | 436 std::string mount_name; |
| 437 std::string cracked_mount_name; | 437 std::string cracked_mount_name; |
| 438 FileSystemType cracked_type; | 438 FileSystemType cracked_type; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 uint32_t random_data[4]; | 477 uint32_t random_data[4]; |
| 478 std::string id; | 478 std::string id; |
| 479 do { | 479 do { |
| 480 base::RandBytes(random_data, sizeof(random_data)); | 480 base::RandBytes(random_data, sizeof(random_data)); |
| 481 id = base::HexEncode(random_data, sizeof(random_data)); | 481 id = base::HexEncode(random_data, sizeof(random_data)); |
| 482 } while (instance_map_.find(id) != instance_map_.end()); | 482 } while (instance_map_.find(id) != instance_map_.end()); |
| 483 return id; | 483 return id; |
| 484 } | 484 } |
| 485 | 485 |
| 486 } // namespace storage | 486 } // namespace storage |
| OLD | NEW |