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

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

Issue 937513003: Add Data Saver support to Cronet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 da44d0f533fe0a644bd1d309059e39750b2514dc..d45422aaf2ee4c5cd71c1c2cd99dbd114e911fcd 100644
--- a/components/cronet/android/cronet_url_request_context_adapter.h
+++ b/components/cronet/android/cronet_url_request_context_adapter.h
@@ -15,15 +15,25 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/prefs/pref_service.h"
#include "base/threading/thread.h"
+#include "net/base/net_log.h"
+#include "net/base/network_change_notifier.h"
namespace base {
class SingleThreadTaskRunner;
} // namespace base
+namespace data_reduction_proxy {
+class DataReductionProxyIOData;
+class DataReductionProxySettings;
+}
+
namespace net {
+class NetLog;
class NetLogLogger;
class URLRequestContext;
+class URLRequestContextGetter;
class ProxyConfigService;
} // namespace net
@@ -70,9 +80,12 @@ class CronetURLRequestContextAdapter {
private:
// Initializes |context_| on the Network thread.
void InitializeOnNetworkThread(scoped_ptr<URLRequestContextConfig> config,
+ scoped_ptr<net::NetLog> net_log,
const base::android::ScopedJavaGlobalRef<
jobject>& jcronet_url_request_context);
+ void DestroyOnMainThread();
+
// Runs a task that might depend on the context being initialized.
// This method should only be run on the network thread.
void RunTaskAfterContextInitOnNetworkThread(
@@ -80,6 +93,8 @@ class CronetURLRequestContextAdapter {
scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() const;
+ void InitializeDataReductionProxyOnMainThread(bool enable);
+
void StartNetLogToFileOnNetworkThread(const std::string& file_name);
void StopNetLogOnNetworkThread();
@@ -98,6 +113,15 @@ class CronetURLRequestContextAdapter {
std::queue<base::Closure> tasks_waiting_for_context_;
bool is_context_initialized_;
int default_load_flags_;
+ scoped_ptr<PrefService> prefs_;
+ scoped_refptr<base::MessageLoopProxy> ui_task_runner_;
+ scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
+
+ scoped_ptr<data_reduction_proxy::DataReductionProxyIOData>
+ data_reduction_proxy_io_data_;
+ scoped_ptr<data_reduction_proxy::DataReductionProxySettings>
+ data_reduction_proxy_settings_;
+
DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter);
};

Powered by Google App Engine
This is Rietveld 408576698