Bug 176249 - NetworkProcess Cache and Caches should be cleared when the last related WebProcess Cache or CacheStorage is destroyed
Summary: NetworkProcess Cache and Caches should be cleared when the last related WebPr...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-09-01 15:38 PDT by youenn fablet
Modified: 2017-09-27 12:44 PDT (History)
7 users (show)

See Also:


Attachments
Patch (42.48 KB, patch)
2017-09-01 17:25 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews123 for ios-simulator-wk2 (1.47 MB, application/zip)
2017-09-01 18:43 PDT, Build Bot
no flags Details
Patch (42.59 KB, patch)
2017-09-05 14:33 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews123 for ios-simulator-wk2 (1.29 MB, application/zip)
2017-09-05 16:12 PDT, Build Bot
no flags Details
Patch (43.31 KB, patch)
2017-09-06 13:12 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (41.98 KB, patch)
2017-09-06 16:20 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2017-09-01 15:38:11 PDT
This will allow getting rid of removed caches as early as possible.
This will also allow cleaning no longer used caches to optimize memory usage.
Comment 1 youenn fablet 2017-09-01 17:25:51 PDT
Created attachment 319675 [details]
Patch
Comment 2 Build Bot 2017-09-01 17:27:05 PDT
Attachment 319675 [details] did not pass style-queue:


ERROR: Source/WebCore/Modules/cache/WorkerCacheStorageConnection.h:49:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp:164:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp:169:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 3 in 25 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Build Bot 2017-09-01 18:43:31 PDT
Comment on attachment 319675 [details]
Patch

Attachment 319675 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/4430218

New failing tests:
http/tests/cache-storage/cache-representation.https.html
Comment 4 Build Bot 2017-09-01 18:43:33 PDT
Created attachment 319685 [details]
Archive of layout-test-results from ews123 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews123  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.5
Comment 5 youenn fablet 2017-09-05 14:33:19 PDT
Created attachment 319936 [details]
Patch
Comment 6 Build Bot 2017-09-05 14:36:06 PDT
Attachment 319936 [details] did not pass style-queue:


ERROR: Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp:164:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp:169:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 2 in 25 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Build Bot 2017-09-05 16:12:46 PDT
Comment on attachment 319936 [details]
Patch

Attachment 319936 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/4456648

New failing tests:
http/tests/cache-storage/cache-representation.https.html
Comment 8 Build Bot 2017-09-05 16:12:47 PDT
Created attachment 319950 [details]
Archive of layout-test-results from ews123 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews123  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.5
Comment 9 youenn fablet 2017-09-06 13:12:51 PDT
Created attachment 320055 [details]
Patch
Comment 10 Build Bot 2017-09-06 13:15:19 PDT
Attachment 320055 [details] did not pass style-queue:


ERROR: Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp:164:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp:169:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 2 in 25 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 Alex Christensen 2017-09-06 13:43:32 PDT
Comment on attachment 320055 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=320055&action=review

> Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.h:68
> +    HashMap<PAL::SessionID, HashMap<uint64_t, uint64_t>> m_cachesReferences;

m_cacheReferences?
Also, could you typedef the uint64_t's so we can read what is going on here?
Comment 12 youenn fablet 2017-09-06 16:17:32 PDT
Thanks for the review.

(In reply to Alex Christensen from comment #11)
> Comment on attachment 320055 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=320055&action=review
> 
> > Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.h:68
> > +    HashMap<PAL::SessionID, HashMap<uint64_t, uint64_t>> m_cachesReferences;
> 
> m_cacheReferences?
> Also, could you typedef the uint64_t's so we can read what is going on here?

Let's rename to m_cachesLocks and add two uint64_t aliases CacheIdentifier and LockCount.
Comment 13 youenn fablet 2017-09-06 16:20:10 PDT
Created attachment 320073 [details]
Patch for landing
Comment 14 WebKit Commit Bot 2017-09-06 17:03:17 PDT
Comment on attachment 320073 [details]
Patch for landing

Clearing flags on attachment: 320073

Committed r221710: <http://trac.webkit.org/changeset/221710>
Comment 15 WebKit Commit Bot 2017-09-06 17:03:18 PDT
All reviewed patches have been landed.  Closing bug.
Comment 16 Radar WebKit Bug Importer 2017-09-27 12:44:28 PDT
<rdar://problem/34693867>