summaryrefslogtreecommitdiff
path: root/chromium/content/common/navigation_params.cc
blob: 4d0b164f335ef0653a581bd6fba85f472d85546c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/common/navigation_params.h"
#include "content/common/navigation_params.mojom.h"

namespace content {

mojom::InitiatorCSPInfoPtr CreateInitiatorCSPInfo() {
  return mojom::InitiatorCSPInfo::New(
      network::mojom::CSPDisposition::CHECK,
      std::vector<network::mojom::ContentSecurityPolicyPtr>() /* empty */,
      nullptr /* initiator_self_source */
  );
}

mojom::CommonNavigationParamsPtr CreateCommonNavigationParams() {
  auto common_params = mojom::CommonNavigationParams::New();
  common_params->referrer = blink::mojom::Referrer::New();
  common_params->navigation_start = base::TimeTicks::Now();
  common_params->initiator_csp_info = CreateInitiatorCSPInfo();
  common_params->source_location = network::mojom::SourceLocation::New();

  return common_params;
}

mojom::CommitNavigationParamsPtr CreateCommitNavigationParams() {
  auto commit_params = mojom::CommitNavigationParams::New();
  commit_params->navigation_token = base::UnguessableToken::Create();
  commit_params->navigation_timing = mojom::NavigationTiming::New();

  return commit_params;
}

}  // namespace content