| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/common/dom_storage/dom_storage_map.h" | 5 #include "content/common/dom_storage/dom_storage_map.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 size_t size_of_item(const base::string16& key, const base::string16& value) { | 13 size_t size_of_item(const base::string16& key, const base::string16& value) { |
| 14 return (key.length() + value.length()) * sizeof(char16); | 14 return (key.length() + value.length()) * sizeof(base::char16); |
| 15 } | 15 } |
| 16 | 16 |
| 17 size_t CountBytes(const DOMStorageValuesMap& values) { | 17 size_t CountBytes(const DOMStorageValuesMap& values) { |
| 18 if (values.size() == 0) | 18 if (values.size() == 0) |
| 19 return 0; | 19 return 0; |
| 20 | 20 |
| 21 size_t count = 0; | 21 size_t count = 0; |
| 22 DOMStorageValuesMap::const_iterator it = values.begin(); | 22 DOMStorageValuesMap::const_iterator it = values.begin(); |
| 23 for (; it != values.end(); ++it) | 23 for (; it != values.end(); ++it) |
| 24 count += size_of_item(it->first, it->second.string()); | 24 count += size_of_item(it->first, it->second.string()); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 copy->ResetKeyIterator(); | 113 copy->ResetKeyIterator(); |
| 114 return copy; | 114 return copy; |
| 115 } | 115 } |
| 116 | 116 |
| 117 void DOMStorageMap::ResetKeyIterator() { | 117 void DOMStorageMap::ResetKeyIterator() { |
| 118 key_iterator_ = values_.begin(); | 118 key_iterator_ = values_.begin(); |
| 119 last_key_index_ = 0; | 119 last_key_index_ = 0; |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace content | 122 } // namespace content |
| OLD | NEW |