Commit 662e9508 authored by jsbell@chromium.org's avatar jsbell@chromium.org

Explicitly implement copy ctor/assignment operator for IndexedDBKey

The implicit implementations by the compiler are inlined, and lead
to ~8k of unnecessary code.

R=bratell@opera.com
BUG=333205

Review URL: https://codereview.chromium.org/136853003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244576 0039d316-1c4b-4281-b951-d872f2087c98
parent 1f3f89a7
...@@ -50,6 +50,29 @@ IndexedDBKey::IndexedDBKey() ...@@ -50,6 +50,29 @@ IndexedDBKey::IndexedDBKey()
number_(0), number_(0),
size_estimate_(kOverheadSize) {} 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) IndexedDBKey::IndexedDBKey(WebIDBKeyType type)
: type_(type), date_(0), number_(0), size_estimate_(kOverheadSize) { : type_(type), date_(0), number_(0), size_estimate_(kOverheadSize) {
DCHECK(type == WebIDBKeyTypeNull || type == WebIDBKeyTypeInvalid); DCHECK(type == WebIDBKeyTypeNull || type == WebIDBKeyTypeInvalid);
......
...@@ -24,6 +24,9 @@ class CONTENT_EXPORT IndexedDBKey { ...@@ -24,6 +24,9 @@ class CONTENT_EXPORT IndexedDBKey {
typedef std::vector<IndexedDBKey> KeyArray; typedef std::vector<IndexedDBKey> KeyArray;
IndexedDBKey(); // Defaults to blink::WebIDBKeyTypeInvalid. IndexedDBKey(); // Defaults to blink::WebIDBKeyTypeInvalid.
IndexedDBKey(const IndexedDBKey& other);
IndexedDBKey& operator=(const IndexedDBKey& other);
IndexedDBKey(blink::WebIDBKeyType); // must be Null or Invalid IndexedDBKey(blink::WebIDBKeyType); // must be Null or Invalid
explicit IndexedDBKey(const KeyArray& array); explicit IndexedDBKey(const KeyArray& array);
explicit IndexedDBKey(const std::string& binary); explicit IndexedDBKey(const std::string& binary);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment