OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "webkit/appcache/appcache_database.h" | 5 #include "webkit/appcache/appcache_database.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 if (!transaction.Begin()) | 845 if (!transaction.Begin()) |
846 return false; | 846 return false; |
847 | 847 |
848 sql::Statement statement(db_->GetCachedStatement(statement_id, sql)); | 848 sql::Statement statement(db_->GetCachedStatement(statement_id, sql)); |
849 | 849 |
850 std::vector<int64>::const_iterator iter = ids.begin(); | 850 std::vector<int64>::const_iterator iter = ids.begin(); |
851 while (iter != ids.end()) { | 851 while (iter != ids.end()) { |
852 statement.BindInt64(0, *iter); | 852 statement.BindInt64(0, *iter); |
853 if (!statement.Run()) | 853 if (!statement.Run()) |
854 return false; | 854 return false; |
855 statement.Reset(); | 855 statement.Reset(true); |
856 ++iter; | 856 ++iter; |
857 } | 857 } |
858 | 858 |
859 return transaction.Commit(); | 859 return transaction.Commit(); |
860 } | 860 } |
861 | 861 |
862 bool AppCacheDatabase::RunUniqueStatementWithInt64Result( | 862 bool AppCacheDatabase::RunUniqueStatementWithInt64Result( |
863 const char* sql, int64* result) { | 863 const char* sql, int64* result) { |
864 DCHECK(sql); | 864 DCHECK(sql); |
865 sql::Statement statement(db_->GetUniqueStatement(sql)); | 865 sql::Statement statement(db_->GetUniqueStatement(sql)); |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 | 1125 |
1126 // So we can't go recursive. | 1126 // So we can't go recursive. |
1127 if (is_recreating_) | 1127 if (is_recreating_) |
1128 return false; | 1128 return false; |
1129 | 1129 |
1130 AutoReset<bool> auto_reset(&is_recreating_, true); | 1130 AutoReset<bool> auto_reset(&is_recreating_, true); |
1131 return LazyOpen(true); | 1131 return LazyOpen(true); |
1132 } | 1132 } |
1133 | 1133 |
1134 } // namespace appcache | 1134 } // namespace appcache |
OLD | NEW |