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

Issue 2121513002: Replace string::find(prefix) == 0 pattern with base::StartsWith(). (Closed)

Created:
4 years, 5 months ago by lazyboy
Modified:
4 years, 5 months ago
Reviewers:
Lei Zhang
CC:
chromium-reviews, asanka, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, tracing+reviews_chromium.org, ben+mojo_chromium.org, extensions-reviews_chromium.org, cbentzel+watch_chromium.org, samuong+watch_chromium.org, jam, abarth-chromium, darin-cc_chromium.org, devtools-reviews_chromium.org, chromium-apps-reviews_chromium.org, rickyz+watch_chromium.org, feature-media-reviews_chromium.org, oshima+watch_chromium.org, sync-reviews_chromium.org, wfh+watch_chromium.org, Aaron Boodman, davemoore+watch_chromium.org, darin (slow to review), pfeldman
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Replace string::find(prefix) == 0 pattern with base::StartsWith(). base::StartsWith() should be O(|prefix|) whereas string::find() is pretty bad, O(|string| * |prefix|). TBR=jam@chromium.org BUG=None Test=None, internal cleanup. CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win10_chromium_x64_rel_ng Committed: https://crrev.com/53bfbe932191085b5d69f824a9923bccc26d58dc Cr-Commit-Position: refs/heads/master@{#404307}

Patch Set 1 #

Patch Set 2 : fix typos #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -47 lines) Patch
M base/trace_event/trace_config.cc View 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/apps/guest_view/web_view_browsertest.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/chromeos/profiles/profile_helper.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/download/download_browsertest.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/cookies/cookies_helpers.cc View 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/profiles/profile_avatar_icon_util.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/browser_navigator_browsertest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/find_bar/find_bar_controller.cc View 2 chunks +4 lines, -1 line 0 comments Download
M chrome/test/chromedriver/net/adb_client_socket.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/test/chromedriver/session_commands.cc View 1 2 chunks +5 lines, -3 lines 4 comments Download
M chromeos/settings/timezone_settings.cc View 1 chunk +2 lines, -1 line 0 comments Download
M components/devtools_http_handler/devtools_http_handler.cc View 6 chunks +10 lines, -8 lines 0 comments Download
M components/leveldb/env_mojo.cc View 2 chunks +5 lines, -2 lines 0 comments Download
M components/os_crypt/os_crypt_posix.cc View 2 chunks +3 lines, -1 line 0 comments Download
M components/sync_sessions/favicon_cache_unittest.cc View 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/dom_storage/session_storage_database.cc View 4 chunks +6 lines, -4 lines 0 comments Download
M content/browser/dom_storage/session_storage_database_unittest.cc View 5 chunks +5 lines, -4 lines 0 comments Download
M content/browser/iframe_zoom_browsertest.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/webui/shared_resources_data_source.cc View 1 chunk +3 lines, -1 line 0 comments Download
M media/blink/buffered_resource_loader.cc View 1 chunk +3 lines, -1 line 0 comments Download
M media/blink/resource_multibuffer_data_provider.cc View 1 2 chunks +6 lines, -3 lines 2 comments Download
M net/base/filename_util.cc View 1 chunk +3 lines, -1 line 0 comments Download
M net/cookies/canonical_cookie.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ppapi/shared_impl/test_utils.cc View 1 chunk +5 lines, -2 lines 0 comments Download
M sandbox/win/src/win_utils.cc View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 23 (9 generated)
lazyboy
thestig@ for kicking off the review, because you're a base OWNER and this CL is ...
4 years, 5 months ago (2016-07-07 22:01:16 UTC) #5
Lei Zhang
lgtm I looked at the whole CL, so TBR remaining reviewers? https://codereview.chromium.org/2121513002/diff/20001/chrome/test/chromedriver/session_commands.cc File chrome/test/chromedriver/session_commands.cc (left): ...
4 years, 5 months ago (2016-07-07 22:33:50 UTC) #6
lazyboy
I'll TBR rest of the OWNERs, thanks. https://codereview.chromium.org/2121513002/diff/20001/chrome/test/chromedriver/session_commands.cc File chrome/test/chromedriver/session_commands.cc (left): https://codereview.chromium.org/2121513002/diff/20001/chrome/test/chromedriver/session_commands.cc#oldcode68 chrome/test/chromedriver/session_commands.cc:68: std::string(kWindowHandlePrefix).length()); On ...
4 years, 5 months ago (2016-07-07 23:44:50 UTC) #7
Lei Zhang
https://codereview.chromium.org/2121513002/diff/20001/chrome/test/chromedriver/session_commands.cc File chrome/test/chromedriver/session_commands.cc (left): https://codereview.chromium.org/2121513002/diff/20001/chrome/test/chromedriver/session_commands.cc#oldcode68 chrome/test/chromedriver/session_commands.cc:68: std::string(kWindowHandlePrefix).length()); On 2016/07/07 23:44:50, lazyboy wrote: > On 2016/07/07 ...
4 years, 5 months ago (2016-07-07 23:50:08 UTC) #8
lazyboy
https://codereview.chromium.org/2121513002/diff/20001/chrome/test/chromedriver/session_commands.cc File chrome/test/chromedriver/session_commands.cc (left): https://codereview.chromium.org/2121513002/diff/20001/chrome/test/chromedriver/session_commands.cc#oldcode68 chrome/test/chromedriver/session_commands.cc:68: std::string(kWindowHandlePrefix).length()); On 2016/07/07 23:50:08, Lei Zhang wrote: > On ...
4 years, 5 months ago (2016-07-07 23:57:12 UTC) #10
Lei Zhang
On 2016/07/07 23:57:12, lazyboy wrote: > Ah, deleted patchset #3 looks good, as before.
4 years, 5 months ago (2016-07-08 00:06:12 UTC) #11
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/2121513002/20001
4 years, 5 months ago (2016-07-08 00:15:59 UTC) #14
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 5 months ago (2016-07-08 02:04:22 UTC) #16
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-08 02:04:35 UTC) #17
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/53bfbe932191085b5d69f824a9923bccc26d58dc Cr-Commit-Position: refs/heads/master@{#404307}
4 years, 5 months ago (2016-07-08 02:09:44 UTC) #19
markusheintz_
A revert of this CL (patchset #2 id:20001) has been created in https://codereview.chromium.org/2137503002/ by markusheintz@chromium.org. ...
4 years, 5 months ago (2016-07-08 13:02:00 UTC) #20
markusheintz_
A revert of this CL (patchset #2 id:20001) has been created in https://codereview.chromium.org/2131933002/ by markusheintz@chromium.org. ...
4 years, 5 months ago (2016-07-08 13:02:04 UTC) #21
Primiano Tucci (use gerrit)
On 2016/07/08 13:02:04, markusheintz_ wrote: > A revert of this CL (patchset #2 id:20001) has ...
4 years, 5 months ago (2016-07-08 13:16:14 UTC) #22
markusheintz_
4 years, 5 months ago (2016-07-08 14:19:49 UTC) #23
Message was sent while issue was closed.
On 2016/07/08 13:16:14, Primiano Tucci wrote:
> On 2016/07/08 13:02:04, markusheintz_ wrote:
> > A revert of this CL (patchset #2 id:20001) has been created in
> > https://codereview.chromium.org/2131933002/ by
> mailto:markusheintz@chromium.org.
> > 
> > The reason for reverting is: Bisect believes that this CL caused the Win
> builder
> > to break. 
> > 
> > https://build.chromium.org/p/chromium/builders/Win%20x64/builds/2267
> > https://build.chromium.org/p/chromium/builders/Win/builds/45048
> > 
> > For context see:
> > https://bugs.chromium.org/p/chromium/issues/detail?id=626539.
> 
> Turns out we just need a very limited revert
> https://codereview.chromium.org/2135653002/

FYI the revert was reverted (https://codereview.chromium.org/2136453004/)

Powered by Google App Engine
This is Rietveld 408576698