Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Unified Diff: components/cronet/android/cronet_url_request_context_adapter.h

Issue 2909663002: [Cronet] Add API to set DNS cache entry
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/cronet/android/cronet_url_request_context_adapter.h
diff --git a/components/cronet/android/cronet_url_request_context_adapter.h b/components/cronet/android/cronet_url_request_context_adapter.h
index b90874ab8dc82245e6caffd1cd4ed9ddbe46d612..e02586d5afe07d70bf8396543762176fba87b874 100644
--- a/components/cronet/android/cronet_url_request_context_adapter.h
+++ b/components/cronet/android/cronet_url_request_context_adapter.h
@@ -18,6 +18,7 @@
#include "base/memory/ref_counted.h"
#include "base/threading/thread.h"
#include "components/prefs/json_pref_store.h"
+#include "net/base/address_list.h"
#include "net/nqe/effective_connection_type.h"
#include "net/nqe/network_quality_estimator.h"
#include "net/nqe/network_quality_observation_source.h"
@@ -133,6 +134,13 @@ class CronetURLRequestContextAdapter
const base::android::JavaParamRef<jobject>& jcaller,
bool should);
+ // Put an entry in the HostCache for a particular host.
+ void PutHostCache(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& jcaller,
+ const base::android::JavaParamRef<jstring>& jhostname,
+ const base::android::JavaParamRef<jobjectArray>& jaddresses,
+ jint jseconds_to_live);
+
private:
friend class TestUtil;
@@ -167,6 +175,9 @@ class CronetURLRequestContextAdapter
void ProvideRTTObservationsOnNetworkThread(bool should);
void ProvideThroughputObservationsOnNetworkThread(bool should);
+ void PutHostCacheOnNetworkThread(std::string hostname,
+ net::AddressList address_list,
+ base::TimeDelta ttl);
// net::NetworkQualityEstimator::EffectiveConnectionTypeObserver
// implementation.

Powered by Google App Engine
This is Rietveld 408576698