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

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

Issue 1175733002: [Cronet] Set up HttpServerPropertiesManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass ownership to storage and keep a raw ptr Created 5 years, 5 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/prefs/json_pref_store.h"
19 #include "base/threading/thread.h" 19 #include "base/threading/thread.h"
20 20
21 class PrefService;
22
21 namespace base { 23 namespace base {
22 class SingleThreadTaskRunner; 24 class SingleThreadTaskRunner;
23 } // namespace base 25 } // namespace base
24 26
25 namespace net { 27 namespace net {
26 class WriteToFileNetLogObserver; 28 class HttpServerPropertiesManager;
27 class URLRequestContext;
28 class ProxyConfigService; 29 class ProxyConfigService;
29 class SdchOwner; 30 class SdchOwner;
31 class URLRequestContext;
32 class WriteToFileNetLogObserver;
30 } // namespace net 33 } // namespace net
31 34
32 namespace cronet { 35 namespace cronet {
33 36
34 #if defined(DATA_REDUCTION_PROXY_SUPPORT) 37 #if defined(DATA_REDUCTION_PROXY_SUPPORT)
35 class CronetDataReductionProxy; 38 class CronetDataReductionProxy;
36 #endif 39 #endif
37 40
38 struct URLRequestContextConfig; 41 struct URLRequestContextConfig;
39 42
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 100
98 // Network thread is owned by |this|, but is destroyed from java thread. 101 // Network thread is owned by |this|, but is destroyed from java thread.
99 base::Thread* network_thread_; 102 base::Thread* network_thread_;
100 103
101 // File thread should be destroyed last. 104 // File thread should be destroyed last.
102 scoped_ptr<base::Thread> file_thread_; 105 scoped_ptr<base::Thread> file_thread_;
103 106
104 // |write_to_file_observer_| and |context_| should only be accessed on 107 // |write_to_file_observer_| and |context_| should only be accessed on
105 // network thread. 108 // network thread.
106 scoped_ptr<net::WriteToFileNetLogObserver> write_to_file_observer_; 109 scoped_ptr<net::WriteToFileNetLogObserver> write_to_file_observer_;
110
111 // |pref_service_| should outlive the HttpServerPropertiesManager owned by
112 // |context_|.
113 scoped_ptr<PrefService> pref_service_;
107 scoped_ptr<net::URLRequestContext> context_; 114 scoped_ptr<net::URLRequestContext> context_;
108 scoped_ptr<net::ProxyConfigService> proxy_config_service_; 115 scoped_ptr<net::ProxyConfigService> proxy_config_service_;
116 scoped_refptr<JsonPrefStore> json_pref_store_;
117 net::HttpServerPropertiesManager* http_server_properties_manager_;
109 118
110 // |sdch_owner_| should be destroyed before |json_pref_store_|, because 119 // |sdch_owner_| should be destroyed before |json_pref_store_|, because
111 // tearing down |sdch_owner_| forces |json_pref_store_| to flush pending 120 // tearing down |sdch_owner_| forces |json_pref_store_| to flush pending
112 // writes to the disk. 121 // writes to the disk.
113 scoped_refptr<JsonPrefStore> json_pref_store_;
114 scoped_ptr<net::SdchOwner> sdch_owner_; 122 scoped_ptr<net::SdchOwner> sdch_owner_;
115 123
116 // Context config is only valid untng context is initialized. 124 // Context config is only valid until context is initialized.
117 scoped_ptr<URLRequestContextConfig> context_config_; 125 scoped_ptr<URLRequestContextConfig> context_config_;
118 126
119 // A queue of tasks that need to be run after context has been initialized. 127 // A queue of tasks that need to be run after context has been initialized.
120 std::queue<base::Closure> tasks_waiting_for_context_; 128 std::queue<base::Closure> tasks_waiting_for_context_;
121 bool is_context_initialized_; 129 bool is_context_initialized_;
122 int default_load_flags_; 130 int default_load_flags_;
123 131
124 #if defined(DATA_REDUCTION_PROXY_SUPPORT) 132 #if defined(DATA_REDUCTION_PROXY_SUPPORT)
125 scoped_ptr<CronetDataReductionProxy> data_reduction_proxy_; 133 scoped_ptr<CronetDataReductionProxy> data_reduction_proxy_;
126 #endif 134 #endif
127 135
128 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter); 136 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter);
129 }; 137 };
130 138
131 } // namespace cronet 139 } // namespace cronet
132 140
133 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ 141 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698