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 |