Bug 157660

Summary: [NetworkCache] Avoid having to re-parse URLs after deserializing them
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: BindingsAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, ap, benjamin, cdumez, cgarcia, commit-queue, darin, koivisto, sam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Chris Dumez 2016-05-12 20:27:45 PDT
Avoid having to re-parse URLs after deserializing them. This impacts both our IPC and our disk cache storage code.
We currently serialize URLs as Strings, which means that we have the re-parse them upon deserialization.
Comment 1 Chris Dumez 2016-05-12 20:35:15 PDT
Created attachment 278807 [details]
Patch
Comment 2 Alex Christensen 2016-05-12 21:56:34 PDT
Comment on attachment 278807 [details]
Patch

One encoder is better than the two we had before.  r=me for correctness, but is this really faster?
Also, why are all the member variables signed integers?  I think they should be unsigned.
Comment 3 Chris Dumez 2016-05-12 22:03:55 PDT
(In reply to comment #2)
> Comment on attachment 278807 [details]
> Patch
> 
> One encoder is better than the two we had before.  r=me for correctness, but
> is this really faster?
> Also, why are all the member variables signed integers?  I think they should
> be unsigned.

Do you mind if I change the type of those members in a follow up?
Comment 4 Alexey Proskuryakov 2016-05-12 22:50:34 PDT
Comment on attachment 278807 [details]
Patch

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

> Source/WebCore/ChangeLog:9
> +        Avoid having to re-parse URLs after deserializing them. This impacts
> +        both our WK2 IPC and our WK2 network cache storage code.

Is this good when handling untrusted URLs from WebContent in UI process?
Comment 5 Darin Adler 2016-05-12 23:53:54 PDT
I agree with Alexey that it in theory would be a problem trusting data from the web process. Worth talking over Anders and Sam at some point.
Comment 6 Chris Dumez 2016-05-13 09:09:57 PDT
(In reply to comment #5)
> I agree with Alexey that it in theory would be a problem trusting data from
> the web process. Worth talking over Anders and Sam at some point.

Ok, based on Alexey and Darin's feedback, I think I'll restrict the optimization to the disk cache for now and not the IPC.
Comment 7 Chris Dumez 2016-05-13 12:02:20 PDT
Created attachment 278858 [details]
Patch
Comment 8 WebKit Commit Bot 2016-05-13 19:25:31 PDT
Comment on attachment 278858 [details]
Patch

Clearing flags on attachment: 278858

Committed r200909: <http://trac.webkit.org/changeset/200909>
Comment 9 WebKit Commit Bot 2016-05-13 19:25:38 PDT
All reviewed patches have been landed.  Closing bug.