Commit 82d9aac
[266]Make NetworkContext resettable
Expose StoragePartitionImpl::InitNetworkContext() and add
StoragePartition::NetworkContextCreatedObserver.
The public StoragePartitionImpl::ResetNetworkContext() method allows
recreating the NetworkContext used inside a storage partition so as to
change network settings dynamically. The old network context is
destroyed before creating the replacement.
The observer notifies when NetworkContext is created and makes it
possible to check if StoragePartitionImpl::ResetNetworkContext()
is done with its asynchronous tasks.
===============================================================
We posted the OnNetworkContextCreated call right after the
construction of NetworkContext, however its client() is not
guaranteed to exist at this point. Magically it worked for a long
time, because typically the next call after construction is
SetClient(), which (most of the time) can run before the posted
lambda.
The following change [1] introduced a new mojo call between the
constructor and SetClient, which defers SetClient and so we miss
the opportunity to notify client() in the lambda.
Moving OnNetworkContextCreated() to SetClient() seems to be a good
solution, because setting the client typically means that we
finished the construction of a NetworkContext.
This brings back clearHttpCacheCompleted signal to life and fixes
tst_QWebEngineProfile::clearDataFromCache().
[1] https://chromium-review.googlesource.com/c/chromium/src/+/5440136
Task-number: QTBUG-81558
Task-number: QTBUG-89670
Task-number: QTBUG-111541
Change-Id: I5f4ea50650b35e1f35ad67a009964e76038ea750
Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/493884
Reviewed-by: Michal Klocek <michal.klocek@qt.io>1 parent ac1ffd2 commit 82d9aac
File tree
7 files changed
+51
-2
lines changed- chromium
- content
- browser
- preloading/prefetch
- public/browser
- services/network
- public/mojom
7 files changed
+51
-2
lines changedLines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
60 | 62 | | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3223 | 3223 | | |
3224 | 3224 | | |
3225 | 3225 | | |
| 3226 | + | |
| 3227 | + | |
| 3228 | + | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
3226 | 3234 | | |
3227 | 3235 | | |
3228 | 3236 | | |
| |||
3515 | 3523 | | |
3516 | 3524 | | |
3517 | 3525 | | |
3518 | | - | |
| 3526 | + | |
| 3527 | + | |
| 3528 | + | |
| 3529 | + | |
| 3530 | + | |
3519 | 3531 | | |
3520 | 3532 | | |
3521 | 3533 | | |
| |||
3530 | 3542 | | |
3531 | 3543 | | |
3532 | 3544 | | |
3533 | | - | |
3534 | 3545 | | |
3535 | 3546 | | |
3536 | 3547 | | |
3537 | 3548 | | |
3538 | 3549 | | |
3539 | 3550 | | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
| 3556 | + | |
| 3557 | + | |
3540 | 3558 | | |
3541 | 3559 | | |
3542 | 3560 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| 269 | + | |
| 270 | + | |
269 | 271 | | |
270 | 272 | | |
271 | 273 | | |
| |||
344 | 346 | | |
345 | 347 | | |
346 | 348 | | |
| 349 | + | |
347 | 350 | | |
348 | 351 | | |
349 | 352 | | |
| |||
483 | 486 | | |
484 | 487 | | |
485 | 488 | | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
486 | 492 | | |
487 | 493 | | |
488 | 494 | | |
| |||
930 | 936 | | |
931 | 937 | | |
932 | 938 | | |
| 939 | + | |
| 940 | + | |
933 | 941 | | |
934 | 942 | | |
935 | 943 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
293 | 298 | | |
294 | 299 | | |
295 | 300 | | |
| |||
355 | 360 | | |
356 | 361 | | |
357 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
358 | 366 | | |
359 | 367 | | |
360 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
996 | 996 | | |
997 | 997 | | |
998 | 998 | | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
999 | 1008 | | |
1000 | 1009 | | |
1001 | 1010 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
62 | 65 | | |
0 commit comments