| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 const base::Closure& task_to_run_after_context_init); | 79 const base::Closure& task_to_run_after_context_init); |
| 80 | 80 |
| 81 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() const; | 81 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() const; |
| 82 | 82 |
| 83 void StartNetLogToFileOnNetworkThread(const std::string& file_name); | 83 void StartNetLogToFileOnNetworkThread(const std::string& file_name); |
| 84 | 84 |
| 85 void StopNetLogOnNetworkThread(); | 85 void StopNetLogOnNetworkThread(); |
| 86 | 86 |
| 87 // Network thread is owned by |this|, but is destroyed from java thread. | 87 // Network thread is owned by |this|, but is destroyed from java thread. |
| 88 base::Thread* network_thread_; | 88 base::Thread* network_thread_; |
| 89 // |net_log_logger_| and |context_| should only be accessed on network thread. | 89 // |write_to_file_observer_| and |context_| should only be accessed on |
| 90 scoped_ptr<net::WriteToFileNetLogObserver> net_log_logger_; | 90 // network thread. |
| 91 scoped_ptr<net::WriteToFileNetLogObserver> write_to_file_observer_; |
| 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_; |
| 101 | 102 |
| 102 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter); | 103 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter); |
| 103 }; | 104 }; |
| 104 | 105 |
| 105 } // namespace cronet | 106 } // namespace cronet |
| 106 | 107 |
| 107 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ | 108 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ |
| OLD | NEW |