New issue
Advanced search Search tips

Issue 663729 link

Starred by 2 users

Issue metadata

Status: Started
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Migrate GURL method callers to get StringPieces rather than strings

Project Member Reported by csharrison@chromium.org, Nov 9 2016

Issue description

GURL has host_piece and path_piece, but those APIs are newer, and less used . Many consumers do not need to copy the underlying string, so we should either migrate them to use the _piece version, or simplify GURL's API and only vend StringPieces (callers can just use as_string() on the result).
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5

commit 88b3b717eaf289cad99f4ed87bd75e94f15ca6e5
Author: csharrison <csharrison@chromium.org>
Date: Mon Nov 14 23:12:35 2016

Convert GURL::{host,path} to GURL::{host_piece,path_piece} for ==.

host(), path() and friends copy data into a std::string. For comparisons
this is unnecessary.

BUG=663729
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2478573004
Cr-Commit-Position: refs/heads/master@{#431952}

[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/banners/app_banner_manager.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/chrome_content_browser_client.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/download/download_request_limiter.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/policy/policy_helpers.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/prerender/prerender_util.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/renderer_context_menu/context_menu_content_type_factory.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/renderer_context_menu/render_view_context_menu.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/safe_browsing/browser_feature_extractor.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/search/iframe_source.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/search/local_ntp_source.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/search/search.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/sessions/session_common_utils.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/ui/browser.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/ui/browser_navigator.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/ui/extensions/hosted_app_browser_controller.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/ui/startup/startup_tab_provider.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/ui/tabs/tab_strip_model.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/browser/ui/webui/options/options_ui.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/common/search/search_urls.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/renderer/printing/chrome_print_web_view_helper_delegate.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/chrome/utility/importer/bookmarks_file_importer.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/components/autofill/core/browser/form_structure.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/components/cloud_devices/common/cloud_devices_urls.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/components/history/core/browser/history_match.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/components/history/core/browser/url_utils.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/components/ntp_tiles/most_visited_sites.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/components/omnibox/browser/history_url_provider.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/components/omnibox/browser/omnibox_edit_model.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/components/password_manager/core/browser/password_form_manager.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/components/search_engines/template_url_service.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/components/sessions/content/content_serialized_navigation_driver.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/components/url_formatter/url_formatter.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/content/browser/appcache/appcache_quota_client.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/content/browser/frame_host/debug_urls.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/content/browser/loader/resource_dispatcher_host_impl.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/content/browser/net/view_blob_internals_job_factory.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/content/browser/net/view_http_cache_job_factory.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/content/browser/webui/content_web_ui_controller_factory.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/content/browser/webui/url_data_manager_backend.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/extensions/browser/extension_error.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/net/http/http_stream_factory_impl_job_controller.cc
[modify] https://crrev.com/88b3b717eaf289cad99f4ed87bd75e94f15ca6e5/net/quic/core/quic_server_id.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Apr 30 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/03345cedd4e1b5ca27baab9ca20de23e6cfac7ff

commit 03345cedd4e1b5ca27baab9ca20de23e6cfac7ff
Author: Reilly Grant <reillyg@chromium.org>
Date: Mon Apr 30 23:16:32 2018

Use host_piece() when comparing web store URL

This change avoids allocating an additional std::string by using the
host_piece() method on GURL instead of using host() when comparing
against another GURL.

Bug: 663729
Change-Id: I3afd3aeccc0ecca4c04a77543adbdb856a78940e
Reviewed-on: https://chromium-review.googlesource.com/1036444
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554914}
[modify] https://crrev.com/03345cedd4e1b5ca27baab9ca20de23e6cfac7ff/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc

Sign in to add a comment