Commit 71938837 authored by Side Yilmaz's avatar Side Yilmaz Committed by Commit Bot

Replace deprecated getLastUsedProfile function in CustomTabsConnection.

|Profile#getLastUsedProfile| is depreciated and replaced with
|Profile#getLastUsedRegularProfile|. This CL updates
CustomTabsConnection class.

Note: This change is only code clean-up, does not change any behaviour.

Bug: 1041781
Change-Id: I9975720d600ac22910d3971eb2e244eb86c30b46
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2144089Reviewed-by: default avatarRamin Halavati <rhalavati@chromium.org>
Reviewed-by: default avatarBenoit L <lizeb@chromium.org>
Commit-Queue: Side YILMAZ <sideyilmaz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759992}
parent 8d96013f
......@@ -445,7 +445,7 @@ public class CustomTabsConnection {
tasks.add(UiThreadTaskTraits.BOOTSTRAP, () -> {
try (TraceEvent e = TraceEvent.scoped("WarmupInternalFinishInitialization")) {
// (4)
Profile profile = Profile.getLastUsedProfile();
Profile profile = Profile.getLastUsedRegularProfile();
WarmupManager.startPreconnectPredictorInitialization(profile);
// (5)
......@@ -618,7 +618,7 @@ public class CustomTabsConnection {
String[] urlsArray = urlsList.toArray(new String[0]);
WarmupManager.reportNextLikelyNavigationsOnUiThread(
Profile.getLastUsedProfile(), packages, urlsArray);
Profile.getLastUsedRegularProfile(), packages, urlsArray);
});
}
......@@ -629,7 +629,7 @@ public class CustomTabsConnection {
try (TraceEvent e = TraceEvent.scoped("CustomTabsConnection.mayLaunchUrlOnUiThread")) {
// doMayLaunchUrlInternal() is always called once the native level initialization is
// done, at least the initial profile load. However, at that stage the startup callback
// may not have run, which causes Profile.getLastUsedProfile() to throw an
// may not have run, which causes Profile.getLastUsedRegularProfile() to throw an
// exception. But the tasks have been posted by then, so reschedule ourselves, only
// once.
if (!BrowserStartupController.getInstance().isFullBrowserStarted()) {
......@@ -896,7 +896,7 @@ public class CustomTabsConnection {
if (!mClientManager.isFirstPartyOriginForSession(session, origin)) return;
WarmupManager.getInstance().maybePreconnectUrlAndSubResources(
Profile.getLastUsedProfile(), redirectEndpoint.toString());
Profile.getLastUsedRegularProfile(), redirectEndpoint.toString());
}
@VisibleForTesting
......@@ -964,7 +964,7 @@ public class CustomTabsConnection {
String urlString = url.toString();
String referrerString = referrer.toString();
CustomTabsConnectionJni.get().createAndStartDetachedResourceRequest(
Profile.getLastUsedProfile(), session, urlString, referrerString, policy,
Profile.getLastUsedRegularProfile(), session, urlString, referrerString, policy,
DetachedResourceRequestMotivation.PARALLEL_REQUEST);
if (mLogRequests) {
Log.w(TAG, "startParallelRequest(%s, %s, %d)", urlString, referrerString, policy);
......@@ -1006,7 +1006,7 @@ public class CustomTabsConnection {
// Session is null because we don't need completion notifications.
CustomTabsConnectionJni.get().createAndStartDetachedResourceRequest(
Profile.getLastUsedProfile(), null, urlString, referrerString, policy,
Profile.getLastUsedRegularProfile(), null, urlString, referrerString, policy,
DetachedResourceRequestMotivation.RESOURCE_PREFETCH);
++requestsSent;
......@@ -1488,7 +1488,7 @@ public class CustomTabsConnection {
private void startSpeculation(CustomTabsSessionToken session, String url, boolean useHiddenTab,
Bundle extras, int uid) {
WarmupManager warmupManager = WarmupManager.getInstance();
Profile profile = Profile.getLastUsedProfile();
Profile profile = Profile.getLastUsedRegularProfile();
// At most one on-going speculation, clears the previous one.
cancelSpeculation(null);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment