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 Saver if true. |
| 106 */ |
| 107 public UrlRequestContextConfig enableDataSaver(boolean value, |
| 108 String key) { |
| 109 return (putBoolean(UrlRequestContextConfigList.ENABLE_DATA_SAVER, value) |
| 110 .putString(UrlRequestContextConfigList.DATA_SAVER_KEY, key)); |
| 111 } |
| 112 |
| 113 /** |
105 * Enumeration, disable or enable cache in memory or on disk. | 114 * Enumeration, disable or enable cache in memory or on disk. |
106 */ | 115 */ |
107 public enum HttpCache { | 116 public enum HttpCache { |
108 /** | 117 /** |
109 * Disable cache, some data may still be temporarily stored in memory. | 118 * Disable cache, some data may still be temporarily stored in memory. |
110 */ | 119 */ |
111 DISABLED, | 120 DISABLED, |
112 | 121 |
113 /** | 122 /** |
114 * Enable in memory cache, including HTTP data. | 123 * Enable in memory cache, including HTTP data. |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 try { | 267 try { |
259 mConfig.put(key, value); | 268 mConfig.put(key, value); |
260 } catch (JSONException e) { | 269 } catch (JSONException e) { |
261 // Intentionally do nothing. | 270 // Intentionally do nothing. |
262 } | 271 } |
263 return this; | 272 return this; |
264 } | 273 } |
265 | 274 |
266 private JSONObject mConfig = new JSONObject(); | 275 private JSONObject mConfig = new JSONObject(); |
267 } | 276 } |
OLD | NEW |