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 2409423005: Compare GURLs to kUrlConstants with .spec() and string equality (Closed)

Created:
4 years, 2 months ago by Charlie Harrison
Modified:
4 years, 2 months ago
CC:
browser-components-watch_chromium.org, cbentzel+watch_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, David Black, dhollowa+watch_chromium.org, donnd+watch_chromium.org, dougw+watch_chromium.org, extensions-reviews_chromium.org, gavinp+prer_chromium.org, jam, Jered, jfweitz+watch_chromium.org, kmadhusu+watch_chromium.org, mac-reviews_chromium.org, melevin+watch_chromium.org, samarth+watch_chromium.org, skanuj+watch_chromium.org, sync-reviews_chromium.org, tburkard+watch_chromium.org, tfarina
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Compare URL constants with .spec() and string equality This patch replaces instances of "<url> == GURL(<string constant>)" with "<url> == <string constant>" for string constants that are valid GURL specs, in //chrome, using the new operator== defined for both GURL and StringPiece. This prevents needlessly reparsing the constant GURL, which is slow. Follow-up changes will change these comparisons in other portions of the code base. BUG=655467 Committed: https://crrev.com/0b2013bac16787ab019357a3561288fadb68b87b Cr-Commit-Position: refs/heads/master@{#426207}

Patch Set 1 #

Patch Set 2 : git cl format #

Total comments: 2

Patch Set 3 : rebase on dependent patch #

Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -47 lines) Patch
M chrome/browser/android/data_usage/data_use_ui_tab_model.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/app_controller_mac.mm View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/prerender/prerender_manager.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/search/search.cc View 1 2 2 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/sessions/session_restore.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/chrome_sync_client.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/search/new_tab_page_interceptor_service.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/search/search_tab_helper.cc View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/singleton_tabs.cc View 1 2 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/ui/startup/startup_browser_creator_impl.cc View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/uber/uber_ui.cc View 1 2 1 chunk +5 lines, -5 lines 0 comments Download
M chrome/renderer/content_settings_observer.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/extensions/resource_request_policy.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/printing/chrome_print_web_view_helper_delegate.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/utility/importer/bookmarks_file_importer.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M content/public/common/url_constants.cc View 1 chunk +16 lines, -16 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 28 (14 generated)
Charlie Harrison
sky: ptal at - chrome/browser/ui - chrome/browser/history - chrome/browser/sessions jochen: would you ptal at the ...
4 years, 2 months ago (2016-10-13 12:48:28 UTC) #6
sky
sky->brettw
4 years, 2 months ago (2016-10-13 17:47:06 UTC) #8
jochen (gone - plz use gerrit)
lgtm
4 years, 2 months ago (2016-10-14 09:15:15 UTC) #9
brettw
What do you think about defining operator== between a GURL and a StringPiece (assuming this ...
4 years, 2 months ago (2016-10-14 18:01:24 UTC) #10
Charlie Harrison
I'm supportive of adding operator== for StringPiece, if you are. That would avoid the issue ...
4 years, 2 months ago (2016-10-14 18:13:55 UTC) #11
brettw
On 2016/10/14 18:13:55, Charlie Harrison wrote: > I'm supportive of adding operator== for StringPiece, if ...
4 years, 2 months ago (2016-10-14 19:15:00 UTC) #12
Charlie Harrison
On 2016/10/14 19:15:00, brettw (ping on IM after 24h) wrote: > On 2016/10/14 18:13:55, Charlie ...
4 years, 2 months ago (2016-10-14 19:23:09 UTC) #13
Charlie Harrison
This patch is now based on a dependent PS that adds operator==(const GURL&, const base::StringPiece&) ...
4 years, 2 months ago (2016-10-17 20:05:41 UTC) #16
brettw
lgtm
4 years, 2 months ago (2016-10-17 23:01:09 UTC) #20
Charlie Harrison
Thanks, I'll wait for a second pass from jochen@ before landing.
4 years, 2 months ago (2016-10-17 23:08:47 UTC) #21
jochen (gone - plz use gerrit)
still lgtm
4 years, 2 months ago (2016-10-19 14:35:07 UTC) #22
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/2409423005/40001
4 years, 2 months ago (2016-10-19 15:00:31 UTC) #24
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 2 months ago (2016-10-19 15:55:07 UTC) #26
commit-bot: I haz the power
4 years, 2 months ago (2016-10-21 13:08:55 UTC) #28
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/0b2013bac16787ab019357a3561288fadb68b87b
Cr-Commit-Position: refs/heads/master@{#426207}

Powered by Google App Engine
This is Rietveld 408576698