| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ | 5 #ifndef COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ |
| 6 #define COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ | 6 #define COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 } // namespace base | 22 } // namespace base |
| 23 | 23 |
| 24 namespace net { | 24 namespace net { |
| 25 class NetLogLogger; | 25 class NetLogLogger; |
| 26 class URLRequestContext; | 26 class URLRequestContext; |
| 27 class ProxyConfigService; | 27 class ProxyConfigService; |
| 28 } // namespace net | 28 } // namespace net |
| 29 | 29 |
| 30 namespace cronet { | 30 namespace cronet { |
| 31 | 31 |
| 32 class CronetDataReductionProxy; |
| 32 struct URLRequestContextConfig; | 33 struct URLRequestContextConfig; |
| 33 | 34 |
| 34 bool CronetUrlRequestContextAdapterRegisterJni(JNIEnv* env); | 35 bool CronetUrlRequestContextAdapterRegisterJni(JNIEnv* env); |
| 35 | 36 |
| 36 // Adapter between Java CronetUrlRequestContext and net::URLRequestContext. | 37 // Adapter between Java CronetUrlRequestContext and net::URLRequestContext. |
| 37 class CronetURLRequestContextAdapter { | 38 class CronetURLRequestContextAdapter { |
| 38 public: | 39 public: |
| 39 explicit CronetURLRequestContextAdapter( | 40 explicit CronetURLRequestContextAdapter( |
| 40 scoped_ptr<URLRequestContextConfig> context_config); | 41 scoped_ptr<URLRequestContextConfig> context_config); |
| 41 | 42 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 scoped_ptr<net::URLRequestContext> context_; | 92 scoped_ptr<net::URLRequestContext> context_; |
| 92 scoped_ptr<net::ProxyConfigService> proxy_config_service_; | 93 scoped_ptr<net::ProxyConfigService> proxy_config_service_; |
| 93 | 94 |
| 94 // Context config is only valid untng context is initialized. | 95 // Context config is only valid untng context is initialized. |
| 95 scoped_ptr<URLRequestContextConfig> context_config_; | 96 scoped_ptr<URLRequestContextConfig> context_config_; |
| 96 | 97 |
| 97 // A queue of tasks that need to be run after context has been initialized. | 98 // A queue of tasks that need to be run after context has been initialized. |
| 98 std::queue<base::Closure> tasks_waiting_for_context_; | 99 std::queue<base::Closure> tasks_waiting_for_context_; |
| 99 bool is_context_initialized_; | 100 bool is_context_initialized_; |
| 100 int default_load_flags_; | 101 int default_load_flags_; |
| 102 scoped_ptr<CronetDataReductionProxy> data_reduction_proxy_; |
| 101 | 103 |
| 102 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter); | 104 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter); |
| 103 }; | 105 }; |
| 104 | 106 |
| 105 } // namespace cronet | 107 } // namespace cronet |
| 106 | 108 |
| 107 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ | 109 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ |
| OLD | NEW |