Chromium Code Reviews| Index: webkit/appcache/appcache_database.cc |
| =================================================================== |
| --- webkit/appcache/appcache_database.cc (revision 193265) |
| +++ webkit/appcache/appcache_database.cc (working copy) |
| @@ -689,10 +689,16 @@ |
| " (cache_id, origin, type, namespace_url, target_url, is_pattern)" |
| " VALUES (?, ?, ?, ?, ?, ?)"; |
| + // Note: quick and dirty storage for the 'executable' bit w/o changing |
| + // schemas, we use the high bit of 'type' field |
|
Greg Billock
2013/04/10 23:25:30
Is this going to give us maintenance hassles later
alecflett
2013/04/10 23:39:56
Yeah, for instance we lose backwards compatibility
michaeln
2013/04/10 23:47:59
This bugs me too :) We couldn't completely back ev
|
| + int type_with_executable_bit = record->namespace_.type; |
| + if (record->namespace_.is_executable) |
| + type_with_executable_bit |= 0x80000000; |
| + |
| sql::Statement statement(db_->GetCachedStatement(SQL_FROM_HERE, kSql)); |
| statement.BindInt64(0, record->cache_id); |
| statement.BindString(1, record->origin.spec()); |
| - statement.BindInt(2, record->namespace_.type); |
| + statement.BindInt(2, type_with_executable_bit); |
| statement.BindString(3, record->namespace_.namespace_url.spec()); |
| statement.BindString(4, record->namespace_.target_url.spec()); |
| statement.BindBool(5, record->namespace_.is_pattern); |
| @@ -936,10 +942,17 @@ |
| const sql::Statement* statement, NamespaceRecord* record) { |
| record->cache_id = statement->ColumnInt64(0); |
| record->origin = GURL(statement->ColumnString(1)); |
| - record->namespace_.type = static_cast<NamespaceType>(statement->ColumnInt(2)); |
| + int type_with_excutable_bit = statement->ColumnInt(2); |
| record->namespace_.namespace_url = GURL(statement->ColumnString(3)); |
| record->namespace_.target_url = GURL(statement->ColumnString(4)); |
| record->namespace_.is_pattern = statement->ColumnBool(5); |
| + |
| + // Note: quick and dirty storage for the 'executable' bit w/o changing |
| + // schemas, we use the high bit of 'type' field. |
| + record->namespace_.type = static_cast<NamespaceType> |
| + (type_with_excutable_bit & 0x7ffffffff); |
| + record->namespace_.is_executable = |
| + (type_with_excutable_bit & 0x80000000) != 0; |
| } |
| void AppCacheDatabase::ReadOnlineWhiteListRecord( |