blob: cb37770e69ffbbee0e1415944ba8a3957392c83a [file] [log] [blame]
Avi Drissman4e1b7bc32022-09-15 14:03:501// Copyright 2022 The Chromium Authors
Asami Doi676926132022-03-17 02:44:362// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Sreeja Kamishettyc227f7a2022-07-08 22:33:155#ifndef CONTENT_BROWSER_PRELOADING_PRERENDER_PRERENDER_NAVIGATION_UTILS_H_
6#define CONTENT_BROWSER_PRELOADING_PRERENDER_PRERENDER_NAVIGATION_UTILS_H_
Asami Doi676926132022-03-17 02:44:367
Robert Lin20d947ed2022-08-25 06:01:288#include "url/gurl.h"
9#include "url/origin.h"
10
Asami Doi676926132022-03-17 02:44:3611namespace content::prerender_navigation_utils {
12
Asami Doi2a0b5072022-04-25 08:23:4213// Returns true if the response code is disallowed for pre-rendering (e.g 404,
14// etc), and false otherwise. This should be called only for the response of the
15// main frame in a prerendered page.
Asami Doi676926132022-03-17 02:44:3616bool IsDisallowedHttpResponseCode(int response_code);
17
Hiroki Nakagawaa04ae182023-03-23 06:00:4518// Returns true if `target_url` is in the same site as `origin`.
Robert Lin20d947ed2022-08-25 06:01:2819bool IsSameSite(const GURL& target_url, const url::Origin& origin);
20
Hiroki Nakagawaa04ae182023-03-23 06:00:4521// Returns true if `target_url` is in the same site cross origin as `origin`.
22bool IsSameSiteCrossOrigin(const GURL& target_url, const url::Origin& origin);
23
24// Returns true if `target_url` is not in the same site as `origin`.
Hiroki Nakagawa849e9202c2023-03-22 08:19:1725bool IsCrossSite(const GURL& target_url, const url::Origin& origin);
26
Asami Doi676926132022-03-17 02:44:3627} // namespace content::prerender_navigation_utils
28
Sreeja Kamishettyc227f7a2022-07-08 22:33:1529#endif // CONTENT_BROWSER_PRELOADING_PRERENDER_PRERENDER_NAVIGATION_UTILS_H_