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

Side by Side Diff: webkit/common/fileapi/file_system_util.cc

Issue 16879013: Use chromium logic for database identifier<->origin conversions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove webkit/base/origin_url_conversions Created 7 years, 6 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
« no previous file with comments | « webkit/common/database/database_identifier_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/fileapi/file_system_util.h" 5 #include "webkit/common/fileapi/file_system_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "base/strings/sys_string_conversions.h" 12 #include "base/strings/sys_string_conversions.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "googleurl/src/gurl.h" 14 #include "googleurl/src/gurl.h"
15 #include "webkit/base/origin_url_conversions.h" 15 #include "webkit/common/database/database_identifier.h"
16 16
17 namespace fileapi { 17 namespace fileapi {
18 18
19 const char kPersistentDir[] = "/persistent"; 19 const char kPersistentDir[] = "/persistent";
20 const char kTemporaryDir[] = "/temporary"; 20 const char kTemporaryDir[] = "/temporary";
21 const char kIsolatedDir[] = "/isolated"; 21 const char kIsolatedDir[] = "/isolated";
22 const char kExternalDir[] = "/external"; 22 const char kExternalDir[] = "/external";
23 const char kTestDir[] = "/test"; 23 const char kTestDir[] = "/test";
24 24
25 const base::FilePath::CharType VirtualPath::kRoot[] = FILE_PATH_LITERAL("/"); 25 const base::FilePath::CharType VirtualPath::kRoot[] = FILE_PATH_LITERAL("/");
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // Internal types are always pointed via isolated or external URLs. 162 // Internal types are always pointed via isolated or external URLs.
163 default: 163 default:
164 NOTREACHED(); 164 NOTREACHED();
165 } 165 }
166 NOTREACHED(); 166 NOTREACHED();
167 return GURL(); 167 return GURL();
168 } 168 }
169 169
170 std::string GetFileSystemName(const GURL& origin_url, FileSystemType type) { 170 std::string GetFileSystemName(const GURL& origin_url, FileSystemType type) {
171 std::string origin_identifier = 171 std::string origin_identifier =
172 webkit_base::GetOriginIdentifierFromURL(origin_url); 172 webkit_database::GetIdentifierFromOrigin(origin_url);
173 std::string type_string = GetFileSystemTypeString(type); 173 std::string type_string = GetFileSystemTypeString(type);
174 DCHECK(!type_string.empty()); 174 DCHECK(!type_string.empty());
175 return origin_identifier + ":" + type_string; 175 return origin_identifier + ":" + type_string;
176 } 176 }
177 177
178 FileSystemType QuotaStorageTypeToFileSystemType( 178 FileSystemType QuotaStorageTypeToFileSystemType(
179 quota::StorageType storage_type) { 179 quota::StorageType storage_type) {
180 switch (storage_type) { 180 switch (storage_type) {
181 case quota::kStorageTypeTemporary: 181 case quota::kStorageTypeTemporary:
182 return kFileSystemTypeTemporary; 182 return kFileSystemTypeTemporary;
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 std::string root = GetFileSystemRootURI(origin_url, 380 std::string root = GetFileSystemRootURI(origin_url,
381 kFileSystemTypeExternal).spec(); 381 kFileSystemTypeExternal).spec();
382 if (base::FilePath::FromUTF8Unsafe(mount_name).ReferencesParent()) 382 if (base::FilePath::FromUTF8Unsafe(mount_name).ReferencesParent())
383 return std::string(); 383 return std::string();
384 root.append(mount_name); 384 root.append(mount_name);
385 root.append("/"); 385 root.append("/");
386 return root; 386 return root;
387 } 387 }
388 388
389 } // namespace fileapi 389 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/common/database/database_identifier_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698