chromium/components/sessions/core/serialized_navigation_entry.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/sessions/core/serialized_navigation_entry.h"

#include <stddef.h>

#include <tuple>
#include <utility>

#include "base/pickle.h"
#include "base/trace_event/memory_usage_estimator.h"
#include "components/sessions/core/serialized_navigation_driver.h"

namespace sessions {

// The previous referrer policy value corresponding to |Never|.
const int kObsoleteReferrerPolicyNever =;

SerializedNavigationEntry::SerializedNavigationEntry() {}

SerializedNavigationEntry::SerializedNavigationEntry(
    const SerializedNavigationEntry& other) = default;

SerializedNavigationEntry::SerializedNavigationEntry(
    SerializedNavigationEntry&& other) noexcept {}

SerializedNavigationEntry::~SerializedNavigationEntry() = default;

SerializedNavigationEntry& SerializedNavigationEntry::operator=(
    const SerializedNavigationEntry& other) = default;

SerializedNavigationEntry& SerializedNavigationEntry::operator=(
    SerializedNavigationEntry&& other) = default;

namespace {

// Helper used by SerializedNavigationEntry::WriteToPickle(). It writes |str| to
// |pickle|, if and only if |str| fits within (|max_bytes| -
// |*bytes_written|).  |bytes_written| is incremented to reflect the
// data written.
//
// TODO(akalin): Unify this with the same function in
// base_session_service.cc.
void WriteStringToPickle(base::Pickle* pickle,
                         int* bytes_written,
                         int max_bytes,
                         const std::string& str) {}

// std::u16string version of WriteStringToPickle.
//
// TODO(akalin): Unify this, too.
void WriteString16ToPickle(base::Pickle* pickle,
                           int* bytes_written,
                           int max_bytes,
                           const std::u16string& str) {}

// A mask used for arbitrary boolean values needed to represent a
// NavigationEntry. Currently only contains HAS_POST_DATA.
//
// NOTE(akalin): We may want to just serialize |has_post_data_|
// directly.  Other bools (|is_overriding_user_agent_|) haven't been
// added to this mask.
enum TypeMask {};

}  // namespace

// Pickle order:
//
// index_
// virtual_url_
// title_
// encoded_page_state_
// transition_type_
//
// Added on later:
//
// type_mask (has_post_data_)
// referrer_url_
// referrer_policy_ (broken, crbug.com/450589)
// original_request_url_
// is_overriding_user_agent_
// timestamp_
// search_terms_ (removed)
// http_status_code_
// referrer_policy_
// extended_info_map_

void SerializedNavigationEntry::WriteToPickle(int max_size,
                                              base::Pickle* pickle) const {}

bool SerializedNavigationEntry::ReadFromPickle(base::PickleIterator* iterator) {}

size_t SerializedNavigationEntry::EstimateMemoryUsage() const {}

}  // namespace sessions