Commit 8ffd5e0
authored
* Migrate VideoLoader from HttpURLConnection to OkHttp
Replace direct HttpURLConnection usage with the shared OkHttpClient for
better connection pooling and consistency with the rest of the codebase.
Changes:
- Inject `@Named("regular") OkHttpClient` via Dagger
- Use HEAD request instead of GET for efficiency (only need Content-Length)
- Simplify content length retrieval using OkHttp's response API
* Migrate TempAttachmentsUtil from HttpURLConnection to OkHttp
Replace direct HttpURLConnection usage with the shared OkHttpClient for
video downloads in support ticket attachments.
Changes:
- Inject `@Named("regular") OkHttpClient` via Dagger
- Use `okHttpClient.newBuilder()` to configure custom timeouts
- Stream response body to temp file using OkHttp's byteStream API
- Simplify cleanup by relying on OkHttp's response.use {} auto-close
* Migrate WPWebViewClient from HttpURLConnection to OkHttp
Replace direct HttpURLConnection usage with the shared OkHttpClient for
intercepting private site image requests in WebViews.
Changes:
- Inject `@Named("regular") OkHttpClient` via Dagger field injection
- Use synchronous `execute()` as required by `shouldInterceptRequest`
- Configure timeouts via `newBuilder()` to preserve existing behavior
- Pass response body stream directly to WebResourceResponse
* Migrate ReaderWebView from HttpURLConnection to OkHttp
Replace direct HttpURLConnection usage with the shared OkHttpClient for
intercepting private post image requests in Reader WebViews.
Changes:
- Inject `@Named("regular") OkHttpClient` in ReaderWebView
- Pass OkHttpClient to inner ReaderWebViewClient class
- Use synchronous `execute()` as required by `shouldInterceptRequest`
- Preserve User-Agent and Connection headers from original implementation
1 parent 192a695 commit 8ffd5e0
File tree
4 files changed
+101
-60
lines changed- WordPress/src/main/java/org/wordpress/android
- support/he/util
- ui
- media
- reader/views
- util
4 files changed
+101
-60
lines changedLines changed: 34 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | | - | |
13 | | - | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
100 | | - | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | 105 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
121 | 125 | | |
122 | | - | |
123 | 126 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
131 | 137 | | |
132 | 138 | | |
133 | 139 | | |
134 | | - | |
| 140 | + | |
135 | 141 | | |
136 | | - | |
137 | | - | |
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
70 | | - | |
71 | | - | |
72 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 81 | + | |
| 82 | + | |
78 | 83 | | |
79 | | - | |
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
| |||
Lines changed: 31 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
| 89 | + | |
84 | 90 | | |
85 | 91 | | |
86 | 92 | | |
| |||
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
109 | | - | |
| 115 | + | |
110 | 116 | | |
111 | 117 | | |
112 | 118 | | |
| |||
265 | 271 | | |
266 | 272 | | |
267 | 273 | | |
| 274 | + | |
268 | 275 | | |
269 | | - | |
| 276 | + | |
270 | 277 | | |
271 | 278 | | |
272 | 279 | | |
273 | 280 | | |
274 | 281 | | |
| 282 | + | |
275 | 283 | | |
276 | 284 | | |
277 | 285 | | |
| |||
310 | 318 | | |
311 | 319 | | |
312 | 320 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
322 | 341 | | |
323 | 342 | | |
324 | 343 | | |
| |||
Lines changed: 25 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| |||
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| 43 | + | |
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
| |||
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
85 | 99 | | |
86 | 100 | | |
87 | 101 | | |
| |||
0 commit comments