#include "chrome/browser/sessions/chrome_serialized_navigation_driver.h"
#include "base/memory/singleton.h"
#include "build/build_config.h"
#include "chrome/common/url_constants.h"
#include "components/sessions/core/serialized_navigation_entry.h"
#include "content/public/common/referrer.h"
#if BUILDFLAG(IS_ANDROID)
#include "content/public/common/content_features.h"
#include "third_party/blink/public/common/page_state/page_state.h"
#endif
namespace {
#if BUILDFLAG(IS_ANDROID)
void ChangeDestination(const GURL& new_destination_url,
sessions::SerializedNavigationEntry* navigation) {
navigation->set_virtual_url(new_destination_url);
navigation->set_original_request_url(new_destination_url);
navigation->set_encoded_page_state(
blink::PageState::CreateFromURL(new_destination_url).ToEncodedData());
navigation->set_referrer_url(GURL());
navigation->set_referrer_policy(
static_cast<int>(network::mojom::ReferrerPolicy::kDefault));
}
#endif
}
ChromeSerializedNavigationDriver::~ChromeSerializedNavigationDriver() { … }
ChromeSerializedNavigationDriver*
ChromeSerializedNavigationDriver::GetInstance() { … }
void ChromeSerializedNavigationDriver::Sanitize(
sessions::SerializedNavigationEntry* navigation) const { … }
ChromeSerializedNavigationDriver::ChromeSerializedNavigationDriver() { … }