Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: webkit/appcache/appcache_database.h

Issue 8396013: AppCache INTERCEPT namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/appcache/appcache_database.h
===================================================================
--- webkit/appcache/appcache_database.h (revision 113546)
+++ webkit/appcache/appcache_database.h (working copy)
@@ -16,6 +16,7 @@
#include "base/time.h"
#include "googleurl/src/gurl.h"
#include "webkit/appcache/appcache_export.h"
+#include "webkit/appcache/appcache_interfaces.h"
namespace sql {
class Connection;
@@ -60,16 +61,19 @@
int64 response_size;
};
- struct APPCACHE_EXPORT FallbackNameSpaceRecord {
- FallbackNameSpaceRecord();
- ~FallbackNameSpaceRecord();
+ struct APPCACHE_EXPORT NamespaceRecord {
+ NamespaceRecord();
+ ~NamespaceRecord();
int64 cache_id;
- GURL origin; // intentionally not normalized
+ GURL origin;
+ NamespaceType type;
GURL namespace_url;
- GURL fallback_entry_url;
+ GURL target_url;
};
+ typedef std::vector<NamespaceRecord> NamespaceRecordVector;
+
struct OnlineWhiteListRecord {
OnlineWhiteListRecord() : cache_id(0) {}
@@ -129,14 +133,18 @@
return FindResponseIdsForCacheHelper(cache_id, NULL, response_ids);
}
- bool FindFallbackNameSpacesForOrigin(
- const GURL& origin, std::vector<FallbackNameSpaceRecord>* records);
- bool FindFallbackNameSpacesForCache(
- int64 cache_id, std::vector<FallbackNameSpaceRecord>* records);
- bool InsertFallbackNameSpace(const FallbackNameSpaceRecord* record);
- bool InsertFallbackNameSpaceRecords(
- const std::vector<FallbackNameSpaceRecord>& records);
- bool DeleteFallbackNameSpacesForCache(int64 cache_id);
+ bool FindNamespacesForOrigin(
+ const GURL& origin,
+ NamespaceRecordVector* intercepts,
+ NamespaceRecordVector* fallbacks);
+ bool FindNamespacesForCache(
+ int64 cache_id,
+ NamespaceRecordVector* intercepts,
+ std::vector<NamespaceRecord>* fallbacks);
+ bool InsertNamespaceRecords(
+ const NamespaceRecordVector& records);
+ bool InsertNamespace(const NamespaceRecord* record);
+ bool DeleteNamespacesForCache(int64 cache_id);
bool FindOnlineWhiteListForCache(
int64 cache_id, std::vector<OnlineWhiteListRecord>* records);
@@ -174,8 +182,12 @@
void ReadGroupRecord(const sql::Statement& statement, GroupRecord* record);
void ReadCacheRecord(const sql::Statement& statement, CacheRecord* record);
void ReadEntryRecord(const sql::Statement& statement, EntryRecord* record);
- void ReadFallbackNameSpaceRecord(
- const sql::Statement& statement, FallbackNameSpaceRecord* record);
+ void ReadNamespaceRecords(
+ sql::Statement* statement,
+ NamespaceRecordVector* intercepts,
+ NamespaceRecordVector* fallbacks);
+ void ReadNamespaceRecord(
+ const sql::Statement* statement, NamespaceRecord* record);
void ReadOnlineWhiteListRecord(
const sql::Statement& statement, OnlineWhiteListRecord* record);
@@ -200,13 +212,14 @@
FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, CacheRecords);
FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, EntryRecords);
- FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, FallbackNameSpaceRecords);
+ FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, NamespaceRecords);
FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, GroupRecords);
FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, LazyOpen);
FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, OnlineWhiteListRecords);
FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, ReCreate);
FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, DeletableResponseIds);
FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, OriginUsage);
+ FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, UpgradeSchema3to4);
DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase);
};

Powered by Google App Engine
This is Rietveld 408576698