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

Unified Diff: content/common/indexed_db/indexed_db_key.cc

Issue 136853003: Explicitly implement copy ctor/assignment operator for IndexedDBKey (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Actually run and pass tests Created 6 years, 11 months 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
« no previous file with comments | « content/common/indexed_db/indexed_db_key.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/indexed_db/indexed_db_key.cc
diff --git a/content/common/indexed_db/indexed_db_key.cc b/content/common/indexed_db/indexed_db_key.cc
index 02610bfe2413adc5563ed1e9610c7d4d41e6c05e..3c511402ddeacef01079fa47faadea7f64b78ced 100644
--- a/content/common/indexed_db/indexed_db_key.cc
+++ b/content/common/indexed_db/indexed_db_key.cc
@@ -50,6 +50,29 @@ IndexedDBKey::IndexedDBKey()
number_(0),
size_estimate_(kOverheadSize) {}
+IndexedDBKey::IndexedDBKey(const IndexedDBKey& other)
+ : type_(other.type_),
+ array_(other.array_),
+ binary_(other.binary_),
+ string_(other.string_),
+ date_(other.date_),
+ number_(other.number_),
+ size_estimate_(other.size_estimate_) {
+ DCHECK((!IsValid() && !other.IsValid()) || Compare(other) == 0);
+}
+
+IndexedDBKey& IndexedDBKey::operator=(const IndexedDBKey& other) {
+ type_ = other.type_;
+ array_ = other.array_;
+ binary_ = other.binary_;
+ string_ = other.string_;
+ date_ = other.date_;
+ number_ = other.number_;
+ size_estimate_ = other.size_estimate_;
+ DCHECK((!IsValid() && !other.IsValid()) || Compare(other) == 0);
+ return *this;
+}
+
IndexedDBKey::IndexedDBKey(WebIDBKeyType type)
: type_(type), date_(0), number_(0), size_estimate_(kOverheadSize) {
DCHECK(type == WebIDBKeyTypeNull || type == WebIDBKeyTypeInvalid);
« no previous file with comments | « content/common/indexed_db/indexed_db_key.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698