| 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 CHROME_BROWSER_BROWSING_DATA_DATABASE_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_DATABASE_HELPER_H_ |
| 6 #define CHROME_BROWSER_BROWSING_DATA_DATABASE_HELPER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_DATABASE_HELPER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "chrome/common/url_constants.h" |
| 13 #include "webkit/database/database_tracker.h" | 14 #include "webkit/database/database_tracker.h" |
| 14 | 15 |
| 15 class Profile; | 16 class Profile; |
| 16 | 17 |
| 17 // This class fetches database information in the FILE thread, and notifies the | 18 // This class fetches database information in the FILE thread, and notifies the |
| 18 // UI thread upon completion. | 19 // UI thread upon completion. |
| 19 // A client of this class need to call StartFetching from the UI thread to | 20 // A client of this class need to call StartFetching from the UI thread to |
| 20 // initiate the flow, and it'll be notified by the callback in its UI | 21 // initiate the flow, and it'll be notified by the callback in its UI |
| 21 // thread at some later point. | 22 // thread at some later point. |
| 22 // The client must call CancelNotification() if it's destroyed before the | 23 // The client must call CancelNotification() if it's destroyed before the |
| (...skipping 11 matching lines...) Expand all Loading... |
| 34 int64 size, | 35 int64 size, |
| 35 base::Time last_modified) | 36 base::Time last_modified) |
| 36 : host(host), | 37 : host(host), |
| 37 database_name(database_name), | 38 database_name(database_name), |
| 38 origin_identifier(origin_identifier), | 39 origin_identifier(origin_identifier), |
| 39 description(description), | 40 description(description), |
| 40 size(size), | 41 size(size), |
| 41 last_modified(last_modified) { | 42 last_modified(last_modified) { |
| 42 } | 43 } |
| 43 | 44 |
| 45 bool IsExtensionSchemeData() { |
| 46 return StartsWithASCII(origin_identifier, |
| 47 std::string(chrome::kExtensionScheme), |
| 48 true); |
| 49 } |
| 50 |
| 51 bool IsFileSchemeData() { |
| 52 return StartsWithASCII(origin_identifier, |
| 53 std::string(chrome::kFileScheme), |
| 54 true); |
| 55 } |
| 56 |
| 44 std::string host; | 57 std::string host; |
| 45 std::string database_name; | 58 std::string database_name; |
| 46 std::string origin_identifier; | 59 std::string origin_identifier; |
| 47 std::string description; | 60 std::string description; |
| 48 int64 size; | 61 int64 size; |
| 49 base::Time last_modified; | 62 base::Time last_modified; |
| 50 }; | 63 }; |
| 51 | 64 |
| 52 explicit BrowsingDataDatabaseHelper(Profile* profile); | 65 explicit BrowsingDataDatabaseHelper(Profile* profile); |
| 53 | 66 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // This only mutates on the UI thread. | 108 // This only mutates on the UI thread. |
| 96 bool is_fetching_; | 109 bool is_fetching_; |
| 97 | 110 |
| 98 // This only mutates in the FILE thread. | 111 // This only mutates in the FILE thread. |
| 99 std::vector<DatabaseInfo> database_info_; | 112 std::vector<DatabaseInfo> database_info_; |
| 100 | 113 |
| 101 DISALLOW_COPY_AND_ASSIGN(BrowsingDataDatabaseHelper); | 114 DISALLOW_COPY_AND_ASSIGN(BrowsingDataDatabaseHelper); |
| 102 }; | 115 }; |
| 103 | 116 |
| 104 #endif // CHROME_BROWSER_BROWSING_DATA_DATABASE_HELPER_H_ | 117 #endif // CHROME_BROWSER_BROWSING_DATA_DATABASE_HELPER_H_ |
| OLD | NEW |