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 "webkit/browser/fileapi/isolated_context.h" | 5 #include "webkit/browser/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" |
11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
12 #include "base/string_util.h" | |
13 #include "base/stringprintf.h" | |
14 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/string_util.h" |
| 14 #include "base/strings/stringprintf.h" |
15 #include "webkit/browser/fileapi/file_system_url.h" | 15 #include "webkit/browser/fileapi/file_system_url.h" |
16 | 16 |
17 namespace fileapi { | 17 namespace fileapi { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 base::FilePath::StringType GetRegisterNameForPath(const base::FilePath& path) { | 21 base::FilePath::StringType GetRegisterNameForPath(const base::FilePath& path) { |
22 // If it's not a root path simply return a base name. | 22 // If it's not a root path simply return a base name. |
23 if (path.DirName() != path) | 23 if (path.DirName() != path) |
24 return path.BaseName().value(); | 24 return path.BaseName().value(); |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 uint32 random_data[4]; | 460 uint32 random_data[4]; |
461 std::string id; | 461 std::string id; |
462 do { | 462 do { |
463 base::RandBytes(random_data, sizeof(random_data)); | 463 base::RandBytes(random_data, sizeof(random_data)); |
464 id = base::HexEncode(random_data, sizeof(random_data)); | 464 id = base::HexEncode(random_data, sizeof(random_data)); |
465 } while (instance_map_.find(id) != instance_map_.end()); | 465 } while (instance_map_.find(id) != instance_map_.end()); |
466 return id; | 466 return id; |
467 } | 467 } |
468 | 468 |
469 } // namespace fileapi | 469 } // namespace fileapi |
OLD | NEW |