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

Issue 2537953003: WebString: makes string16 conversions explicit (part 1: blink, content) (Closed)

Created:
4 years ago by kinuko
Modified:
4 years ago
Reviewers:
esprehn, dcheng
CC:
chromium-reviews, tzik, posciak+watch_chromium.org, avayvod+watch_chromium.org, toyoshim+midi_chromium.org, dcheng, dmazzoni+watch_chromium.org, kinuko+watch, miu+watch_chromium.org, jsbell+serviceworker_chromium.org, awdf+watch_chromium.org, imcheng+watch_chromium.org, aboxhall+watch_chromium.org, jam, dglazkov+blink, je_julie, darin-cc_chromium.org, jkarlin+watch_chromium.org, devtools-reviews_chromium.org, blink-reviews, einbinder+watch-test-runner_chromium.org, xjz+watch_chromium.org, blink-reviews-api_chromium.org, blink-worker-reviews_chromium.org, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org, creis+watch_chromium.org, dtseng+watch_chromium.org, Peter Beverloo, jasonroberts+watch_google.com, mlamouri+watch-notifications_chromium.org, nhiroki, feature-media-reviews_chromium.org, yuzo+watch_chromium.org, mcasas+watch+vc_chromium.org, jsbell+idb_chromium.org, mlamouri+watch-manifest_chromium.org, jochen+watch_chromium.org, michaeln, shimazu+serviceworker_chromium.org, mlamouri+watch-test-runner_chromium.org, serviceworker-reviews, nektar+watch_chromium.org, isheriff+watch_chromium.org, kinuko+serviceworker, cmumford, horo+watch_chromium.org, kinuko+fileapi, pfeldman
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

WebString: makes string16 conversions explicit (part 1: blink, content) This is a series of patches that make WebString <-> string16 conversions explicit. Implicit conversions between WebString and string16 used to make it really easy to write inefficient code and should be removed. (More details can be found on crbug.com/667131) This CL changes implicit conversions to/from string16 by adding following methods: * static WebString WebString::fromUTF16(const string16&); * static WebString WebString::fromUTF16(const NullableString16&); * string16 WebString::utf16(); * static NullableString16 WebString::toNullableString16(); Revises/removes following unnecessary conversions: * UTF16ToUTF8(StringPiece16(webstring)) -> webstring.utf8() * WebString(UTF8ToUTF16(string)) -> WebString::fromUTF8(string) * WebString(ASCIIToUTF16(string)) -> WebString::fromASCII(string) * WebString(path.AsUTF8Unsafe()) -> FilePathToWebString(path) * base::IsStringASCII(webstring) -> webstring.containsOnlyASCII() * base::FilePath::FromUTF8Unsafe(webstring.utf8()) -> WebStringToFilePath(webstring) (This still doesn't fix inefficient String comparisons that require unnecessary string copies, it should be able to be fixed in a separate patch) BUG=667131

Patch Set 1 #

Patch Set 2 : drops some changes #

Patch Set 3 : rebase #

Patch Set 4 : fix #

Patch Set 5 : fix #

Patch Set 6 : fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+630 lines, -528 lines) Patch
M content/child/blink_platform_impl.cc View 3 chunks +10 lines, -8 lines 0 comments Download
M content/child/browser_font_resource_trusted.cc View 5 chunks +8 lines, -8 lines 0 comments Download
M content/child/database_util.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M content/child/db_message_filter.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M content/child/fileapi/webfilesystem_impl.cc View 5 chunks +16 lines, -19 lines 0 comments Download
M content/child/indexed_db/indexed_db_callbacks_impl.cc View 1 6 chunks +17 lines, -11 lines 0 comments Download
M content/child/indexed_db/indexed_db_database_callbacks_impl.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M content/child/indexed_db/indexed_db_key_builders.cc View 6 chunks +9 lines, -7 lines 0 comments Download
M content/child/indexed_db/webidbdatabase_impl.cc View 1 6 chunks +10 lines, -10 lines 0 comments Download
M content/child/indexed_db/webidbfactory_impl.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M content/child/notifications/notification_data_conversions.cc View 6 chunks +14 lines, -12 lines 0 comments Download
M content/child/notifications/notification_manager.cc View 1 2 3 chunks +3 lines, -6 lines 0 comments Download
M content/child/service_worker/service_worker_dispatcher.cc View 1 2 6 chunks +12 lines, -6 lines 0 comments Download
M content/child/service_worker/web_service_worker_impl.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M content/child/web_database_observer_impl.cc View 2 chunks +10 lines, -8 lines 0 comments Download
M content/child/web_url_loader_impl.cc View 1 2 3 5 chunks +17 lines, -36 lines 0 comments Download
M content/child/web_url_request_util.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/child/webfileutilities_impl.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M content/child/webmessageportchannel_impl.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M content/public/common/color_suggestion.cc View 1 chunk +1 line, -3 lines 0 comments Download
M content/public/common/window_container_type.cc View 1 chunk +8 lines, -5 lines 0 comments Download
M content/public/test/render_view_test.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M content/renderer/accessibility/render_accessibility_impl.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/browser_plugin/browser_plugin.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M content/renderer/cache_storage/cache_storage_dispatcher.cc View 1 2 3 7 chunks +10 lines, -13 lines 0 comments Download
M content/renderer/clipboard_utils.cc View 2 chunks +2 lines, -4 lines 0 comments Download
M content/renderer/context_menu_params_builder.cc View 4 chunks +7 lines, -6 lines 0 comments Download
M content/renderer/devtools/devtools_agent.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/dom_storage/dom_storage_dispatcher.cc View 1 chunk +8 lines, -12 lines 0 comments Download
M content/renderer/dom_storage/local_storage_area.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M content/renderer/dom_storage/local_storage_cached_area.cc View 3 chunks +8 lines, -5 lines 0 comments Download
M content/renderer/dom_storage/webstoragearea_impl.cc View 1 2 2 chunks +6 lines, -4 lines 0 comments Download
M content/renderer/drop_data_builder.cc View 2 chunks +8 lines, -7 lines 0 comments Download
M content/renderer/history_serialization.cc View 1 2 3 5 chunks +20 lines, -14 lines 0 comments Download
M content/renderer/manifest/manifest_parser.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M content/renderer/media/canvas_capture_handler.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/media_stream_renderer_factory_impl.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M content/renderer/media/midi_message_filter.cc View 4 chunks +17 lines, -16 lines 0 comments Download
M content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M content/renderer/media/peer_connection_tracker.cc View 3 chunks +7 lines, -9 lines 0 comments Download
M content/renderer/media/pepper_to_video_track_adapter.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/remote_media_stream_impl.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M content/renderer/media/rtc_data_channel_handler.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M content/renderer/media/rtc_dtmf_sender_handler.cc View 3 chunks +3 lines, -4 lines 0 comments Download
M content/renderer/media/rtc_peer_connection_handler.cc View 11 chunks +19 lines, -25 lines 0 comments Download
M content/renderer/media/user_media_client_impl.cc View 1 2 3 2 chunks +4 lines, -6 lines 0 comments Download
M content/renderer/menu_item_builder.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M content/renderer/pepper/host_globals.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/pepper/pepper_media_stream_video_track_host.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/renderer/pepper/pepper_plugin_instance_impl.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/pepper/pepper_plugin_instance_impl.cc View 1 2 3 2 chunks +3 lines, -5 lines 0 comments Download
M content/renderer/pepper/pepper_webplugin_impl.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M content/renderer/pepper/ppb_graphics_3d_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/pepper/url_request_info_util.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 25 chunks +52 lines, -70 lines 0 comments Download
M content/renderer/render_frame_proxy.cc View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 chunks +11 lines, -11 lines 0 comments Download
M content/renderer/render_widget.cc View 1 11 chunks +16 lines, -13 lines 0 comments Download
M content/renderer/renderer_blink_platform_impl.cc View 1 2 3 3 chunks +7 lines, -7 lines 0 comments Download
M content/renderer/renderer_webcookiejar_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/savable_resources.cc View 1 chunk +6 lines, -4 lines 0 comments Download
M content/renderer/service_worker/embedded_worker_dispatcher.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/service_worker/service_worker_context_client.cc View 1 2 11 chunks +20 lines, -21 lines 0 comments Download
M content/renderer/shared_worker/embedded_shared_worker_content_settings_client_proxy.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/shared_worker/embedded_shared_worker_stub.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M content/renderer/shared_worker_repository.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/renderer/speech_recognition_dispatcher.cc View 1 2 chunks +2 lines, -3 lines 0 comments Download
M content/renderer/webclipboard_impl.cc View 1 2 3 7 chunks +12 lines, -10 lines 0 comments Download
M content/shell/renderer/layout_test/blink_test_runner.cc View 1 2 chunks +2 lines, -7 lines 0 comments Download
M content/test/layouttest_support.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/test/mock_webclipboard_impl.cc View 10 chunks +21 lines, -19 lines 0 comments Download
M content/test/test_blink_web_unit_test_support.cc View 1 4 chunks +19 lines, -17 lines 0 comments Download
M third_party/WebKit/Source/platform/exported/FilePathConversion.cpp View 1 2 3 1 chunk +11 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/exported/FilePathConversionTest.cpp View 1 chunk +9 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/exported/WebString.cpp View 1 2 3 1 chunk +15 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/public/platform/FilePathConversion.h View 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/public/platform/StringVectorCopier.h View 1 2 3 4 5 1 chunk +42 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/WebString.h View 1 2 3 4 4 chunks +47 lines, -6 lines 0 comments Download

Messages

Total messages: 53 (48 generated)
kinuko
Just started to take a stab and then realized this touches large number of files ...
4 years ago (2016-11-30 05:24:17 UTC) #4
dcheng
I am definitely in favor of this. However, I'm curious: do we really need to ...
4 years ago (2016-11-30 06:10:53 UTC) #5
kinuko
On 2016/11/30 06:10:53, dcheng wrote: > I am definitely in favor of this. > > ...
4 years ago (2016-11-30 12:18:26 UTC) #6
kinuko
It's ready for review now, stripped the change and now this CL only has changes ...
4 years ago (2016-12-07 03:24:38 UTC) #51
kinuko
4 years ago (2016-12-12 08:06:55 UTC) #53
On 2016/12/07 03:24:38, kinuko wrote:
> It's ready for review now, stripped the change and now this CL only has
changes
> for content/ and blink/.  Latin1 related methods are still left as is in this
> patch (looks like some can be easily converted but a few are not).
> 
> PTL (Esp. changes in public/platform)

Hm.  I'll upload a cleaner patch in a fresh issue.

Powered by Google App Engine
This is Rietveld 408576698