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

Side by Side Diff: content/common/indexed_db/indexed_db_key.cc

Issue 933823002: Avoid large inlined automatic methods in IndexedDB code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One more CONTENT_EXPORT Created 5 years, 10 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 unified diff | Download patch
OLDNEW
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 "content/common/indexed_db/indexed_db_key.h" 5 #include "content/common/indexed_db/indexed_db_key.h"
6 6
7 #include <string> 7 #include <string>
8 #include "base/logging.h" 8 #include "base/logging.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 binary_(binary), 85 binary_(binary),
86 size_estimate_(kOverheadSize + 86 size_estimate_(kOverheadSize +
87 (binary.length() * sizeof(std::string::value_type))) {} 87 (binary.length() * sizeof(std::string::value_type))) {}
88 88
89 IndexedDBKey::IndexedDBKey(const base::string16& string) 89 IndexedDBKey::IndexedDBKey(const base::string16& string)
90 : type_(WebIDBKeyTypeString), 90 : type_(WebIDBKeyTypeString),
91 string_(string), 91 string_(string),
92 size_estimate_(kOverheadSize + 92 size_estimate_(kOverheadSize +
93 (string.length() * sizeof(base::string16::value_type))) {} 93 (string.length() * sizeof(base::string16::value_type))) {}
94 94
95 IndexedDBKey::~IndexedDBKey() {} 95 IndexedDBKey::IndexedDBKey(const IndexedDBKey& other) = default;
96 IndexedDBKey::~IndexedDBKey() = default;
97 IndexedDBKey& IndexedDBKey::operator=(const IndexedDBKey& other) = default;
96 98
97 bool IndexedDBKey::IsValid() const { 99 bool IndexedDBKey::IsValid() const {
98 if (type_ == WebIDBKeyTypeInvalid || type_ == WebIDBKeyTypeNull) 100 if (type_ == WebIDBKeyTypeInvalid || type_ == WebIDBKeyTypeNull)
99 return false; 101 return false;
100 102
101 if (type_ == WebIDBKeyTypeArray) { 103 if (type_ == WebIDBKeyTypeArray) {
102 for (size_t i = 0; i < array_.size(); i++) { 104 for (size_t i = 0; i < array_.size(); i++) {
103 if (!array_[i].IsValid()) 105 if (!array_[i].IsValid())
104 return false; 106 return false;
105 } 107 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 case WebIDBKeyTypeInvalid: 143 case WebIDBKeyTypeInvalid:
142 case WebIDBKeyTypeNull: 144 case WebIDBKeyTypeNull:
143 case WebIDBKeyTypeMin: 145 case WebIDBKeyTypeMin:
144 default: 146 default:
145 NOTREACHED(); 147 NOTREACHED();
146 return 0; 148 return 0;
147 } 149 }
148 } 150 }
149 151
150 } // namespace content 152 } // namespace content
OLDNEW
« no previous file with comments | « content/common/indexed_db/indexed_db_key.h ('k') | content/common/indexed_db/indexed_db_key_path.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698