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

Issue 2469353003: Skip base::string16 if not necessary for WebString <-> ASCII conversion (Closed)

Created:
4 years, 1 month ago by kinuko
Modified:
4 years, 1 month ago
CC:
blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, dcheng, dglazkov+blink, feature-media-reviews_chromium.org, jam, jkarlin+watch_chromium.org, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org, nhiroki
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Skip base::string16 if not necessary for WebString <-> ASCII conversion One common way to get ASCII string from WebString is to do base::UTF16ToASCII(webString) but this always goes through string16 even when webString only contains ASCII and is already a 8-bit string (which is expected). This patch adds following WebString methods to help optimizing WebString <-> ASCII conversions: - WebString::ascii() ... returns ascii std::string, which skips string16 conversion for 8-bit cases. Internally DCHECKs if it contains non-ascii chars - WebString::containsOnlyASCII() ... should be more efficient than calling base::IsStringASCII() on WebString (which incurs string16 conversion) - WebString::fromASCII() ... does same as fromLatin1() but with DCHECK Split from https://codereview.chromium.org/2444873002/ BUG=661895 Committed: https://crrev.com/a0d5ac61931de6d57d2f7c2a619177986d4d5e0e Cr-Commit-Position: refs/heads/master@{#429834}

Patch Set 1 #

Patch Set 2 : better comments #

Patch Set 3 : minor fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -45 lines) Patch
M content/child/simple_webmimeregistry_impl.cc View 1 chunk +1 line, -3 lines 0 comments Download
M content/renderer/cache_storage/cache_storage_dispatcher.cc View 6 chunks +13 lines, -15 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M content/renderer/render_view_browsertest.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M content/renderer/render_view_impl.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M content/renderer/renderer_blink_platform_impl.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M content/renderer/webclipboard_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/blink/key_system_config_selector.cc View 3 chunks +6 lines, -11 lines 0 comments Download
M media/blink/webcontentdecryptionmodulesession_impl.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M media/blink/webencryptedmediaclient_impl.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/exported/WebString.cpp View 2 chunks +26 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/WebString.h View 1 2 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 33 (21 generated)
kinuko
Split from the other mime refactoring patch (https://codereview.chromium.org/2444873002/). What do you think?
4 years, 1 month ago (2016-11-03 01:11:46 UTC) #8
dcheng
LGTM
4 years, 1 month ago (2016-11-03 05:38:08 UTC) #9
esprehn
lgtm
4 years, 1 month ago (2016-11-03 05:47:11 UTC) #10
kinuko
chcunningham@: could you review changes in media/blink?
4 years, 1 month ago (2016-11-03 08:20:45 UTC) #13
chcunningham
lgtm
4 years, 1 month ago (2016-11-03 17:46:01 UTC) #18
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/2469353003/40001
4 years, 1 month ago (2016-11-04 01:19:47 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-generic_chromium_compile_only_ng/builds/228940) chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, ...
4 years, 1 month ago (2016-11-04 01:29:22 UTC) #23
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/2469353003/40001
4 years, 1 month ago (2016-11-04 03:18:20 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/325238)
4 years, 1 month ago (2016-11-04 06:00:35 UTC) #27
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/2469353003/40001
4 years, 1 month ago (2016-11-04 07:13:08 UTC) #29
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 1 month ago (2016-11-04 08:50:29 UTC) #31
commit-bot: I haz the power
4 years, 1 month ago (2016-11-04 08:53:21 UTC) #33
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/a0d5ac61931de6d57d2f7c2a619177986d4d5e0e
Cr-Commit-Position: refs/heads/master@{#429834}

Powered by Google App Engine
This is Rietveld 408576698