| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef WEBKIT_DATABASE_DATABASE_UTIL_H_ | 5 #ifndef WEBKIT_DATABASE_DATABASE_UTIL_H_ |
| 6 #define WEBKIT_DATABASE_DATABASE_UTIL_H_ | 6 #define WEBKIT_DATABASE_DATABASE_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/string16.h" | 8 #include "base/string16.h" |
| 9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 | 10 |
| 11 class FilePath; | 11 class FilePath; |
| 12 | 12 |
| 13 namespace webkit_database { | 13 namespace webkit_database { |
| 14 | 14 |
| 15 class DatabaseTracker; | 15 class DatabaseTracker; |
| 16 | 16 |
| 17 class DatabaseUtil { | 17 class DatabaseUtil { |
| 18 public: | 18 public: |
| 19 static const char kJournalFileSuffix[]; |
| 20 |
| 19 // Extract various information from a database vfs_file_name. All return | 21 // Extract various information from a database vfs_file_name. All return |
| 20 // parameters are optional. | 22 // parameters are optional. |
| 21 static bool CrackVfsFileName(const string16& vfs_file_name, | 23 static bool CrackVfsFileName(const string16& vfs_file_name, |
| 22 string16* origin_identifier, | 24 string16* origin_identifier, |
| 23 string16* database_name, | 25 string16* database_name, |
| 24 string16* sqlite_suffix); | 26 string16* sqlite_suffix); |
| 25 static FilePath GetFullFilePathForVfsFile(DatabaseTracker* db_tracker, | 27 static FilePath GetFullFilePathForVfsFile(DatabaseTracker* db_tracker, |
| 26 const string16& vfs_file_name); | 28 const string16& vfs_file_name); |
| 27 static string16 GetOriginIdentifier(const GURL& url); | 29 static string16 GetOriginIdentifier(const GURL& url); |
| 28 static GURL GetOriginFromIdentifier(const string16& origin_identifier); | 30 static GURL GetOriginFromIdentifier(const string16& origin_identifier); |
| 29 }; | 31 }; |
| 30 | 32 |
| 31 } // namespace webkit_database | 33 } // namespace webkit_database |
| 32 | 34 |
| 33 #endif // WEBKIT_DATABASE_DATABASE_UTIL_H_ | 35 #endif // WEBKIT_DATABASE_DATABASE_UTIL_H_ |
| OLD | NEW |