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

Side by Side Diff: content/common/page_state_serialization.cc

Issue 121033002: Update uses of UTF conversions in content/ 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/common/page_state_serialization.h" 5 #include "content/common/page_state_serialization.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/pickle.h" 10 #include "base/pickle.h"
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 WriteFrameState(state.top, obj, true); 609 WriteFrameState(state.top, obj, true);
610 } 610 }
611 611
612 void ReadPageState(SerializeObject* obj, ExplodedPageState* state) { 612 void ReadPageState(SerializeObject* obj, ExplodedPageState* state) {
613 obj->version = ReadInteger(obj); 613 obj->version = ReadInteger(obj);
614 614
615 if (obj->version == -1) { 615 if (obj->version == -1) {
616 GURL url = ReadGURL(obj); 616 GURL url = ReadGURL(obj);
617 // NOTE: GURL::possibly_invalid_spec() always returns valid UTF-8. 617 // NOTE: GURL::possibly_invalid_spec() always returns valid UTF-8.
618 state->top.url_string = state->top.original_url_string = 618 state->top.url_string = state->top.original_url_string =
619 base::NullableString16(UTF8ToUTF16(url.possibly_invalid_spec()), false); 619 base::NullableString16(
620 base::UTF8ToUTF16(url.possibly_invalid_spec()), false);
620 return; 621 return;
621 } 622 }
622 623
623 if (obj->version > kCurrentVersion || obj->version < kMinVersion) { 624 if (obj->version > kCurrentVersion || obj->version < kMinVersion) {
624 obj->parse_error = true; 625 obj->parse_error = true;
625 return; 626 return;
626 } 627 }
627 628
628 if (obj->version >= 14) 629 if (obj->version >= 14)
629 ReadStringVector(obj, &state->referenced_files); 630 ReadStringVector(obj, &state->referenced_files);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 float device_scale_factor, 703 float device_scale_factor,
703 ExplodedPageState* exploded) { 704 ExplodedPageState* exploded) {
704 g_device_scale_factor_for_testing = device_scale_factor; 705 g_device_scale_factor_for_testing = device_scale_factor;
705 bool rv = DecodePageState(encoded, exploded); 706 bool rv = DecodePageState(encoded, exploded);
706 g_device_scale_factor_for_testing = 0.0; 707 g_device_scale_factor_for_testing = 0.0;
707 return rv; 708 return rv;
708 } 709 }
709 #endif 710 #endif
710 711
711 } // namespace content 712 } // namespace content
OLDNEW
« no previous file with comments | « content/common/mac/font_descriptor_unittest.mm ('k') | content/common/page_state_serialization_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698