summaryrefslogtreecommitdiff
path: root/chromium/content/browser/webid/webid_utils.h
blob: 2233c99d76fab944fe12dd827af23dfcf340bac6 (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
// Copyright 2021 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.

#ifndef CONTENT_BROWSER_WEBID_WEBID_UTILS_H_
#define CONTENT_BROWSER_WEBID_WEBID_UTILS_H_

#include "url/gurl.h"
#include "url/origin.h"

namespace content {
class RenderFrameHost;

// Determines whether |host| is same-origin with all of its ancestors in the
// frame tree. Returns false if not.
// |origin| is provided because it is not considered safe to use
// host->GetLastCommittedOrigin() at some times, so
// DocumentServiceBase::origin() should be used to obtain the frame's origin.
bool IsSameOriginWithAncestors(RenderFrameHost* host,
                               const url::Origin& origin);

// Checks requirements for URLs received from the IDP.
bool IdpUrlIsValid(const GURL& url);

}  // namespace content
#endif  // CONTENT_BROWSER_WEBID_WEBID_UTILS_H_