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

Side by Side Diff: components/cronet/android/cronet_url_request_context_adapter.h

Issue 1133883002: [Cronet] Enable persistence mode for Sdch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@quic_server_remove_loop
Patch Set: Remove pref file support from legacy API Created 5 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 unified diff | Download patch
OLDNEW
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>
11 #include <string> 11 #include <string>
12 12
13 #include "base/android/scoped_java_ref.h" 13 #include "base/android/scoped_java_ref.h"
14 #include "base/callback.h" 14 #include "base/callback.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/memory/scoped_ptr.h" 17 #include "base/memory/scoped_ptr.h"
18 #include "base/prefs/json_pref_store.h"
18 #include "base/threading/thread.h" 19 #include "base/threading/thread.h"
19 20
20 namespace base { 21 namespace base {
21 class SingleThreadTaskRunner; 22 class SingleThreadTaskRunner;
22 } // namespace base 23 } // namespace base
23 24
24 namespace net { 25 namespace net {
25 class WriteToFileNetLogObserver; 26 class WriteToFileNetLogObserver;
26 class URLRequestContext; 27 class URLRequestContext;
27 class ProxyConfigService; 28 class ProxyConfigService;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 87
87 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() const; 88 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() const;
88 89
89 void StartNetLogToFileOnNetworkThread(const std::string& file_name, 90 void StartNetLogToFileOnNetworkThread(const std::string& file_name,
90 bool log_all); 91 bool log_all);
91 92
92 void StopNetLogOnNetworkThread(); 93 void StopNetLogOnNetworkThread();
93 94
94 // Network thread is owned by |this|, but is destroyed from java thread. 95 // Network thread is owned by |this|, but is destroyed from java thread.
95 base::Thread* network_thread_; 96 base::Thread* network_thread_;
97
98 // File thread should be destroyed last.
99 scoped_ptr<base::Thread> file_thread_;
100
96 // |write_to_file_observer_| and |context_| should only be accessed on 101 // |write_to_file_observer_| and |context_| should only be accessed on
97 // network thread. 102 // network thread.
98 scoped_ptr<net::WriteToFileNetLogObserver> write_to_file_observer_; 103 scoped_ptr<net::WriteToFileNetLogObserver> write_to_file_observer_;
99 scoped_ptr<net::URLRequestContext> context_; 104 scoped_ptr<net::URLRequestContext> context_;
100 scoped_ptr<net::ProxyConfigService> proxy_config_service_; 105 scoped_ptr<net::ProxyConfigService> proxy_config_service_;
106
107 // |sdch_owner_| should be destroyed before |json_pref_store_|, because
108 // tearing down |sdch_owner_| forces |json_pref_store_| to flush pending
109 // writes to the disk.
110 scoped_refptr<JsonPrefStore> json_pref_store_;
101 scoped_ptr<net::SdchOwner> sdch_owner_; 111 scoped_ptr<net::SdchOwner> sdch_owner_;
102 112
103 // Context config is only valid untng context is initialized. 113 // Context config is only valid untng context is initialized.
104 scoped_ptr<URLRequestContextConfig> context_config_; 114 scoped_ptr<URLRequestContextConfig> context_config_;
105 115
106 // A queue of tasks that need to be run after context has been initialized. 116 // A queue of tasks that need to be run after context has been initialized.
107 std::queue<base::Closure> tasks_waiting_for_context_; 117 std::queue<base::Closure> tasks_waiting_for_context_;
108 bool is_context_initialized_; 118 bool is_context_initialized_;
109 int default_load_flags_; 119 int default_load_flags_;
110 120
111 #if defined(DATA_REDUCTION_PROXY_SUPPORT) 121 #if defined(DATA_REDUCTION_PROXY_SUPPORT)
112 scoped_ptr<CronetDataReductionProxy> data_reduction_proxy_; 122 scoped_ptr<CronetDataReductionProxy> data_reduction_proxy_;
113 #endif 123 #endif
114 124
115 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter); 125 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter);
116 }; 126 };
117 127
118 } // namespace cronet 128 } // namespace cronet
119 129
120 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ 130 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698