| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 COMPONENTS_PRECACHE_CORE_PRECACHE_URL_TABLE_H_ | 5 #ifndef COMPONENTS_PRECACHE_CORE_PRECACHE_URL_TABLE_H_ |
| 6 #define COMPONENTS_PRECACHE_CORE_PRECACHE_URL_TABLE_H_ | 6 #define COMPONENTS_PRECACHE_CORE_PRECACHE_URL_TABLE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 13 | 13 |
| 14 namespace sql { | 14 namespace sql { |
| 15 class Connection; | 15 class Connection; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace precache { | 18 namespace precache { |
| 19 | 19 |
| 20 // Interface for database table that keeps track of the URLs that have been | 20 // Interface for database table that keeps track of the URLs that have been |
| 21 // precached but not used. Each row in this table represents a URL that was | 21 // precached but not used. This table is used to count how many bytes were saved |
| 22 // precached over the network, and has not been fetched through user browsing | 22 // by precached resources. |
| 23 // since then. Manages one table { URL (primary key), precache timestamp }. | 23 // Each row in this table represents a URL that was precached over the network, |
| 24 // and has not been fetched through user browsing since then. |
| 25 // Manages one table { URL (primary key), precache timestamp }. |
| 24 class PrecacheURLTable { | 26 class PrecacheURLTable { |
| 25 public: | 27 public: |
| 26 PrecacheURLTable(); | 28 PrecacheURLTable(); |
| 27 ~PrecacheURLTable(); | 29 ~PrecacheURLTable(); |
| 28 | 30 |
| 29 // Initialize the precache URL table for use with the specified database | 31 // Initialize the precache URL table for use with the specified database |
| 30 // connection. The caller keeps ownership of |db|, and |db| must not be NULL. | 32 // connection. The caller keeps ownership of |db|, and |db| must not be NULL. |
| 31 // Init must be called before any other methods. | 33 // Init must be called before any other methods. |
| 32 bool Init(sql::Connection* db); | 34 bool Init(sql::Connection* db); |
| 33 | 35 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 55 | 57 |
| 56 // Non-owned pointer. | 58 // Non-owned pointer. |
| 57 sql::Connection* db_; | 59 sql::Connection* db_; |
| 58 | 60 |
| 59 DISALLOW_COPY_AND_ASSIGN(PrecacheURLTable); | 61 DISALLOW_COPY_AND_ASSIGN(PrecacheURLTable); |
| 60 }; | 62 }; |
| 61 | 63 |
| 62 } // namespace precache | 64 } // namespace precache |
| 63 | 65 |
| 64 #endif // COMPONENTS_PRECACHE_CORE_PRECACHE_URL_TABLE_H_ | 66 #endif // COMPONENTS_PRECACHE_CORE_PRECACHE_URL_TABLE_H_ |
| OLD | NEW |