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

Side by Side Diff: content/browser/indexed_db/indexed_db_database.cc

Issue 73153003: Remove dead code from IDB (chromium side) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang format to fix long lines Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "content/browser/indexed_db/indexed_db_database.h" 5 #include "content/browser/indexed_db/indexed_db_database.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 const int64 transaction_id_; 78 const int64 transaction_id_;
79 }; 79 };
80 80
81 // PendingSuccessCall has a IndexedDBConnection* because the connection is now 81 // PendingSuccessCall has a IndexedDBConnection* because the connection is now
82 // owned elsewhere, but we need to cancel the success call if that connection 82 // owned elsewhere, but we need to cancel the success call if that connection
83 // closes before it is sent. 83 // closes before it is sent.
84 class IndexedDBDatabase::PendingSuccessCall { 84 class IndexedDBDatabase::PendingSuccessCall {
85 public: 85 public:
86 PendingSuccessCall(scoped_refptr<IndexedDBCallbacks> callbacks, 86 PendingSuccessCall(scoped_refptr<IndexedDBCallbacks> callbacks,
87 IndexedDBConnection* connection, 87 IndexedDBConnection* connection,
88 int64 transaction_id,
89 int64 version) 88 int64 version)
90 : callbacks_(callbacks), 89 : callbacks_(callbacks), connection_(connection), version_(version) {}
91 connection_(connection),
92 version_(version),
93 transaction_id_(transaction_id) {}
94 scoped_refptr<IndexedDBCallbacks> Callbacks() { return callbacks_; } 90 scoped_refptr<IndexedDBCallbacks> Callbacks() { return callbacks_; }
95 IndexedDBConnection* Connection() { return connection_; } 91 IndexedDBConnection* Connection() { return connection_; }
96 int64 Version() { return version_; } 92 int64 Version() { return version_; }
97 int64 TransactionId() const { return transaction_id_; }
98 93
99 private: 94 private:
100 scoped_refptr<IndexedDBCallbacks> callbacks_; 95 scoped_refptr<IndexedDBCallbacks> callbacks_;
101 IndexedDBConnection* connection_; 96 IndexedDBConnection* connection_;
102 int64 version_; 97 int64 version_;
103 const int64 transaction_id_;
104 }; 98 };
105 99
106 class IndexedDBDatabase::PendingDeleteCall { 100 class IndexedDBDatabase::PendingDeleteCall {
107 public: 101 public:
108 explicit PendingDeleteCall(scoped_refptr<IndexedDBCallbacks> callbacks) 102 explicit PendingDeleteCall(scoped_refptr<IndexedDBCallbacks> callbacks)
109 : callbacks_(callbacks) {} 103 : callbacks_(callbacks) {}
110 scoped_refptr<IndexedDBCallbacks> Callbacks() { return callbacks_; } 104 scoped_refptr<IndexedDBCallbacks> Callbacks() { return callbacks_; }
111 105
112 private: 106 private:
113 scoped_refptr<IndexedDBCallbacks> callbacks_; 107 scoped_refptr<IndexedDBCallbacks> callbacks_;
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 IndexedDBDatabaseError error( 1245 IndexedDBDatabaseError error(
1252 blink::WebIDBDatabaseExceptionUnknownError, 1246 blink::WebIDBDatabaseExceptionUnknownError,
1253 ASCIIToUTF16( 1247 ASCIIToUTF16(
1254 "Internal error writing data to stable storage when " 1248 "Internal error writing data to stable storage when "
1255 "updating version.")); 1249 "updating version."));
1256 callbacks->OnError(error); 1250 callbacks->OnError(error);
1257 transaction->Abort(error); 1251 transaction->Abort(error);
1258 return; 1252 return;
1259 } 1253 }
1260 DCHECK(!pending_second_half_open_); 1254 DCHECK(!pending_second_half_open_);
1261 pending_second_half_open_.reset(new PendingSuccessCall( 1255 pending_second_half_open_.reset(
1262 callbacks, connection.get(), transaction->id(), version)); 1256 new PendingSuccessCall(callbacks, connection.get(), version));
1263 callbacks->OnUpgradeNeeded( 1257 callbacks->OnUpgradeNeeded(
1264 old_version, connection.Pass(), metadata(), data_loss, data_loss_message); 1258 old_version, connection.Pass(), metadata(), data_loss, data_loss_message);
1265 } 1259 }
1266 1260
1267 void IndexedDBDatabase::TransactionStarted(IndexedDBTransaction* transaction) { 1261 void IndexedDBDatabase::TransactionStarted(IndexedDBTransaction* transaction) {
1268 1262
1269 if (transaction->mode() == indexed_db::TRANSACTION_VERSION_CHANGE) { 1263 if (transaction->mode() == indexed_db::TRANSACTION_VERSION_CHANGE) {
1270 DCHECK(!running_version_change_transaction_); 1264 DCHECK(!running_version_change_transaction_);
1271 running_version_change_transaction_ = transaction; 1265 running_version_change_transaction_ = transaction;
1272 } 1266 }
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1723 const string16& previous_version, 1717 const string16& previous_version,
1724 int64 previous_int_version, 1718 int64 previous_int_version,
1725 IndexedDBTransaction* transaction) { 1719 IndexedDBTransaction* transaction) {
1726 IDB_TRACE("IndexedDBDatabase::VersionChangeAbortOperation"); 1720 IDB_TRACE("IndexedDBDatabase::VersionChangeAbortOperation");
1727 DCHECK(!transaction); 1721 DCHECK(!transaction);
1728 metadata_.version = previous_version; 1722 metadata_.version = previous_version;
1729 metadata_.int_version = previous_int_version; 1723 metadata_.int_version = previous_int_version;
1730 } 1724 }
1731 1725
1732 } // namespace content 1726 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_context_impl.h ('k') | content/browser/indexed_db/indexed_db_dispatcher_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698