1 // Copyright 2022 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package org.chromium.net.apihelpers; 6 7 import org.chromium.net.UrlResponseInfo; 8 9 /** An interface for classes specifying how Cronet should behave on redirects. */ 10 public interface RedirectHandler { 11 /** 12 * Returns whether the redirect should be followed. 13 * 14 * @param info the response info of the redirect response 15 * @param newLocationUrl the redirect location 16 * @return whether Cronet should follow teh redirect or not 17 */ shouldFollowRedirect(UrlResponseInfo info, String newLocationUrl)18 boolean shouldFollowRedirect(UrlResponseInfo info, String newLocationUrl) throws Exception; 19 } 20