diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-22 00:23:20 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-22 00:23:20 +0000 |
commit | 7a18cff96aec2428c6446bbb531dc39c1baa8bab (patch) | |
tree | 8e036e2cec63bc27a0ebb41998c1b1f49cdf7191 /content/browser/storage_partition_impl.cc | |
parent | cefcfdad67c34f5a76067b177d8dd1c867070eb2 (diff) | |
download | chromium_src-7a18cff96aec2428c6446bbb531dc39c1baa8bab.zip chromium_src-7a18cff96aec2428c6446bbb531dc39c1baa8bab.tar.gz chromium_src-7a18cff96aec2428c6446bbb531dc39c1baa8bab.tar.bz2 |
Shorten the path length to get under MAX_PATH on windows.
Some of the nested directories in each partition have variable length path names. Prepending our isolated storage path structure used to take us over the to MAX_PATH for chrome-extension:// origins when creating the database files for subsystems like Local Storage.
With this change, on XP, assuming a 10-character user name, the Local Storage database file representing the chrome-extension: origin in the Default profile for user "abcdefghij" has this path:
C:\Documents and Settings\abcedfghij\Local Settings\Application Data\
Google\Chrome SxS\User Data\Default\Storage\
ext\bdlahefabekefwlefaancobndodocndn\def\Local Storage\
chrome-extension_bdlahefabekefwlefaancobndodocndn_0.localstorage-journal
which is 241 characters. This gives 19 characters of headroom from the 260 MAX_PATH.
Previously, when we used "Storage Partitions", "extensions", and "default" instead of "Storage, "ext", and "def", the same database file would have a path length of 263 characters.
This change doesn't completely solve the problem. If Local Storage is used on a super-long domain, we can still exceed MAX_PATH. However, using my own profile as an example, of 342 domains, none created paths longer than those of the chrome-extensions so this should be a pretty solid mitigation.
BUG=151450
Review URL: https://codereview.chromium.org/10967030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158136 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/storage_partition_impl.cc')
-rw-r--r-- | content/browser/storage_partition_impl.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc index b09918b..7ba19db 100644 --- a/content/browser/storage_partition_impl.cc +++ b/content/browser/storage_partition_impl.cc @@ -25,16 +25,16 @@ namespace { // for the "default" extension storage partition and one directory for each // persistent partition used by an extension's browser tags. Example: // -// {kStoragePartitionDirname}/extensions/ABCDEF/default -// {kStoragePartitionDirname}/extensions/ABCDEF/{hash(guest partition)} +// Storage/ext/ABCDEF/def +// Storage/ext/ABCDEF/{hash(guest partition)} // // The code in GetPartitionPath() constructs these path names. const FilePath::CharType kStoragePartitionDirname[] = - FILE_PATH_LITERAL("Storage Partitions"); + FILE_PATH_LITERAL("Storage"); const FilePath::CharType kExtensionsDirname[] = - FILE_PATH_LITERAL("extensions"); + FILE_PATH_LITERAL("ext"); const FilePath::CharType kDefaultPartitionDirname[] = - FILE_PATH_LITERAL("default"); + FILE_PATH_LITERAL("def"); } // namespace |