Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Issue 2378323003: Add url::Origin::GetURL() to convert Origins to URLs without reparsing (Closed)

Created:
4 years, 2 months ago by Charlie Harrison
Modified:
4 years, 2 months ago
CC:
chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, fuzzing_chromium.org, jam, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add url::Origin::GetURL() to convert Origins to URLs without reparsing The previous canonical way to convert an Origin to a GURL was to call GURL(origin.Serialize()). This is expensive and often in the critical path of user perceived page loads. One such caller has been converted to the new method, and the rest will be converted in a followup patch. BUG=651554 Committed: https://crrev.com/048bee100cbbc999219901a759fc86abc67c726d Cr-Commit-Position: refs/heads/master@{#422613}

Patch Set 1 #

Patch Set 2 : remove fuzzer #

Total comments: 2

Patch Set 3 : s/GURL("null")/GURL() #

Total comments: 8

Patch Set 4 : file:// -> file:/// and constructing Parsed alongside serialization #

Patch Set 5 : propagate file:/// change to weborigin #

Total comments: 1

Patch Set 6 : revert the file:/// changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+99 lines, -13 lines) Patch
M content/renderer/render_frame_impl.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M url/origin.h View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M url/origin.cc View 1 2 3 4 5 1 chunk +10 lines, -0 lines 0 comments Download
M url/origin_unittest.cc View 1 2 3 4 5 7 chunks +34 lines, -1 line 0 comments Download
M url/scheme_host_port.h View 1 2 3 3 chunks +8 lines, -0 lines 0 comments Download
M url/scheme_host_port.cc View 1 2 3 4 5 3 chunks +38 lines, -11 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 52 (33 generated)
Charlie Harrison
Mike, can you take a first pass at this? Thanks!
4 years, 2 months ago (2016-09-29 20:18:14 UTC) #7
Charlie Harrison
Actually, in addition to the fuzzer I think I will write another test suite... Feel ...
4 years, 2 months ago (2016-09-29 21:03:22 UTC) #8
Charlie Harrison
I updated the existing tests to assert that this method performs correctly, and removed the ...
4 years, 2 months ago (2016-09-29 23:05:47 UTC) #11
Mike West
Tagging in Brett, because he knows more about GURL parsing and efficiency than I do ...
4 years, 2 months ago (2016-09-30 12:37:40 UTC) #15
Charlie Harrison
Thanks! Also +creis for minor change to render_frame_impl as the first consumer of this new ...
4 years, 2 months ago (2016-09-30 14:29:58 UTC) #19
brettw
https://codereview.chromium.org/2378323003/diff/40001/url/origin.cc File url/origin.cc (right): https://codereview.chromium.org/2378323003/diff/40001/url/origin.cc#newcode73 url/origin.cc:73: return GURL("file://"); 1. We should have a constant for ...
4 years, 2 months ago (2016-09-30 20:18:48 UTC) #22
Charlie Reis
Adding Nick, who's been thinking a lot about this and sounds excited. :)
4 years, 2 months ago (2016-09-30 20:30:30 UTC) #24
Charlie Reis
And yes, render_frame_impl.cc LGTM.
4 years, 2 months ago (2016-09-30 20:33:05 UTC) #25
ncarter (slow)
lgtm; this is very useful
4 years, 2 months ago (2016-09-30 21:35:57 UTC) #28
Charlie Harrison
Looks like lots of code in blink expects file origins to be "file://" not "file:///" ...
4 years, 2 months ago (2016-10-03 17:28:48 UTC) #35
brettw
On 2016/10/03 17:28:48, Charlie Harrison wrote: > Looks like lots of code in blink expects ...
4 years, 2 months ago (2016-10-03 18:52:01 UTC) #36
brettw
https://codereview.chromium.org/2378323003/diff/80001/url/origin.cc File url/origin.cc (right): https://codereview.chromium.org/2378323003/diff/80001/url/origin.cc#newcode69 url/origin.cc:69: return kRootFileUrl; It looks like this returns the new ...
4 years, 2 months ago (2016-10-03 18:56:34 UTC) #37
Charlie Harrison
Sorry, I haven't changed the CL back to using "file://" for origin serialization, my last ...
4 years, 2 months ago (2016-10-03 19:03:10 UTC) #38
Charlie Harrison
So, I tried to explain this in the comments but I think the oddity of ...
4 years, 2 months ago (2016-10-03 19:46:33 UTC) #41
brettw
lgtm
4 years, 2 months ago (2016-10-03 23:15:38 UTC) #44
Charlie Harrison
Thanks! I'll land now since the changes to weborigin went away.
4 years, 2 months ago (2016-10-03 23:48:25 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2378323003/100001
4 years, 2 months ago (2016-10-03 23:49:54 UTC) #48
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 2 months ago (2016-10-04 00:09:42 UTC) #50
commit-bot: I haz the power
4 years, 2 months ago (2016-10-04 00:13:04 UTC) #52
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/048bee100cbbc999219901a759fc86abc67c726d
Cr-Commit-Position: refs/heads/master@{#422613}

Powered by Google App Engine
This is Rietveld 408576698