| 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 #include "webkit/storage/webkit_storage_export.h" | 10 #include "webkit/storage/webkit_storage_export.h" |
| 11 | 11 |
| 12 namespace base { |
| 12 class FilePath; | 13 class FilePath; |
| 14 } |
| 13 | 15 |
| 14 namespace webkit_database { | 16 namespace webkit_database { |
| 15 | 17 |
| 16 class DatabaseTracker; | 18 class DatabaseTracker; |
| 17 | 19 |
| 18 class WEBKIT_STORAGE_EXPORT DatabaseUtil { | 20 class WEBKIT_STORAGE_EXPORT DatabaseUtil { |
| 19 public: | 21 public: |
| 20 static const char kJournalFileSuffix[]; | 22 static const char kJournalFileSuffix[]; |
| 21 | 23 |
| 22 // Extract various information from a database vfs_file_name. All return | 24 // Extract various information from a database vfs_file_name. All return |
| 23 // parameters are optional. | 25 // parameters are optional. |
| 24 static bool CrackVfsFileName(const string16& vfs_file_name, | 26 static bool CrackVfsFileName(const string16& vfs_file_name, |
| 25 string16* origin_identifier, | 27 string16* origin_identifier, |
| 26 string16* database_name, | 28 string16* database_name, |
| 27 string16* sqlite_suffix); | 29 string16* sqlite_suffix); |
| 28 static FilePath GetFullFilePathForVfsFile(DatabaseTracker* db_tracker, | 30 static base::FilePath GetFullFilePathForVfsFile(DatabaseTracker* db_tracker, |
| 29 const string16& vfs_file_name); | 31 const string16& vfs_file_name)
; |
| 30 static string16 GetOriginIdentifier(const GURL& url); | 32 static string16 GetOriginIdentifier(const GURL& url); |
| 31 static GURL GetOriginFromIdentifier(const string16& origin_identifier); | 33 static GURL GetOriginFromIdentifier(const string16& origin_identifier); |
| 32 }; | 34 }; |
| 33 | 35 |
| 34 } // namespace webkit_database | 36 } // namespace webkit_database |
| 35 | 37 |
| 36 #endif // WEBKIT_DATABASE_DATABASE_UTIL_H_ | 38 #endif // WEBKIT_DATABASE_DATABASE_UTIL_H_ |
| OLD | NEW |