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

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

Issue 2776633003: Add taskid for navigation, created in session sync (Closed)
Patch Set: comments and refactoring Created 3 years, 8 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> 7 #include <stddef.h>
8 8
9 #include "base/pickle.h" 9 #include "base/pickle.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 } 491 }
492 // If the last URL didn't match the virtual_url, record it separately. 492 // If the last URL didn't match the virtual_url, record it separately.
493 if (sync_data.virtual_url() != redirect_chain_[last_entry].spec()) { 493 if (sync_data.virtual_url() != redirect_chain_[last_entry].spec()) {
494 sync_data.set_last_navigation_redirect_url( 494 sync_data.set_last_navigation_redirect_url(
495 redirect_chain_[last_entry].spec()); 495 redirect_chain_[last_entry].spec());
496 } 496 }
497 } 497 }
498 498
499 sync_data.set_is_restored(is_restored_); 499 sync_data.set_is_restored(is_restored_);
500 500
501 sync_pb::TaskId task_id;
502 for (const auto& node_id : task_id_)
503 task_id.add_task_node_id(node_id);
504 *sync_data.mutable_task_id() = task_id;
505
501 return sync_data; 506 return sync_data;
502 } 507 }
503 508
504 size_t SerializedNavigationEntry::EstimateMemoryUsage() const { 509 size_t SerializedNavigationEntry::EstimateMemoryUsage() const {
505 using base::trace_event::EstimateMemoryUsage; 510 using base::trace_event::EstimateMemoryUsage;
506 return 511 return EstimateMemoryUsage(referrer_url_) +
507 EstimateMemoryUsage(referrer_url_) + 512 EstimateMemoryUsage(virtual_url_) + EstimateMemoryUsage(title_) +
508 EstimateMemoryUsage(virtual_url_) + 513 EstimateMemoryUsage(encoded_page_state_) +
509 EstimateMemoryUsage(title_) + 514 EstimateMemoryUsage(original_request_url_) +
510 EstimateMemoryUsage(encoded_page_state_) + 515 EstimateMemoryUsage(search_terms_) +
511 EstimateMemoryUsage(original_request_url_) + 516 EstimateMemoryUsage(favicon_url_) +
512 EstimateMemoryUsage(search_terms_) + 517 EstimateMemoryUsage(redirect_chain_) +
513 EstimateMemoryUsage(favicon_url_) + 518 EstimateMemoryUsage(content_pack_categories_) +
514 EstimateMemoryUsage(redirect_chain_) + 519 EstimateMemoryUsage(extended_info_map_) +
515 EstimateMemoryUsage(content_pack_categories_) + 520 EstimateMemoryUsage(task_id_);
516 EstimateMemoryUsage(extended_info_map_);
517 } 521 }
518 522
519 } // namespace sessions 523 } // namespace sessions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698