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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 11 matching lines...) Expand all Loading... |
22 // A client of this class need to call StartFetching from the UI thread to | 22 // A client of this class need to call StartFetching from the UI thread to |
23 // initiate the flow, and it'll be notified by the callback in its UI | 23 // initiate the flow, and it'll be notified by the callback in its UI |
24 // thread at some later point. | 24 // thread at some later point. |
25 // The client must call CancelNotification() if it's destroyed before the | 25 // The client must call CancelNotification() if it's destroyed before the |
26 // callback is notified. | 26 // callback is notified. |
27 class BrowsingDataDatabaseHelper | 27 class BrowsingDataDatabaseHelper |
28 : public base::RefCountedThreadSafe<BrowsingDataDatabaseHelper> { | 28 : public base::RefCountedThreadSafe<BrowsingDataDatabaseHelper> { |
29 public: | 29 public: |
30 // Contains detailed information about a web database. | 30 // Contains detailed information about a web database. |
31 struct DatabaseInfo { | 31 struct DatabaseInfo { |
32 DatabaseInfo() {} | 32 DatabaseInfo(); |
33 DatabaseInfo(const std::string& host, | 33 DatabaseInfo(const std::string& host, |
34 const std::string& database_name, | 34 const std::string& database_name, |
35 const std::string& origin_identifier, | 35 const std::string& origin_identifier, |
36 const std::string& description, | 36 const std::string& description, |
37 const std::string& origin, | 37 const std::string& origin, |
38 int64 size, | 38 int64 size, |
39 base::Time last_modified) | 39 base::Time last_modified); |
40 : host(host), | 40 ~DatabaseInfo(); |
41 database_name(database_name), | |
42 origin_identifier(origin_identifier), | |
43 description(description), | |
44 origin(origin), | |
45 size(size), | |
46 last_modified(last_modified) { | |
47 } | |
48 | 41 |
49 bool IsFileSchemeData() { | 42 bool IsFileSchemeData(); |
50 return StartsWithASCII(origin_identifier, | |
51 std::string(chrome::kFileScheme), | |
52 true); | |
53 } | |
54 | 43 |
55 std::string host; | 44 std::string host; |
56 std::string database_name; | 45 std::string database_name; |
57 std::string origin_identifier; | 46 std::string origin_identifier; |
58 std::string description; | 47 std::string description; |
59 std::string origin; | 48 std::string origin; |
60 int64 size; | 49 int64 size; |
61 base::Time last_modified; | 50 base::Time last_modified; |
62 }; | 51 }; |
63 | 52 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 Callback1<const std::vector<DatabaseInfo>& >::Type* callback); | 125 Callback1<const std::vector<DatabaseInfo>& >::Type* callback); |
137 virtual void CancelNotification() {} | 126 virtual void CancelNotification() {} |
138 | 127 |
139 private: | 128 private: |
140 virtual ~CannedBrowsingDataDatabaseHelper() {} | 129 virtual ~CannedBrowsingDataDatabaseHelper() {} |
141 | 130 |
142 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataDatabaseHelper); | 131 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataDatabaseHelper); |
143 }; | 132 }; |
144 | 133 |
145 #endif // CHROME_BROWSER_BROWSING_DATA_DATABASE_HELPER_H_ | 134 #endif // CHROME_BROWSER_BROWSING_DATA_DATABASE_HELPER_H_ |
OLD | NEW |