Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(847)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java

Issue 2970003003: customtabs: Extract a redirect endpoint, and maybe connect to it. (Closed)
Patch Set: Typo. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java
index 1487e1fc0e1ee71dc3aa8b3d39346c7a17cc69d0..d5038affee870b891b0f1df2acc82d7c7fd8e7db 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java
@@ -493,6 +493,20 @@ class ClientManager {
: params.mSpeculationMode;
}
+ /**
+ * Returns whether an origin is first-party with respect to a session, that is if the
+ * application linked to the session has a relation with the provided origin. This does not
+ * calls OriginVerifier, but only checks the cached relations.
+ *
+ * @param session The session.
+ * @param origin Origin to verify
+ */
+ public synchronized boolean isFirstPartyOriginForSession(
+ CustomTabsSessionToken session, Uri origin) {
+ SessionParams params = mSessionParams.get(session);
+ return params == null ? false : OriginVerifier.isValidOrigin(params.packageName, origin);
+ }
+
/** Tries to bind to a client to keep it alive, and returns true for success. */
public synchronized boolean keepAliveForSession(CustomTabsSessionToken session, Intent intent) {
// When an application is bound to a service, its priority is raised to

Powered by Google App Engine
This is Rietveld 408576698