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

Side by Side Diff: content/browser/dom_storage/session_storage_database.cc

Issue 113403006: Update some uses of char16 to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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 | Annotate | Revision Log
OLDNEW
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/browser/dom_storage/session_storage_database.h" 5 #include "content/browser/dom_storage/session_storage_database.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 break; 571 break;
572 } 572 }
573 // Key is of the form "map-<mapid>-<key>". 573 // Key is of the form "map-<mapid>-<key>".
574 base::string16 key16 = 574 base::string16 key16 =
575 base::UTF8ToUTF16(key.substr(map_start_key.length())); 575 base::UTF8ToUTF16(key.substr(map_start_key.length()));
576 if (only_keys) { 576 if (only_keys) {
577 (*result)[key16] = base::NullableString16(); 577 (*result)[key16] = base::NullableString16();
578 } else { 578 } else {
579 // Convert the raw data stored in std::string (it->value()) to raw data 579 // Convert the raw data stored in std::string (it->value()) to raw data
580 // stored in base::string16. 580 // stored in base::string16.
581 size_t len = it->value().size() / sizeof(char16); 581 size_t len = it->value().size() / sizeof(base::char16);
582 const char16* data_ptr = 582 const base::char16* data_ptr =
583 reinterpret_cast<const char16*>(it->value().data()); 583 reinterpret_cast<const base::char16*>(it->value().data());
584 (*result)[key16] = 584 (*result)[key16] =
585 base::NullableString16(base::string16(data_ptr, len), false); 585 base::NullableString16(base::string16(data_ptr, len), false);
586 } 586 }
587 } 587 }
588 return true; 588 return true;
589 } 589 }
590 590
591 void SessionStorageDatabase::WriteValuesToMap(const std::string& map_id, 591 void SessionStorageDatabase::WriteValuesToMap(const std::string& map_id,
592 const DOMStorageValuesMap& values, 592 const DOMStorageValuesMap& values,
593 leveldb::WriteBatch* batch) { 593 leveldb::WriteBatch* batch) {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 std::string SessionStorageDatabase::MapKey(const std::string& map_id, 720 std::string SessionStorageDatabase::MapKey(const std::string& map_id,
721 const std::string& key) { 721 const std::string& key) {
722 return base::StringPrintf("map-%s-%s", map_id.c_str(), key.c_str()); 722 return base::StringPrintf("map-%s-%s", map_id.c_str(), key.c_str());
723 } 723 }
724 724
725 const char* SessionStorageDatabase::NextMapIdKey() { 725 const char* SessionStorageDatabase::NextMapIdKey() {
726 return "next-map-id"; 726 return "next-map-id";
727 } 727 }
728 728
729 } // namespace content 729 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/dom_storage/dom_storage_database.cc ('k') | content/browser/dom_storage/session_storage_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698