Switch global error menu icon to vectorized MD asset
[chromium-blink-merge.git] / chrome / browser / android / warmup_manager.cc
blobb5d82b62f82969102d7e23119d5e78c167ecf5cb
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/android/warmup_manager.h"
7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h"
9 #include "chrome/browser/net/predictor.h"
10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/profiles/profile_android.h"
12 #include "jni/WarmupManager_jni.h"
13 #include "url/gurl.h"
16 static void PreconnectUrlAndSubresources(JNIEnv* env, jclass clazz,
17 jobject jprofile, jstring url_str) {
18 if (url_str) {
19 GURL url = GURL(base::android::ConvertJavaStringToUTF8(env, url_str));
20 Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile);
21 if (profile) {
22 profile->GetNetworkPredictor()->PreconnectUrlAndSubresources(url, GURL());
28 // Register native methods.
29 bool RegisterWarmupManager(JNIEnv* env) {
30 return RegisterNativesImpl(env);