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

Side by Side Diff: components/sessions/core/serialized_navigation_entry.cc

Issue 1551433002: Switch to standard integer types in components/, part 3 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 4 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
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 "components/sessions/core/serialized_navigation_entry.h" 5 #include "components/sessions/core/serialized_navigation_entry.h"
6 6
7 #include <stddef.h>
8
7 #include "base/pickle.h" 9 #include "base/pickle.h"
8 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
9 #include "components/sessions/core/serialized_navigation_driver.h" 11 #include "components/sessions/core/serialized_navigation_driver.h"
10 #include "sync/protocol/session_specifics.pb.h" 12 #include "sync/protocol/session_specifics.pb.h"
11 #include "sync/util/time.h" 13 #include "sync/util/time.h"
12 14
13 namespace sessions { 15 namespace sessions {
14 16
15 const char kSearchTermsKey[] = "search_terms"; 17 const char kSearchTermsKey[] = "search_terms";
16 18
(...skipping 28 matching lines...) Expand all
45 sync_data.obsolete_referrer_policy(), &mapped_referrer_policy)) { 47 sync_data.obsolete_referrer_policy(), &mapped_referrer_policy)) {
46 navigation.referrer_url_ = GURL(sync_data.referrer()); 48 navigation.referrer_url_ = GURL(sync_data.referrer());
47 } else { 49 } else {
48 navigation.referrer_url_ = GURL(); 50 navigation.referrer_url_ = GURL();
49 } 51 }
50 navigation.referrer_policy_ = mapped_referrer_policy; 52 navigation.referrer_policy_ = mapped_referrer_policy;
51 } 53 }
52 navigation.virtual_url_ = GURL(sync_data.virtual_url()); 54 navigation.virtual_url_ = GURL(sync_data.virtual_url());
53 navigation.title_ = base::UTF8ToUTF16(sync_data.title()); 55 navigation.title_ = base::UTF8ToUTF16(sync_data.title());
54 56
55 uint32 transition = 0; 57 uint32_t transition = 0;
56 if (sync_data.has_page_transition()) { 58 if (sync_data.has_page_transition()) {
57 switch (sync_data.page_transition()) { 59 switch (sync_data.page_transition()) {
58 case sync_pb::SyncEnums_PageTransition_LINK: 60 case sync_pb::SyncEnums_PageTransition_LINK:
59 transition = ui::PAGE_TRANSITION_LINK; 61 transition = ui::PAGE_TRANSITION_LINK;
60 break; 62 break;
61 case sync_pb::SyncEnums_PageTransition_TYPED: 63 case sync_pb::SyncEnums_PageTransition_TYPED:
62 transition = ui::PAGE_TRANSITION_TYPED; 64 transition = ui::PAGE_TRANSITION_TYPED;
63 break; 65 break;
64 case sync_pb::SyncEnums_PageTransition_AUTO_BOOKMARK: 66 case sync_pb::SyncEnums_PageTransition_AUTO_BOOKMARK:
65 transition = ui::PAGE_TRANSITION_AUTO_BOOKMARK; 67 transition = ui::PAGE_TRANSITION_AUTO_BOOKMARK;
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 // If the original URL can't be found, leave it empty. 288 // If the original URL can't be found, leave it empty.
287 std::string original_request_url_spec; 289 std::string original_request_url_spec;
288 if (!iterator->ReadString(&original_request_url_spec)) 290 if (!iterator->ReadString(&original_request_url_spec))
289 original_request_url_spec = std::string(); 291 original_request_url_spec = std::string();
290 original_request_url_ = GURL(original_request_url_spec); 292 original_request_url_ = GURL(original_request_url_spec);
291 293
292 // Default to not overriding the user agent if we don't have info. 294 // Default to not overriding the user agent if we don't have info.
293 if (!iterator->ReadBool(&is_overriding_user_agent_)) 295 if (!iterator->ReadBool(&is_overriding_user_agent_))
294 is_overriding_user_agent_ = false; 296 is_overriding_user_agent_ = false;
295 297
296 int64 timestamp_internal_value = 0; 298 int64_t timestamp_internal_value = 0;
297 if (iterator->ReadInt64(&timestamp_internal_value)) { 299 if (iterator->ReadInt64(&timestamp_internal_value)) {
298 timestamp_ = base::Time::FromInternalValue(timestamp_internal_value); 300 timestamp_ = base::Time::FromInternalValue(timestamp_internal_value);
299 } else { 301 } else {
300 timestamp_ = base::Time(); 302 timestamp_ = base::Time();
301 } 303 }
302 304
303 // If the search terms field can't be found, leave it empty. 305 // If the search terms field can't be found, leave it empty.
304 if (!iterator->ReadString16(&search_terms_)) 306 if (!iterator->ReadString16(&search_terms_))
305 search_terms_.clear(); 307 search_terms_.clear();
306 308
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 redirect_chain_[last_entry].spec()); 462 redirect_chain_[last_entry].spec());
461 } 463 }
462 } 464 }
463 465
464 sync_data.set_is_restored(is_restored_); 466 sync_data.set_is_restored(is_restored_);
465 467
466 return sync_data; 468 return sync_data;
467 } 469 }
468 470
469 } // namespace sessions 471 } // namespace sessions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698