Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 836e1d17c4ea38f965511d9d13acf983d50760e5
      
https://github.com/WebKit/WebKit/commit/836e1d17c4ea38f965511d9d13acf983d50760e5
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-07-15 (Wed, 15 Jul 2026)

  Changed paths:
    M Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp

  Log Message:
  -----------
  [Web Inspector] Avoid redundant String copy of request URL in 
InspectorNetworkAgent::willSendRequest
https://bugs.webkit.org/show_bug.cgi?id=319456
rdar://182268053

Reviewed by Devin Rousso.

In willSendRequest(), the local `url` was declared as `String`, copying the
string returned by `DocumentLoader::url().string()` / 
`ResourceRequest::url().string()`.
Both accessors return a `const URL&` (LIFETIME_BOUND) and `URL::string()` 
returns
a `const String&`, so the value can be bound directly to a reference. Both the
loader and the request outlive the requestWillBeSent() dispatch, and the 
frontend
dispatcher takes `const String& documentURL`, so no copy is required.

Bind `url` with `auto&` (deduces to `const String&`) to drop the gratuitous
ref-count churn.

* Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::willSendRequest):

Canonical link: https://commits.webkit.org/317223@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to