Commit b1e5f6ca authored by Henrique Nakashima's avatar Henrique Nakashima Committed by Commit Bot

Revert "Use ProfileKey instead of Profile in JNI_PrefetchBackgroundTask."

This reverts commit 648e59b2.

Reason for revert: Broke chromium.android/android-jumbo-rel (crbug.com/966508)

Original change's description:
> Use ProfileKey instead of Profile in JNI_PrefetchBackgroundTask.
> 
> Now that the task may run in Reduced Mode, there is not necessarily a
> Profile anymore.
> 
> Bug: 933358
> Change-Id: I58d3d69e724ca058b676cc4ff0b2b7ef24c7792e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1625392
> Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#662650}

TBR=carlosk@chromium.org,hnakashima@chromium.org

Change-Id: Ie9ceefbc06f930745fd20b3005c49a801a799a7c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 933358
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1626962Reviewed-by: default avatarHenrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662721}
parent 4459f6b6
......@@ -8,9 +8,10 @@
#include "base/android/jni_string.h"
#include "base/logging.h"
#include "base/time/time.h"
#include "chrome/browser/android/profile_key_util.h"
#include "chrome/browser/offline_pages/prefetch/prefetch_service_factory.h"
#include "chrome/browser/profiles/profile_key.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_android.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "components/offline_pages/core/prefetch/prefetch_background_task.h"
#include "components/offline_pages/core/prefetch/prefetch_dispatcher.h"
#include "components/offline_pages/core/prefetch/prefetch_service.h"
......@@ -29,11 +30,11 @@ static jboolean JNI_PrefetchBackgroundTask_StartPrefetchTask(
JNIEnv* env,
const JavaParamRef<jobject>& jcaller,
const JavaParamRef<jstring>& gcm_token) {
ProfileKey* profile_key = android::GetMainProfileKey();
DCHECK(profile_key);
Profile* profile = ProfileManager::GetLastUsedProfile();
DCHECK(profile);
PrefetchService* prefetch_service =
PrefetchServiceFactory::GetForKey(profile_key);
PrefetchServiceFactory::GetForKey(profile->GetProfileKey());
if (!prefetch_service)
return false;
......
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