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 package org.chromium.net; | 5 package org.chromium.net; |
6 | 6 |
7 import org.json.JSONArray; | 7 import org.json.JSONArray; |
8 import org.json.JSONException; | 8 import org.json.JSONException; |
9 import org.json.JSONObject; | 9 import org.json.JSONObject; |
10 | 10 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 | 96 |
97 /** | 97 /** |
98 * Boolean, enable SPDY if true. | 98 * Boolean, enable SPDY if true. |
99 */ | 99 */ |
100 public UrlRequestContextConfig enableSPDY(boolean value) { | 100 public UrlRequestContextConfig enableSPDY(boolean value) { |
101 return putBoolean(UrlRequestContextConfigList.ENABLE_SPDY, value); | 101 return putBoolean(UrlRequestContextConfigList.ENABLE_SPDY, value); |
102 } | 102 } |
103 | 103 |
104 /** | 104 /** |
| 105 * Boolean, enable Data Reduction Proxy if true. |
| 106 */ |
| 107 public UrlRequestContextConfig enableDataReductionProxy(boolean value, |
| 108 String key) { |
| 109 return (putBoolean(UrlRequestContextConfigList |
| 110 .ENABLE_DATA_REDUCTION_PROXY, value) |
| 111 .putString(UrlRequestContextConfigList |
| 112 .DATA_REDUCTION_PROXY_KEY, key)); |
| 113 } |
| 114 |
| 115 /** |
105 * Enumeration, disable or enable cache in memory or on disk. | 116 * Enumeration, disable or enable cache in memory or on disk. |
106 */ | 117 */ |
107 public enum HttpCache { | 118 public enum HttpCache { |
108 /** | 119 /** |
109 * Disable cache, some data may still be temporarily stored in memory. | 120 * Disable cache, some data may still be temporarily stored in memory. |
110 */ | 121 */ |
111 DISABLED, | 122 DISABLED, |
112 | 123 |
113 /** | 124 /** |
114 * Enable in memory cache, including HTTP data. | 125 * Enable in memory cache, including HTTP data. |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 try { | 269 try { |
259 mConfig.put(key, value); | 270 mConfig.put(key, value); |
260 } catch (JSONException e) { | 271 } catch (JSONException e) { |
261 // Intentionally do nothing. | 272 // Intentionally do nothing. |
262 } | 273 } |
263 return this; | 274 return this; |
264 } | 275 } |
265 | 276 |
266 private JSONObject mConfig = new JSONObject(); | 277 private JSONObject mConfig = new JSONObject(); |
267 } | 278 } |
OLD | NEW |