Bug 166825 - Move cache coders to WTF
Summary: Move cache coders to WTF
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-08 13:52 PST by Antti Koivisto
Modified: 2017-01-09 05:42 PST (History)
7 users (show)

See Also:


Attachments
patch (107.00 KB, patch)
2017-01-08 14:35 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
patch (106.12 KB, patch)
2017-01-08 15:13 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
patch (106.80 KB, patch)
2017-01-08 15:18 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
patch (107.45 KB, patch)
2017-01-08 15:58 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
patch (107.99 KB, patch)
2017-01-08 16:34 PST, Antti Koivisto
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2017-01-08 13:52:08 PST
Make it possible to use robust serialization of WTF types on the lower levels of the stack.
Comment 1 Antti Koivisto 2017-01-08 14:35:11 PST
Created attachment 298317 [details]
patch
Comment 2 WebKit Commit Bot 2017-01-08 14:36:13 PST
Attachment 298317 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/persistence/Encoder.h:94:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:95:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:96:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:97:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:98:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:99:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:100:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:101:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:102:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:103:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 10 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Antti Koivisto 2017-01-08 15:13:45 PST
Created attachment 298318 [details]
patch
Comment 4 WebKit Commit Bot 2017-01-08 15:15:36 PST
Attachment 298318 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/persistence/Encoder.h:94:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:95:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:96:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:97:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:98:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:99:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:100:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:101:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:102:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:103:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 10 in 20 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Antti Koivisto 2017-01-08 15:18:59 PST
Created attachment 298319 [details]
patch
Comment 6 WebKit Commit Bot 2017-01-08 15:20:36 PST
Attachment 298319 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/persistence/Encoder.h:94:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:95:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:96:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:97:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:98:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:99:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:100:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:101:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:102:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:103:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 10 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Antti Koivisto 2017-01-08 15:58:12 PST
Created attachment 298322 [details]
patch
Comment 8 WebKit Commit Bot 2017-01-08 15:59:50 PST
Attachment 298322 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/persistence/Encoder.h:94:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:95:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:96:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:97:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:98:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:99:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:100:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:101:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:102:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:103:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 10 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Michael Catanzaro 2017-01-08 16:19:03 PST
Comment on attachment 298319 [details]
patch

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

> Source/WTF/wtf/persistence/Coders.cpp:35
> +#include "NetworkCacheCoders.h"
> +
> +#if ENABLE(NETWORK_CACHE)
> +
> +#include <wtf/text/CString.h>
> +#include <wtf/text/WTFString.h>
> +
> +namespace WebKit {
> +namespace NetworkCache {

Are you planning to get rid of the ENABLE(NETWORK_CACHE) and namespace NetworkCache?

> Source/WTF/wtf/persistence/Coders.cpp:160
> +// Store common HTTP headers as strings instead of using their value in the HTTPHeaderName enumeration
> +// so that the headers stored in the cache stays valid even after HTTPHeaderName.in gets updated.
> +void Coder<WebCore::HTTPHeaderMap>::encode(Encoder& encoder, const WebCore::HTTPHeaderMap& headers)

Er, surely WTF cannot depend on WebCore.
Comment 10 Antti Koivisto 2017-01-08 16:31:21 PST
> Are you planning to get rid of the ENABLE(NETWORK_CACHE) and namespace
> NetworkCache?
> Er, surely WTF cannot depend on WebCore.

If you look further in the patch you see them changed appropriately. This is just how move/edit patches end up looking like.
Comment 11 Antti Koivisto 2017-01-08 16:34:06 PST
Created attachment 298323 [details]
patch
Comment 12 WebKit Commit Bot 2017-01-08 16:35:14 PST
Attachment 298323 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/persistence/Encoder.h:94:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:95:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:96:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:97:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:98:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:99:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:100:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:101:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:102:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WTF/wtf/persistence/Encoder.h:103:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 10 in 22 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 Sam Weinig 2017-01-08 18:05:13 PST
Comment on attachment 298323 [details]
patch

Looks good, rs=me. What do you plan on persisting now :) ?
Comment 14 Sam Weinig 2017-01-08 18:08:37 PST
Probably useful to move NetworkCache::Data, NetworkCache::IOChannel, and the helpers in NetworkCacheFileSystem.h at some point. (As well as WebKit::SharedMemory I guess).
Comment 15 Antti Koivisto 2017-01-09 04:21:09 PST
> Looks good, rs=me. What do you plan on persisting now :) ?

JS related things!
Comment 16 Antti Koivisto 2017-01-09 04:45:20 PST
https://trac.webkit.org/r210502
Comment 17 Konstantin Tokarev 2017-01-09 05:12:15 PST
Comment on attachment 298323 [details]
patch

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

> Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.h:43
> +namespace Persistence {

It does not feel right to have code in namespace WTF inside WebKit2
Comment 18 Antti Koivisto 2017-01-09 05:42:15 PST
> It does not feel right to have code in namespace WTF inside WebKit2

Nevertheless it is a rather common pattern for traits-like templates (search for it in WebCore).