Allow setting multiple URLs for text/uri-list drag type [chromium/src : main]

0 views
Skip to first unread message

Joone Hur (Gerrit)

unread,
Jun 2, 2025, 7:47:07 PMJun 2
to Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
Attention needed from Daniel Cheng

Joone Hur added 1 comment

Patchset-level comments
File-level comment, Patchset 20 (Latest):
Joone Hur . resolved

Hi, could you review this CL?

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
Gerrit-Change-Number: 6608042
Gerrit-PatchSet: 20
Gerrit-Owner: Joone Hur <joon...@microsoft.com>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Mon, 02 Jun 2025 23:46:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Rakina Zata Amni (Gerrit)

unread,
Jun 13, 2025, 1:58:09 AMJun 13
to Joone Hur, Min Qin, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
Attention needed from Daniel Cheng, David Trainor, Joone Hur and Min Qin

Rakina Zata Amni voted and added 1 comment

Votes added by Rakina Zata Amni

Code-Review+1

1 comment

Patchset-level comments
Rakina Zata Amni . resolved

content/ changes LGTM, sorry for the delay!

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
  • David Trainor
  • Joone Hur
  • Min Qin
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
Gerrit-Change-Number: 6608042
Gerrit-PatchSet: 20
Gerrit-Owner: Joone Hur <joon...@microsoft.com>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
Gerrit-Reviewer: Min Qin <qin...@chromium.org>
Gerrit-Reviewer: Rakina Zata Amni <rak...@chromium.org>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: David Trainor <dtra...@chromium.org>
Gerrit-Attention: Min Qin <qin...@chromium.org>
Gerrit-Attention: Joone Hur <joon...@microsoft.com>
Gerrit-Comment-Date: Fri, 13 Jun 2025 05:57:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

David Trainor (Gerrit)

unread,
Jun 13, 2025, 5:24:21 PMJun 13
to Joone Hur, Rakina Zata Amni, Min Qin, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
Attention needed from Daniel Cheng, Joone Hur and Min Qin

David Trainor added 2 comments

Patchset-level comments
David Trainor . resolved

chrome/browser changes are minimal - will stamp once ui/base/dragdrop is reviewed!

File ui/base/dragdrop/os_exchange_data_provider.h
Line 79, Patchset 20 (Latest): GURL url() const;
~UrlInfo();
std::vector<GURL> urls;
David Trainor . unresolved

I'm not an owner of this directory so will defer to the right folks - not sure how I feel about having urls get added to this, but "url" and "title" represent the first one. Just wanted to flag it!

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
  • Joone Hur
  • Min Qin
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
    Gerrit-Change-Number: 6608042
    Gerrit-PatchSet: 20
    Gerrit-Owner: Joone Hur <joon...@microsoft.com>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
    Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
    Gerrit-Reviewer: Min Qin <qin...@chromium.org>
    Gerrit-Reviewer: Rakina Zata Amni <rak...@chromium.org>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Attention: Min Qin <qin...@chromium.org>
    Gerrit-Attention: Joone Hur <joon...@microsoft.com>
    Gerrit-Comment-Date: Fri, 13 Jun 2025 21:24:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Cheng (Gerrit)

    unread,
    Jun 14, 2025, 3:08:01 AMJun 14
    to Joone Hur, Rakina Zata Amni, Min Qin, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
    Attention needed from Joone Hur and Min Qin

    Daniel Cheng added 18 comments

    Patchset-level comments
    File-level comment, Patchset 22 (Latest):
    Daniel Cheng . unresolved

    My biggest concern is about the platform-specific plumbing. I'm not sure many OSes actually support multiple URLs in their default URL type (see the comments about Windows and Mac). We may need to do something else to make it work well.

    My other comment is about the invariants we want to maintain. To make the APIs easier to use, I propose:

    • don't allow any invalid GURLs in the various URL lists. So when we're parsing out the URL lists, that means validating that they're actually valid URLs before appending them to the list.
    • an empty list means no URLs at all
    • the various SetURL()/SetURLs() functions should only be called if there is a non-empty list of URLs
    File chrome/browser/ui/views/frame/multi_contents_view_drop_target_controller.cc
    Line 35, Patchset 22 (Latest): if (data.urls.empty() || !data.urls.front().is_valid() || is_in_split_view) {
    Daniel Cheng . unresolved

    Should we really have invalid URLs here?

    I think we should avoid having invalid URLs in this list; instead, whether or not the list is empty should represent whether or not URLs are present.

    File content/app_shim_remote_cocoa/web_drag_source_mac.mm
    Line 213, Patchset 22 (Latest): NSURL* url = net::NSURLWithGURL(_dropData.url());
    Daniel Cheng . unresolved

    IIRC, this is the bit that produces the drag data asynchronously. But we only ever produce one URL–so does that mean this only sort of works on Mac?

    File content/browser/renderer_host/data_transfer_util.cc
    Line 172, Patchset 22 (Latest): }
    Daniel Cheng . resolved

    It's too bad `base::JoinString()` doesn't take a projection.

    You could also save some steps here: if the GURLs are valid, they should only contain ASCII characters. So we can do:

    ```
    std::u16string merged_urls;
    for (const auto& url : drop_data.urls) {
    DCHECK(base::IsStringASCII(url.spec());
    if (!merged_urls.empty()) {
    merged_urls += "\r\n";
    }
    merged_urls.append(url.spec().begin(), url.spec().end());
    }
    ```

    But probably we should just change the Mojo type to avoid these conversions. I suppose that's mostly out of scope here though.

    Line 306, Patchset 22 (Latest): std::vector<std::u16string> urls16 = base::SplitString(
    Daniel Cheng . unresolved

    Use SplitStringPiece() here please, to avoid allocating a new string for each thing.

    File content/browser/web_contents/web_contents_view_aura.cc
    Line 717, Patchset 22 (Latest): if (std::optional<ui::OSExchangeData::UrlInfo> url = data.GetURLAndTitle(
    Daniel Cheng . unresolved

    rename this url_info; that was my oversight when I wrote this originally

    Line 719, Patchset 22 (Latest): url.has_value() && !url->urls.empty()) {
    Daniel Cheng . unresolved

    I think we should probably guarantee `urls` is non-empty if we return a `url_info` here.

    File content/public/common/drop_data.h
    Line 79, Patchset 22 (Latest): GURL url() const;
    Daniel Cheng . unresolved

    Remove this, or have it return a `const GURL*`, returning non-null only if `urls` is non-empty.

    File ui/base/clipboard/clipboard_util_win.cc
    Line 98, Patchset 22 (Latest): std::vector<std::u16string> urls16 = base::SplitString(
    Daniel Cheng . unresolved

    SplitStringPiece() here as well, to avoid allocations.

    That being said... I'm not sure if this is really correct. This is used to process some pre-existing formats on the clipboard, which expect to be a certain shape.

    Line 534, Patchset 22 (Latest): // Mozilla URL format or Unicode URL
    Daniel Cheng . unresolved

    e.g. do we really expect a list of URLs in these clipboard formats? Will other apps expect a list of URLs/incorrectly treat the second URL as the title? If I remember correctly, this format isn't determined solely by Chrome; it's used for interop with other OS apps.

    Line 558, Patchset 22 (Latest): urls = {net::FilePathToFileURL(base::FilePath(filenames[0]))};
    Daniel Cheng . unresolved

    Since we're using a vector-based approach now, let's avoid even adding the GURL to the list if it's invalid.

    File ui/base/dragdrop/os_exchange_data_provider.h
    Line 82, Patchset 22 (Latest): std::u16string title;
    Daniel Cheng . unresolved

    There should be a comment here that states that this is the title for the first URL, if there is any.

    Line 79, Patchset 20: GURL url() const;

    ~UrlInfo();
    std::vector<GURL> urls;
    David Trainor . unresolved

    I'm not an owner of this directory so will defer to the right folks - not sure how I feel about having urls get added to this, but "url" and "title" represent the first one. Just wanted to flag it!

    Daniel Cheng

    I'm fine with this (modulo the plumbing questions), but I think this should also have a comment/guarantee about not including invalid GURLs in the list.

    File ui/base/dragdrop/os_exchange_data_provider_mac.mm
    Line 188, Patchset 22 (Latest): GURL url = urls.empty() ? GURL() : urls.front();
    Daniel Cheng . unresolved

    Is it really OK to drop the rest of the URLs on the floor here?

    Line 189, Patchset 22 (Latest): NSArray<NSPasteboardItem*>* items = clipboard_util::PasteboardItemsFromUrls(
    Daniel Cheng . unresolved

    Do we really want to continue with the rest of this work if there aren't any URLs? I'm not sure we would have called this before... would we?

    File ui/base/dragdrop/os_exchange_data_provider_non_backed.cc
    Line 77, Patchset 22 (Latest): title_ = title;
    Daniel Cheng . unresolved

    We should not do any of this if urls is empty (probably we should not call this function at all)

    File ui/base/dragdrop/os_exchange_data_provider_win.cc
    Line 346, Patchset 22 (Latest): std::string url_list;
    Daniel Cheng . unresolved

    Same comment here; we probably don't want to allow calling this function with an empty list of URLs.

    Line 382, Patchset 22 (Latest): ClipboardFormatType::UrlType().ToFormatEtc(), storage));
    Daniel Cheng . unresolved

    I'm not sure that it's valid to pass a URL list here.

    https://learn.microsoft.com/en-us/windows/win32/shell/clipboard#cfstr_ineturl

    "This format gives the best clipboard representation of a single URL."

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joone Hur
    • Min Qin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
    Gerrit-Change-Number: 6608042
    Gerrit-PatchSet: 22
    Gerrit-Owner: Joone Hur <joon...@microsoft.com>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
    Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
    Gerrit-Reviewer: Min Qin <qin...@chromium.org>
    Gerrit-Reviewer: Rakina Zata Amni <rak...@chromium.org>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-Attention: Min Qin <qin...@chromium.org>
    Gerrit-Attention: Joone Hur <joon...@microsoft.com>
    Gerrit-Comment-Date: Sat, 14 Jun 2025 07:07:47 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: David Trainor <dtra...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Avi Drissman (Gerrit)

    unread,
    Jun 14, 2025, 11:16:34 AMJun 14
    to Joone Hur, Avi Drissman, Rakina Zata Amni, Min Qin, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
    Attention needed from Joone Hur and Min Qin

    Avi Drissman voted and added 3 comments

    Votes added by Avi Drissman

    Code-Review-1

    3 comments

    Patchset-level comments
    Avi Drissman . resolved

    I object to the design. URLs have titles, and if we want to plumb a list of URLs, we need to plumb a parallel list of titles.

    File ui/base/dragdrop/os_exchange_data_provider_mac.mm
    Line 188, Patchset 22 (Latest): GURL url = urls.empty() ? GURL() : urls.front();
    Daniel Cheng . unresolved

    Is it really OK to drop the rest of the URLs on the floor here?

    Avi Drissman

    We have a call to create multiple pasteboard items (`clipboard_util::PasteboardItemsFromUrls`) and a call to put multiple pasteboard items onto the pasteboard (`clipboard_util::AddDataToPasteboard`). It’s more work to drop the extra URLs than to just remove the call to `.firstObject` below.

    File ui/base/x/x11_os_exchange_data_provider.h
    Line 77, Patchset 22 (Latest): void SetURLs(const std::vector<GURL>& urls,
    std::u16string_view title) override;
    Avi Drissman . unresolved

    This API doesn’t make sense. Each URL has a title, so we’d need a parallel array of titles.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joone Hur
    • Min Qin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is blockingCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
    Gerrit-Change-Number: 6608042
    Gerrit-PatchSet: 22
    Gerrit-Owner: Joone Hur <joon...@microsoft.com>
    Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
    Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
    Gerrit-Reviewer: Min Qin <qin...@chromium.org>
    Gerrit-Reviewer: Rakina Zata Amni <rak...@chromium.org>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-Attention: Min Qin <qin...@chromium.org>
    Gerrit-Attention: Joone Hur <joon...@microsoft.com>
    Gerrit-Comment-Date: Sat, 14 Jun 2025 15:16:28 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
    satisfied_requirement
    blocking_requirement
    unsatisfied_requirement
    open
    diffy

    Avi Drissman (Gerrit)

    unread,
    Jun 14, 2025, 3:34:47 PMJun 14
    to Joone Hur, Avi Drissman, Rakina Zata Amni, Min Qin, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
    Attention needed from Joone Hur and Min Qin

    Avi Drissman added 1 comment

    File content/public/common/drop_data.h
    Line 89, Patchset 22 (Latest): // Holds one or more URLs, such as those from dragging links or images.
    // For text/uri-list drag types, this contains multiple URLs.
    // https://www.rfc-editor.org/rfc/rfc2483#section-5
    std::vector<GURL> urls;
    std::u16string url_title; // The title associated with `url`.
    Avi Drissman . unresolved

    Same objection here; each URL should be matched with a title (an optional one, but still).

    Gerrit-Comment-Date: Sat, 14 Jun 2025 19:34:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    blocking_requirement
    unsatisfied_requirement
    open
    diffy

    Avi Drissman (Gerrit)

    unread,
    Jun 15, 2025, 5:15:11 PMJun 15
    to Joone Hur, Avi Drissman, Rakina Zata Amni, Min Qin, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
    Attention needed from Joone Hur and Min Qin

    Avi Drissman added 1 comment

    File content/browser/web_contents/web_drag_dest_mac.mm
    Line 496, Patchset 22 (Latest): drop_data.urls = {
    GURL(base::SysNSStringToUTF8(urls_and_titles.firstObject.URL))};
    drop_data.url_title =
    base::SysNSStringToUTF16(urls_and_titles.firstObject.title);
    }
    Avi Drissman . unresolved

    Please wire up all URLs here. This code dropped all but the first on the floor because `DropData` couldn’t handle more than one. With this CL it can, so we should take advantage of that.

    Gerrit-Comment-Date: Sun, 15 Jun 2025 21:15:03 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    blocking_requirement
    unsatisfied_requirement
    open
    diffy

    Rakina Zata Amni (Gerrit)

    unread,
    Jun 15, 2025, 9:03:29 PMJun 15
    to Joone Hur, Avi Drissman, Min Qin, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
    Attention needed from Joone Hur and Min Qin

    Rakina Zata Amni voted and added 1 comment

    Votes added by Rakina Zata Amni

    Code-Review+0

    1 comment

    Patchset-level comments
    Rakina Zata Amni . resolved

    content/ changes LGTM, sorry for the delay!

    Rakina Zata Amni

    Ah, I only looked at the changes as a "change URL -> list of URLs" change, but it looks like there are more concerns for this around the titles etc. Since avi@ is also a content/ owner and has concerns about this, let me remove my +1 and move myself to cc (sorry about the confusion, and thanks avi@ and dcheng@!).

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joone Hur
    • Min Qin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is blockingCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
    Gerrit-Change-Number: 6608042
    Gerrit-PatchSet: 22
    Gerrit-Owner: Joone Hur <joon...@microsoft.com>
    Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
    Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
    Gerrit-Reviewer: Min Qin <qin...@chromium.org>
    Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-Attention: Min Qin <qin...@chromium.org>
    Gerrit-Attention: Joone Hur <joon...@microsoft.com>
    Gerrit-Comment-Date: Mon, 16 Jun 2025 01:02:53 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Rakina Zata Amni <rak...@chromium.org>
    satisfied_requirement
    blocking_requirement
    unsatisfied_requirement
    open
    diffy

    Avi Drissman (Gerrit)

    unread,
    Jun 16, 2025, 11:15:08 AMJun 16
    to Joone Hur, Rakina Zata Amni, Avi Drissman, Min Qin, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
    Attention needed from Joone Hur, Min Qin and Rakina Zata Amni

    Avi Drissman voted and added 1 comment

    Votes added by Avi Drissman

    Code-Review+0

    1 comment

    Patchset-level comments
    Rakina Zata Amni . resolved

    content/ changes LGTM, sorry for the delay!

    Rakina Zata Amni

    Ah, I only looked at the changes as a "change URL -> list of URLs" change, but it looks like there are more concerns for this around the titles etc. Since avi@ is also a content/ owner and has concerns about this, let me remove my +1 and move myself to cc (sorry about the confusion, and thanks avi@ and dcheng@!).

    Avi Drissman

    No problem.

    This is a “url → list of urls” change, but if we do that (and I am happy to see such a change!) it should be done fully.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joone Hur
    • Min Qin
    • Rakina Zata Amni
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
    Gerrit-Change-Number: 6608042
    Gerrit-PatchSet: 22
    Gerrit-Owner: Joone Hur <joon...@microsoft.com>
    Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
    Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
    Gerrit-Reviewer: Min Qin <qin...@chromium.org>
    Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-Attention: Rakina Zata Amni <rak...@chromium.org>
    Gerrit-Attention: Min Qin <qin...@chromium.org>
    Gerrit-Attention: Joone Hur <joon...@microsoft.com>
    Gerrit-Comment-Date: Mon, 16 Jun 2025 15:14:58 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joone Hur (Gerrit)

    unread,
    Jun 17, 2025, 6:37:28 PMJun 17
    to Rakina Zata Amni, Avi Drissman, Min Qin, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
    Attention needed from Min Qin and Rakina Zata Amni

    Joone Hur added 1 comment

    Patchset-level comments
    File-level comment, Patchset 22 (Latest):
    Joone Hur . resolved

    Thanks for the feedback! I will update this CL this week.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Min Qin
    • Rakina Zata Amni
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
    Gerrit-Change-Number: 6608042
    Gerrit-PatchSet: 22
    Gerrit-Owner: Joone Hur <joon...@microsoft.com>
    Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
    Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
    Gerrit-Reviewer: Min Qin <qin...@chromium.org>
    Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-Attention: Rakina Zata Amni <rak...@chromium.org>
    Gerrit-Attention: Min Qin <qin...@chromium.org>
    Gerrit-Comment-Date: Tue, 17 Jun 2025 22:37:19 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joone Hur (Gerrit)

    unread,
    Jul 5, 2025, 3:35:23 AMJul 5
    to Rakina Zata Amni, Avi Drissman, Min Qin, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
    Attention needed from Avi Drissman, Daniel Cheng, David Trainor and Min Qin

    Joone Hur added 20 comments

    Patchset-level comments
    File-level comment, Patchset 37 (Latest):
    Joone Hur . resolved

    I’ve updated the CL based on your suggestions. The major change is the introduction of the ui::ClipboardUrlInfo struct, which holds a URL and its title. This struct is now used to support multiple URLs via a std::vector<ui::ClipboardUrlInfo>, replacing the previous urlInfo in OSExchangeData and the url & url_title properties in DropData.

    There are many updates in this CL. Please let me know if I missed anything or if further changes are needed.

    File chrome/browser/ui/views/frame/multi_contents_view_drop_target_controller.cc
    Line 35, Patchset 22: if (data.urls.empty() || !data.urls.front().is_valid() || is_in_split_view) {
    Daniel Cheng . resolved

    Should we really have invalid URLs here?

    I think we should avoid having invalid URLs in this list; instead, whether or not the list is empty should represent whether or not URLs are present.

    Joone Hur

    Done

    File content/app_shim_remote_cocoa/web_drag_source_mac.mm
    Line 213, Patchset 22: NSURL* url = net::NSURLWithGURL(_dropData.url());
    Daniel Cheng . resolved

    IIRC, this is the bit that produces the drag data asynchronously. But we only ever produce one URL–so does that mean this only sort of works on Mac?

    Joone Hur

    url() is intended to return a single URL so it should also work on Mac. I'll replace url() with front().url here.

    File content/browser/renderer_host/data_transfer_util.cc
    Line 306, Patchset 22: std::vector<std::u16string> urls16 = base::SplitString(
    Daniel Cheng . resolved

    Use SplitStringPiece() here please, to avoid allocating a new string for each thing.

    Joone Hur

    Done

    File content/browser/web_contents/web_contents_view_aura.cc
    Line 717, Patchset 22: if (std::optional<ui::OSExchangeData::UrlInfo> url = data.GetURLAndTitle(
    Daniel Cheng . resolved

    rename this url_info; that was my oversight when I wrote this originally

    Joone Hur

    Done

    Line 719, Patchset 22: url.has_value() && !url->urls.empty()) {
    Daniel Cheng . resolved

    I think we should probably guarantee `urls` is non-empty if we return a `url_info` here.

    Joone Hur

    Done

    File content/browser/web_contents/web_drag_dest_mac.mm
    Line 496, Patchset 22: drop_data.urls = {

    GURL(base::SysNSStringToUTF8(urls_and_titles.firstObject.URL))};
    drop_data.url_title =
    base::SysNSStringToUTF16(urls_and_titles.firstObject.title);
    }
    Avi Drissman . resolved

    Please wire up all URLs here. This code dropped all but the first on the floor because `DropData` couldn’t handle more than one. With this CL it can, so we should take advantage of that.

    Joone Hur

    Done

    File content/public/common/drop_data.h
    Line 89, Patchset 22: // Holds one or more URLs, such as those from dragging links or images.

    // For text/uri-list drag types, this contains multiple URLs.
    // https://www.rfc-editor.org/rfc/rfc2483#section-5
    std::vector<GURL> urls;
    std::u16string url_title; // The title associated with `url`.
    Avi Drissman . resolved

    Same objection here; each URL should be matched with a title (an optional one, but still).

    Joone Hur

    Done

    Line 79, Patchset 22: GURL url() const;
    Daniel Cheng . resolved

    Remove this, or have it return a `const GURL*`, returning non-null only if `urls` is non-empty.

    Joone Hur

    Done

    File ui/base/clipboard/clipboard_util_win.cc
    Line 98, Patchset 22: std::vector<std::u16string> urls16 = base::SplitString(
    Daniel Cheng . resolved

    SplitStringPiece() here as well, to avoid allocations.

    That being said... I'm not sure if this is really correct. This is used to process some pre-existing formats on the clipboard, which expect to be a certain shape.

    Joone Hur

    Done

    Line 534, Patchset 22: // Mozilla URL format or Unicode URL
    Daniel Cheng . resolved

    e.g. do we really expect a list of URLs in these clipboard formats? Will other apps expect a list of URLs/incorrectly treat the second URL as the title? If I remember correctly, this format isn't determined solely by Chrome; it's used for interop with other OS apps.

    Joone Hur

    According to the spec, they should return a list of URLs, but Chromium doesn't handle multiple URLs properly—this is the core issue. While the Windows clipboard format(CFSTR_INETURL) isn't designed for multiple URLs, we can still set them using a delimiter. On MacOS, this change enables support for multiple URLs.

    Line 558, Patchset 22: urls = {net::FilePathToFileURL(base::FilePath(filenames[0]))};
    Daniel Cheng . resolved

    Since we're using a vector-based approach now, let's avoid even adding the GURL to the list if it's invalid.

    Joone Hur

    Done

    File ui/base/dragdrop/os_exchange_data_provider.h
    Line 82, Patchset 22: std::u16string title;
    Daniel Cheng . resolved

    There should be a comment here that states that this is the title for the first URL, if there is any.

    Joone Hur

    With the proposed change to use std::vector<ClipboardUrlInfo>, each UrlInfo object in the vector can hold its own title.

    Line 79, Patchset 20: GURL url() const;
    ~UrlInfo();
    std::vector<GURL> urls;
    David Trainor . resolved

    I'm not an owner of this directory so will defer to the right folks - not sure how I feel about having urls get added to this, but "url" and "title" represent the first one. Just wanted to flag it!

    Daniel Cheng

    I'm fine with this (modulo the plumbing questions), but I think this should also have a comment/guarantee about not including invalid GURLs in the list.

    Joone Hur

    Instead of modifying struct UrlInfo, I'll use std::vector<ClipboardUrlInfo> to hold the URL information.

    File ui/base/dragdrop/os_exchange_data_provider_mac.mm
    Line 188, Patchset 22: GURL url = urls.empty() ? GURL() : urls.front();
    Daniel Cheng . unresolved

    Is it really OK to drop the rest of the URLs on the floor here?

    Avi Drissman

    We have a call to create multiple pasteboard items (`clipboard_util::PasteboardItemsFromUrls`) and a call to put multiple pasteboard items onto the pasteboard (`clipboard_util::AddDataToPasteboard`). It’s more work to drop the extra URLs than to just remove the call to `.firstObject` below.

    Joone Hur

    can we separate the multiple URL support for Mac into a follow-up change?

    Line 189, Patchset 22: NSArray<NSPasteboardItem*>* items = clipboard_util::PasteboardItemsFromUrls(
    Daniel Cheng . resolved

    Do we really want to continue with the rest of this work if there aren't any URLs? I'm not sure we would have called this before... would we?

    Joone Hur

    We need to return early if urls is empty here. I'll add that check.

    File ui/base/dragdrop/os_exchange_data_provider_non_backed.cc
    Line 77, Patchset 22: title_ = title;
    Daniel Cheng . resolved

    We should not do any of this if urls is empty (probably we should not call this function at all)

    Joone Hur

    Done

    File ui/base/dragdrop/os_exchange_data_provider_win.cc
    Line 346, Patchset 22: std::string url_list;
    Daniel Cheng . resolved

    Same comment here; we probably don't want to allow calling this function with an empty list of URLs.

    Joone Hur

    Done

    Line 382, Patchset 22: ClipboardFormatType::UrlType().ToFormatEtc(), storage));
    Daniel Cheng . unresolved

    I'm not sure that it's valid to pass a URL list here.

    https://learn.microsoft.com/en-us/windows/win32/shell/clipboard#cfstr_ineturl

    "This format gives the best clipboard representation of a single URL."

    Joone Hur

    For multiple URLs, we can provide them in CF_TEXT as a standard fallback. For a single URL, we need to continue providing it in CFSTR_INETURL for compatibility with other applications.

    File ui/base/x/x11_os_exchange_data_provider.h
    Line 77, Patchset 22: void SetURLs(const std::vector<GURL>& urls,
    std::u16string_view title) override;
    Avi Drissman . resolved

    This API doesn’t make sense. Each URL has a title, so we’d need a parallel array of titles.

    Joone Hur

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Avi Drissman
    • Daniel Cheng
    • David Trainor
    • Min Qin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
    Gerrit-Change-Number: 6608042
    Gerrit-PatchSet: 37
    Gerrit-Owner: Joone Hur <joon...@microsoft.com>
    Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
    Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
    Gerrit-Reviewer: Min Qin <qin...@chromium.org>
    Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Attention: Avi Drissman <a...@chromium.org>
    Gerrit-Attention: David Trainor <dtra...@chromium.org>
    Gerrit-Attention: Min Qin <qin...@chromium.org>
    Gerrit-Comment-Date: Sat, 05 Jul 2025 07:35:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
    Comment-In-Reply-To: Avi Drissman <a...@chromium.org>
    Comment-In-Reply-To: David Trainor <dtra...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Avi Drissman (Gerrit)

    unread,
    Jul 5, 2025, 3:02:22 PMJul 5
    to Joone Hur, Rakina Zata Amni, Avi Drissman, Min Qin, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
    Attention needed from Daniel Cheng, David Trainor, Joone Hur and Min Qin

    Avi Drissman added 7 comments

    File chrome/browser/ui/bookmarks/bookmark_browsertest.cc
    Line 475, Patchset 37 (Latest): EXPECT_EQ(page_url, url_infos->front().url);
    EXPECT_EQ(page_title, url_infos->front().title);
    #if !BUILDFLAG(IS_WIN)
    Avi Drissman . unresolved

    Check for exactly one value in `url_infos` before checking the url/title?

    Line 555, Patchset 37 (Latest):#if BUILDFLAG(IS_MAC)
    // On the Mac, the clipboard can hold multiple items, each with
    // different representations. Therefore, when the "write multiple URLs"
    // call is made, a full-fledged array of objects and types are written
    // to the clipboard, providing rich interoperability with the rest of
    // the OS and other apps. Then, when `GetURLAndTitle` is called, it
    // looks at the clipboard, sees URL and title data, and returns true.
    std::optional<std::vector<ui::ClipboardUrlInfo>> url_infos =
    drag_data->GetURLAndTitle(
    ui::FilenameToURLPolicy::DO_NOT_CONVERT_FILENAMES);
    ASSERT_TRUE(url_infos.has_value());

    // The bookmarks are added in order, and the first is retrieved, so
    // expect the values from the first bookmark.
    EXPECT_EQ(page_title, url_infos->front().title);
    EXPECT_EQ(page_url, url_infos->front().url);
    #else
    // On other platforms, because they don't have the concept of multiple
    // items on the clipboard, single URLs are added as a URL, but multiple
    // URLs are added as a data blob opaque to the outside world. Then, when
    // `GetURLAndTitle` is called, it's unable to extract any single URL,
    // and returns false.
    EXPECT_FALSE(drag_data
    ->GetURLAndTitle(
    ui::FilenameToURLPolicy::DO_NOT_CONVERT_FILENAMES)
    .has_value());
    #endif
    #if !BUILDFLAG(IS_WIN)
    Avi Drissman . unresolved

    This difference in behavior between Mac/non-Mac is due to the exact thing that you’re changing in this CL. For followup, would we need to change this section?

    File content/app_shim_remote_cocoa/web_drag_source_mac.mm
    Line 212, Patchset 37 (Latest): DCHECK(!_dropData.url_infos.empty());
    NSURL* url = net::NSURLWithGURL(_dropData.url_infos.front().url);
    // If NSURL creation failed, check for a badly-escaped JavaScript URL.
    // Strip out any existing escapes and then re-escape uniformly.
    if (!url &&
    _dropData.url_infos.front().url.SchemeIs(url::kJavaScriptScheme)) {
    std::string unescapedUrlString = base::UnescapeBinaryURLComponent(
    _dropData.url_infos.front().url.spec());
    std::string escapedUrlString =
    base::EscapeUrlEncodedData(unescapedUrlString, false);
    url = [NSURL URLWithString:base::SysUTF8ToNSString(escapedUrlString)];
    }
    return url.absoluteString;
    }

    // URL title.
    if ([type isEqualToString:ui::kUTTypeUrlName]) {
    return base::SysUTF16ToNSString(_dropData.url_infos.front().title);
    }
    Avi Drissman . unresolved

    Oh boy.

    The problem here is that this code assumes that the webpage is initiating a drag of a single object. We’d have to rethink how to do this if we have to initiate a drag of multiple objects.

    This is fine for now but can you file a bug for followup? This is going to be a longer-range refactor of the code.

    File content/public/common/common_param_traits_macros.h
    Line 73, Patchset 37 (Latest):IPC_STRUCT_TRAITS_BEGIN(ui::ClipboardUrlInfo)
    Avi Drissman . unresolved

    Can you define a `ui::` structure here in content? Do we still even use these macros files with mojo?

    File ui/base/dragdrop/os_exchange_data.h
    Line 123, Patchset 37 (Latest): std::optional<std::vector<ClipboardUrlInfo>> GetURLAndTitle(
    FilenameToURLPolicy policy) const;
    std::optional<std::vector<ui::ClipboardUrlInfo>> GetURLs(
    FilenameToURLPolicy policy) const;
    // Return information about the contained files, if any.
    Avi Drissman . unresolved

    The bifurcation was “get one url and its title” and “get many urls but no titles”. This is a chance to unify those two, and since we already have to change every caller, can we merge these together as `GetURLs()`? From this interface it seems these are redundant.

    Line 125, Patchset 37 (Latest): std::optional<std::vector<ui::ClipboardUrlInfo>> GetURLs(
    Avi Drissman . unresolved

    You’re in the `ui::` namespace so no need to qualify here.

    File ui/base/dragdrop/os_exchange_data_provider_mac.mm
    Line 188, Patchset 22: GURL url = urls.empty() ? GURL() : urls.front();
    Daniel Cheng . resolved

    Is it really OK to drop the rest of the URLs on the floor here?

    Avi Drissman

    We have a call to create multiple pasteboard items (`clipboard_util::PasteboardItemsFromUrls`) and a call to put multiple pasteboard items onto the pasteboard (`clipboard_util::AddDataToPasteboard`). It’s more work to drop the extra URLs than to just remove the call to `.firstObject` below.

    Joone Hur

    can we separate the multiple URL support for Mac into a follow-up change?

    Avi Drissman

    That sounds fine, as this leaves the Mac impl no worse off than today and this is getting to be a big CL. As a Mac person, happy to advise if you have questions when you follow up.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniel Cheng
    • David Trainor
    • Joone Hur
    • Min Qin
    Gerrit-Attention: David Trainor <dtra...@chromium.org>
    Gerrit-Attention: Min Qin <qin...@chromium.org>
    Gerrit-Attention: Joone Hur <joon...@microsoft.com>
    Gerrit-Comment-Date: Sat, 05 Jul 2025 19:02:16 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
    Comment-In-Reply-To: Avi Drissman <a...@chromium.org>
    Comment-In-Reply-To: Joone Hur <joon...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joone Hur (Gerrit)

    unread,
    Jul 19, 2025, 2:31:43 PMJul 19
    to Rakina Zata Amni, Avi Drissman, Min Qin, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
    Attention needed from Avi Drissman, Daniel Cheng, David Trainor and Min Qin

    Joone Hur voted and added 6 comments

    Votes added by Joone Hur

    Commit-Queue+1

    6 comments

    File chrome/browser/ui/bookmarks/bookmark_browsertest.cc
    Line 475, Patchset 37: EXPECT_EQ(page_url, url_infos->front().url);

    EXPECT_EQ(page_title, url_infos->front().title);
    #if !BUILDFLAG(IS_WIN)
    Avi Drissman . resolved

    Check for exactly one value in `url_infos` before checking the url/title?

    Joone Hur

    Done

    Line 555, Patchset 37:#if BUILDFLAG(IS_MAC)
    Avi Drissman . resolved

    This difference in behavior between Mac/non-Mac is due to the exact thing that you’re changing in this CL. For followup, would we need to change this section?

    Joone Hur

    Sure, the behavior of handling multiple URLs, similar to Mac, can now be applied to other platforms. For this, we won't need to run the has_single_url() in BookmarkNodeData::Write because other platforms can also support multiple URLs.

    https://source.chromium.org/chromium/chromium/src/+/main:components/bookmarks/browser/bookmark_node_data_views.cc;drc=764a8d3d41a562497b0c15dad765411fa02eeb9d;l=27

    File content/app_shim_remote_cocoa/web_drag_source_mac.mm
    Line 212, Patchset 37: DCHECK(!_dropData.url_infos.empty());

    NSURL* url = net::NSURLWithGURL(_dropData.url_infos.front().url);
    // If NSURL creation failed, check for a badly-escaped JavaScript URL.
    // Strip out any existing escapes and then re-escape uniformly.
    if (!url &&
    _dropData.url_infos.front().url.SchemeIs(url::kJavaScriptScheme)) {
    std::string unescapedUrlString = base::UnescapeBinaryURLComponent(
    _dropData.url_infos.front().url.spec());
    std::string escapedUrlString =
    base::EscapeUrlEncodedData(unescapedUrlString, false);
    url = [NSURL URLWithString:base::SysUTF8ToNSString(escapedUrlString)];
    }
    return url.absoluteString;
    }

    // URL title.
    if ([type isEqualToString:ui::kUTTypeUrlName]) {
    return base::SysUTF16ToNSString(_dropData.url_infos.front().title);
    }
    Avi Drissman . resolved

    Oh boy.

    The problem here is that this code assumes that the webpage is initiating a drag of a single object. We’d have to rethink how to do this if we have to initiate a drag of multiple objects.

    This is fine for now but can you file a bug for followup? This is going to be a longer-range refactor of the code.

    Joone Hur

    Sure, I will file a bug for this.

    File content/public/common/common_param_traits_macros.h
    Line 73, Patchset 37:IPC_STRUCT_TRAITS_BEGIN(ui::ClipboardUrlInfo)
    Avi Drissman . resolved

    Can you define a `ui::` structure here in content? Do we still even use these macros files with mojo?

    Joone Hur

    Chromium still uses the legacy IPC system to transmit DropData on MacOS, and ClipboardUrlInfo is part of that structure. Since other ui:: types like ui::FileInfo are already defined here for the same reason, it makes sense to include ClipboardUrlInfo as well.

    File ui/base/dragdrop/os_exchange_data.h
    Line 123, Patchset 37: std::optional<std::vector<ClipboardUrlInfo>> GetURLAndTitle(

    FilenameToURLPolicy policy) const;
    std::optional<std::vector<ui::ClipboardUrlInfo>> GetURLs(
    FilenameToURLPolicy policy) const;
    // Return information about the contained files, if any.
    Avi Drissman . unresolved

    The bifurcation was “get one url and its title” and “get many urls but no titles”. This is a chance to unify those two, and since we already have to change every caller, can we merge these together as `GetURLs()`? From this interface it seems these are redundant.

    Joone Hur

    Yes, GetURLs calls GetURLAndTitle so we could merge them into one. However, each platform has different implementation, so this change would be a bit large. Can I separate this for follow-up CL?

    Line 125, Patchset 37: std::optional<std::vector<ui::ClipboardUrlInfo>> GetURLs(
    Avi Drissman . resolved

    You’re in the `ui::` namespace so no need to qualify here.

    Joone Hur

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Avi Drissman
    • Daniel Cheng
    • David Trainor
    • Min Qin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
    Gerrit-Change-Number: 6608042
    Gerrit-PatchSet: 38
    Gerrit-Owner: Joone Hur <joon...@microsoft.com>
    Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
    Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
    Gerrit-Reviewer: Min Qin <qin...@chromium.org>
    Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Attention: Avi Drissman <a...@chromium.org>
    Gerrit-Attention: David Trainor <dtra...@chromium.org>
    Gerrit-Attention: Min Qin <qin...@chromium.org>
    Gerrit-Comment-Date: Sat, 19 Jul 2025 18:31:31 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Avi Drissman <a...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Avi Drissman (Gerrit)

    unread,
    Jul 19, 2025, 5:02:39 PMJul 19
    to Joone Hur, Avi Drissman, Rakina Zata Amni, Min Qin, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
    Attention needed from Daniel Cheng, David Trainor, Joone Hur and Min Qin

    Avi Drissman voted and added 1 comment

    Votes added by Avi Drissman

    Code-Review+1

    1 comment

    File ui/base/dragdrop/os_exchange_data.h
    Line 123, Patchset 37: std::optional<std::vector<ClipboardUrlInfo>> GetURLAndTitle(
    FilenameToURLPolicy policy) const;
    std::optional<std::vector<ui::ClipboardUrlInfo>> GetURLs(
    FilenameToURLPolicy policy) const;
    // Return information about the contained files, if any.
    Avi Drissman . unresolved

    The bifurcation was “get one url and its title” and “get many urls but no titles”. This is a chance to unify those two, and since we already have to change every caller, can we merge these together as `GetURLs()`? From this interface it seems these are redundant.

    Joone Hur

    Yes, GetURLs calls GetURLAndTitle so we could merge them into one. However, each platform has different implementation, so this change would be a bit large. Can I separate this for follow-up CL?

    Avi Drissman

    As long as this is a direct followup, yes.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniel Cheng
    • David Trainor
    • Joone Hur
    • Min Qin
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
      Gerrit-Change-Number: 6608042
      Gerrit-PatchSet: 39
      Gerrit-Owner: Joone Hur <joon...@microsoft.com>
      Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
      Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
      Gerrit-Reviewer: Min Qin <qin...@chromium.org>
      Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
      Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Attention: David Trainor <dtra...@chromium.org>
      Gerrit-Attention: Min Qin <qin...@chromium.org>
      Gerrit-Attention: Joone Hur <joon...@microsoft.com>
      Gerrit-Comment-Date: Sat, 19 Jul 2025 21:02:22 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Avi Drissman <a...@chromium.org>
      Comment-In-Reply-To: Joone Hur <joon...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Joone Hur (Gerrit)

      unread,
      Jul 20, 2025, 6:57:46 PMJul 20
      to Avi Drissman, Rakina Zata Amni, Min Qin, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
      Attention needed from Daniel Cheng, David Trainor and Min Qin

      Joone Hur added 4 comments

      Patchset-level comments
      File-level comment, Patchset 22:
      Daniel Cheng . resolved

      My biggest concern is about the platform-specific plumbing. I'm not sure many OSes actually support multiple URLs in their default URL type (see the comments about Windows and Mac). We may need to do something else to make it work well.

      My other comment is about the invariants we want to maintain. To make the APIs easier to use, I propose:

      • don't allow any invalid GURLs in the various URL lists. So when we're parsing out the URL lists, that means validating that they're actually valid URLs before appending them to the list.
      • an empty list means no URLs at all
      • the various SetURL()/SetURLs() functions should only be called if there is a non-empty list of URLs
      Joone Hur

      Done

      File-level comment, Patchset 40 (Latest):
      Joone Hur . resolved

      @dch...@chromium.org could you review the updated CL? I've updated the CL to ensure invalid URLs are not added to the URL lists. Additionally, the SetURL/SetURLs functions are now only called when there is a non-empty list of valid URLs to transfer.

      File ui/base/dragdrop/os_exchange_data.h
      Line 123, Patchset 37: std::optional<std::vector<ClipboardUrlInfo>> GetURLAndTitle(
      FilenameToURLPolicy policy) const;
      std::optional<std::vector<ui::ClipboardUrlInfo>> GetURLs(
      FilenameToURLPolicy policy) const;
      // Return information about the contained files, if any.
      Avi Drissman . resolved

      The bifurcation was “get one url and its title” and “get many urls but no titles”. This is a chance to unify those two, and since we already have to change every caller, can we merge these together as `GetURLs()`? From this interface it seems these are redundant.

      Joone Hur

      Yes, GetURLs calls GetURLAndTitle so we could merge them into one. However, each platform has different implementation, so this change would be a bit large. Can I separate this for follow-up CL?

      Avi Drissman

      As long as this is a direct followup, yes.

      Joone Hur

      Sure!

      File ui/base/dragdrop/os_exchange_data_provider_win.cc
      Line 382, Patchset 22: ClipboardFormatType::UrlType().ToFormatEtc(), storage));
      Daniel Cheng . unresolved

      I'm not sure that it's valid to pass a URL list here.

      https://learn.microsoft.com/en-us/windows/win32/shell/clipboard#cfstr_ineturl

      "This format gives the best clipboard representation of a single URL."

      Joone Hur

      For multiple URLs, we can provide them in CF_TEXT as a standard fallback. For a single URL, we need to continue providing it in CFSTR_INETURL for compatibility with other applications.

      Joone Hur

      For this CL, we're maintaining this text/uri-list approach for multi-URL writes as it works across browsers because it follows the Web standard(text/uri-list). We can create a follow-up bug to investigate non-browser application compatibility more thoroughly if desired.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      • David Trainor
      • Min Qin
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
      Gerrit-Change-Number: 6608042
      Gerrit-PatchSet: 40
      Gerrit-Owner: Joone Hur <joon...@microsoft.com>
      Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
      Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
      Gerrit-Reviewer: Min Qin <qin...@chromium.org>
      Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
      Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Attention: David Trainor <dtra...@chromium.org>
      Gerrit-Attention: Min Qin <qin...@chromium.org>
      Gerrit-Comment-Date: Sun, 20 Jul 2025 22:57:34 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Min Qin (Gerrit)

      unread,
      Jul 27, 2025, 12:52:36 AMJul 27
      to Joone Hur, Sylvain Defresne, Avi Drissman, Rakina Zata Amni, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
      Attention needed from Daniel Cheng, David Trainor, Joone Hur and Sylvain Defresne

      Min Qin voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      • David Trainor
      • Joone Hur
      • Sylvain Defresne
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
      Gerrit-Change-Number: 6608042
      Gerrit-PatchSet: 41
      Gerrit-Owner: Joone Hur <joon...@microsoft.com>
      Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
      Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
      Gerrit-Reviewer: Min Qin <qin...@chromium.org>
      Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
      Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
      Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
      Gerrit-Attention: David Trainor <dtra...@chromium.org>
      Gerrit-Attention: Joone Hur <joon...@microsoft.com>
      Gerrit-Comment-Date: Sun, 27 Jul 2025 04:52:24 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Sylvain Defresne (Gerrit)

      unread,
      Jul 28, 2025, 10:00:49 AMJul 28
      to Joone Hur, Min Qin, Avi Drissman, Rakina Zata Amni, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
      Attention needed from Daniel Cheng, David Trainor and Joone Hur

      Sylvain Defresne voted and added 1 comment

      Votes added by Sylvain Defresne

      Code-Review+1

      1 comment

      Patchset-level comments
      File-level comment, Patchset 41 (Latest):
      Sylvain Defresne . resolved

      lgtm for //components/bookmarks

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      • David Trainor
      • Joone Hur
      Gerrit-Attention: David Trainor <dtra...@chromium.org>
      Gerrit-Attention: Joone Hur <joon...@microsoft.com>
      Gerrit-Comment-Date: Mon, 28 Jul 2025 14:00:31 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Daniel Cheng (Gerrit)

      unread,
      Jul 28, 2025, 2:21:24 PMJul 28
      to Joone Hur, Sylvain Defresne, Min Qin, Avi Drissman, Rakina Zata Amni, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
      Attention needed from David Trainor and Joone Hur

      Daniel Cheng added 3 comments

      File ui/base/dragdrop/os_exchange_data_provider_mac.h
      Line 47, Patchset 41 (Latest): void SetURLs(const std::vector<ClipboardUrlInfo>& url_infos) override;
      Daniel Cheng . unresolved

      Change this to take a span; that way callers just passing a single url don't have to construct a vector.

      File ui/base/dragdrop/os_exchange_data_provider_mac.mm
      Line 191, Patchset 41 (Latest): // TODO(joone): we should support multiple URLs,
      Daniel Cheng . unresolved

      Instead of a username, use crbug.com/41011768 here.

      File ui/base/dragdrop/os_exchange_data_provider_win.cc
      Line 382, Patchset 22: ClipboardFormatType::UrlType().ToFormatEtc(), storage));
      Daniel Cheng . unresolved

      I'm not sure that it's valid to pass a URL list here.

      https://learn.microsoft.com/en-us/windows/win32/shell/clipboard#cfstr_ineturl

      "This format gives the best clipboard representation of a single URL."

      Joone Hur

      For multiple URLs, we can provide them in CF_TEXT as a standard fallback. For a single URL, we need to continue providing it in CFSTR_INETURL for compatibility with other applications.

      Joone Hur

      For this CL, we're maintaining this text/uri-list approach for multi-URL writes as it works across browsers because it follows the Web standard(text/uri-list). We can create a follow-up bug to investigate non-browser application compatibility more thoroughly if desired.

      Daniel Cheng

      I don't think I understand this comment. It might happen to work across browsers, but this concretely changes what we write to the clipboard.

      Before, we would write out something that was a bunch of URLs concatenated together... but canonicalized to be a valid URL.

      After this though, we can write something that another app, trying to interpret as a **single** URL (which is what the type claims to represent) that would now be invalid. It doesn't matter that Chrome itself is updated to handle this case correctly; we need to care about compatibility with non-Chrome apps too

      We either need to take the Mac approach (where we drop everything but the first URL for now), or we should figure out how to properly plumb it through. What we should not do is ignore the MSDN docs that `CFSTR_INETURL` represents a single URL and just write out multiple URLs here.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • David Trainor
      • Joone Hur
      Gerrit-Attention: David Trainor <dtra...@chromium.org>
      Gerrit-Attention: Joone Hur <joon...@microsoft.com>
      Gerrit-Comment-Date: Mon, 28 Jul 2025 18:21:10 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      Comment-In-Reply-To: Joone Hur <joon...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      David Trainor (Gerrit)

      unread,
      Jul 28, 2025, 5:42:40 PMJul 28
      to Joone Hur, Sylvain Defresne, Min Qin, Avi Drissman, Rakina Zata Amni, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
      Attention needed from Joone Hur

      David Trainor added 2 comments

      Patchset-level comments
      File-level comment, Patchset 37:
      David Trainor . resolved

      Joone just checking in -

      File chrome/browser/ui/views/frame/multi_contents_view_drop_target_controller.cc
      Line 35, Patchset 22: if (data.urls.empty() || !data.urls.front().is_valid() || is_in_split_view) {
      Daniel Cheng . resolved

      Should we really have invalid URLs here?

      I think we should avoid having invalid URLs in this list; instead, whether or not the list is empty should represent whether or not URLs are present.

      Joone Hur

      Done

      David Trainor

      Just checking - is the plan to move is_valid() checks to the call sites that build the ClipboardUrlInfo instances?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Joone Hur
      Gerrit-Attention: Joone Hur <joon...@microsoft.com>
      Gerrit-Comment-Date: Mon, 28 Jul 2025 21:42:28 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Joone Hur (Gerrit)

      unread,
      Jul 28, 2025, 6:01:25 PMJul 28
      to Sylvain Defresne, Min Qin, Avi Drissman, Rakina Zata Amni, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
      Attention needed from Daniel Cheng and David Trainor

      Joone Hur added 1 comment

      File chrome/browser/ui/views/frame/multi_contents_view_drop_target_controller.cc
      Line 35, Patchset 22: if (data.urls.empty() || !data.urls.front().is_valid() || is_in_split_view) {
      Daniel Cheng . resolved

      Should we really have invalid URLs here?

      I think we should avoid having invalid URLs in this list; instead, whether or not the list is empty should represent whether or not URLs are present.

      Joone Hur

      Done

      David Trainor

      Just checking - is the plan to move is_valid() checks to the call sites that build the ClipboardUrlInfo instances?

      Joone Hur

      Yes

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      • David Trainor
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Attention: David Trainor <dtra...@chromium.org>
      Gerrit-Comment-Date: Mon, 28 Jul 2025 22:01:07 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      Comment-In-Reply-To: David Trainor <dtra...@chromium.org>
      Comment-In-Reply-To: Joone Hur <joon...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Joone Hur (Gerrit)

      unread,
      Jul 28, 2025, 6:44:35 PMJul 28
      to Sylvain Defresne, Min Qin, Avi Drissman, Rakina Zata Amni, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
      Attention needed from Daniel Cheng and David Trainor

      Joone Hur added 3 comments

      File ui/base/dragdrop/os_exchange_data_provider_mac.h
      Line 47, Patchset 41 (Latest): void SetURLs(const std::vector<ClipboardUrlInfo>& url_infos) override;
      Daniel Cheng . resolved

      Change this to take a span; that way callers just passing a single url don't have to construct a vector.

      Joone Hur

      Will do.

      File ui/base/dragdrop/os_exchange_data_provider_mac.mm
      Line 191, Patchset 41 (Latest): // TODO(joone): we should support multiple URLs,
      Daniel Cheng . resolved

      Instead of a username, use crbug.com/41011768 here.

      Joone Hur

      Will do.

      File ui/base/dragdrop/os_exchange_data_provider_win.cc
      Line 382, Patchset 22: ClipboardFormatType::UrlType().ToFormatEtc(), storage));
      Daniel Cheng . unresolved

      I'm not sure that it's valid to pass a URL list here.

      https://learn.microsoft.com/en-us/windows/win32/shell/clipboard#cfstr_ineturl

      "This format gives the best clipboard representation of a single URL."

      Joone Hur

      For multiple URLs, we can provide them in CF_TEXT as a standard fallback. For a single URL, we need to continue providing it in CFSTR_INETURL for compatibility with other applications.

      Joone Hur

      For this CL, we're maintaining this text/uri-list approach for multi-URL writes as it works across browsers because it follows the Web standard(text/uri-list). We can create a follow-up bug to investigate non-browser application compatibility more thoroughly if desired.

      Daniel Cheng

      I don't think I understand this comment. It might happen to work across browsers, but this concretely changes what we write to the clipboard.

      Before, we would write out something that was a bunch of URLs concatenated together... but canonicalized to be a valid URL.

      After this though, we can write something that another app, trying to interpret as a **single** URL (which is what the type claims to represent) that would now be invalid. It doesn't matter that Chrome itself is updated to handle this case correctly; we need to care about compatibility with non-Chrome apps too

      We either need to take the Mac approach (where we drop everything but the first URL for now), or we should figure out how to properly plumb it through. What we should not do is ignore the MSDN docs that `CFSTR_INETURL` represents a single URL and just write out multiple URLs here.

      Joone Hur

      This CL addresses a bug by aligning Chromium’s handling of the text/uri-list drag type with Firefox, using the MIME type defined by the web standard. While the Windows CFSTR_INETURL clipboard format is traditionally intended for a single URL, it appears to tolerate multiple URLs without issue—it doesn’t seem to validate them strictly, and arbitrary strings are accepted

      That said, I understand the concern: writing multiple URLs under a format that some applications interpret as a single URL could lead to compatibility issues. However, the current behavior already causes problems—by concatenating multiple URLs into a single, invalid URL string.

      If this CL introduces issues with non-browser applications, Firefox would likely exhibit the same behavior, since it uses the same MIME type.

      I propose we land this CL to fix the existing bug and improve standards alignment. In parallel, we can file a follow-up issue to investigate how non-browser applications interpret multi-URL clipboard content.

      Gerrit-Comment-Date: Mon, 28 Jul 2025 22:44:22 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      Comment-In-Reply-To: Joone Hur <joon...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      David Trainor (Gerrit)

      unread,
      Jul 29, 2025, 11:55:32 AMJul 29
      to Joone Hur, Sylvain Defresne, Min Qin, Avi Drissman, Rakina Zata Amni, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
      Attention needed from Daniel Cheng and Joone Hur

      David Trainor added 1 comment

      File chrome/browser/ui/views/frame/multi_contents_view_drop_target_controller.cc
      Line 35, Patchset 22: if (data.urls.empty() || !data.urls.front().is_valid() || is_in_split_view) {
      Daniel Cheng . resolved

      Should we really have invalid URLs here?

      I think we should avoid having invalid URLs in this list; instead, whether or not the list is empty should represent whether or not URLs are present.

      Joone Hur

      Done

      David Trainor

      Just checking - is the plan to move is_valid() checks to the call sites that build the ClipboardUrlInfo instances?

      Joone Hur

      Yes

      David Trainor

      It looks like some of the behavior stayed as DCHECKS or the is_valid() checks weren't added in all the callsites? Sorry if I'm missing something - can you double check and validate all the ClipboardUrlInfo creation paths are omitting !is_valid() URLs? Will defer to Daniel if we're okay with a behavioral change here though.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      • Joone Hur
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
      Gerrit-Change-Number: 6608042
      Gerrit-PatchSet: 42
      Gerrit-Owner: Joone Hur <joon...@microsoft.com>
      Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
      Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
      Gerrit-Reviewer: Min Qin <qin...@chromium.org>
      Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
      Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
      Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Attention: Joone Hur <joon...@microsoft.com>
      Gerrit-Comment-Date: Tue, 29 Jul 2025 15:55:20 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Daniel Cheng (Gerrit)

      unread,
      Jul 29, 2025, 1:29:42 PMJul 29
      to Joone Hur, Sylvain Defresne, Min Qin, Avi Drissman, Rakina Zata Amni, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
      Attention needed from David Trainor and Joone Hur

      Daniel Cheng added 4 comments

      File chrome/browser/ui/views/frame/multi_contents_view_drop_target_controller.cc
      Line 35, Patchset 22: if (data.urls.empty() || !data.urls.front().is_valid() || is_in_split_view) {
      Daniel Cheng . resolved

      Should we really have invalid URLs here?

      I think we should avoid having invalid URLs in this list; instead, whether or not the list is empty should represent whether or not URLs are present.

      Joone Hur

      Done

      David Trainor

      Just checking - is the plan to move is_valid() checks to the call sites that build the ClipboardUrlInfo instances?

      Joone Hur

      Yes

      David Trainor

      It looks like some of the behavior stayed as DCHECKS or the is_valid() checks weren't added in all the callsites? Sorry if I'm missing something - can you double check and validate all the ClipboardUrlInfo creation paths are omitting !is_valid() URLs? Will defer to Daniel if we're okay with a behavioral change here though.

      Daniel Cheng

      yeah, ideally I think the bits in ui/base that parse URLs out of the data object/whatever should not be populating URLs that are invalid. Some platforms do this; some do not.

      But in general, the caller should be able to just `DCHECK()` and rely on the abstractions around the platform to handle this.

      File ui/base/dragdrop/os_exchange_data_provider_win.cc
      Line 382, Patchset 22: ClipboardFormatType::UrlType().ToFormatEtc(), storage));
      Daniel Cheng . unresolved

      I'm not sure that it's valid to pass a URL list here.

      https://learn.microsoft.com/en-us/windows/win32/shell/clipboard#cfstr_ineturl

      "This format gives the best clipboard representation of a single URL."

      Joone Hur

      For multiple URLs, we can provide them in CF_TEXT as a standard fallback. For a single URL, we need to continue providing it in CFSTR_INETURL for compatibility with other applications.

      Joone Hur

      For this CL, we're maintaining this text/uri-list approach for multi-URL writes as it works across browsers because it follows the Web standard(text/uri-list). We can create a follow-up bug to investigate non-browser application compatibility more thoroughly if desired.

      Daniel Cheng

      I don't think I understand this comment. It might happen to work across browsers, but this concretely changes what we write to the clipboard.

      Before, we would write out something that was a bunch of URLs concatenated together... but canonicalized to be a valid URL.

      After this though, we can write something that another app, trying to interpret as a **single** URL (which is what the type claims to represent) that would now be invalid. It doesn't matter that Chrome itself is updated to handle this case correctly; we need to care about compatibility with non-Chrome apps too

      We either need to take the Mac approach (where we drop everything but the first URL for now), or we should figure out how to properly plumb it through. What we should not do is ignore the MSDN docs that `CFSTR_INETURL` represents a single URL and just write out multiple URLs here.

      Joone Hur

      This CL addresses a bug by aligning Chromium’s handling of the text/uri-list drag type with Firefox, using the MIME type defined by the web standard. While the Windows CFSTR_INETURL clipboard format is traditionally intended for a single URL, it appears to tolerate multiple URLs without issue—it doesn’t seem to validate them strictly, and arbitrary strings are accepted

      That said, I understand the concern: writing multiple URLs under a format that some applications interpret as a single URL could lead to compatibility issues. However, the current behavior already causes problems—by concatenating multiple URLs into a single, invalid URL string.

      If this CL introduces issues with non-browser applications, Firefox would likely exhibit the same behavior, since it uses the same MIME type.

      I propose we land this CL to fix the existing bug and improve standards alignment. In parallel, we can file a follow-up issue to investigate how non-browser applications interpret multi-URL clipboard content.

      Daniel Cheng

      Just because Firefox does it doesn't make it correct. Drag and drop is a compatibility nightmare because people didn't read the docs and just write whatever they want into the X selection. We shouldn't match compatibility with Firefox and just assume nothing else will break.

      I'm assuming the Firefox snippet in question is https://searchfox.org/mozilla-central/source/widget/windows/nsClipboard.cpp#257, and it's really not clear to me that it's intentional anyway...

      I see two paths forward here.

      1. Microsoft updates the MSDN docs to specifically state multiple URLs are allowed and dictates a format. Presumably someone will need to do this compatibility testing.
      2. We don't break compatibility with other, pre-existing Windows apps and figure out another way to transport this data (probably using another clipboard format–potentially custom–that specifically supports multiple URLs)

      File ui/base/x/x11_os_exchange_data_provider.cc
      Line 299, Patchset 42 (Latest): if (!test_url.SchemeIsFile() ||
      Daniel Cheng . unresolved

      We should also probably skip adding here if the URL is invalid?

      Line 315, Patchset 42 (Latest): GURL url(tokens[0]);
      Daniel Cheng . unresolved

      Same here.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • David Trainor
      • Joone Hur
      Gerrit-Attention: David Trainor <dtra...@chromium.org>
      Gerrit-Attention: Joone Hur <joon...@microsoft.com>
      Gerrit-Comment-Date: Tue, 29 Jul 2025 17:29:30 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Joone Hur (Gerrit)

      unread,
      Jul 29, 2025, 8:35:31 PMJul 29
      to Sylvain Defresne, Min Qin, Avi Drissman, Rakina Zata Amni, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
      Attention needed from Daniel Cheng and David Trainor

      Joone Hur added 3 comments

      File ui/base/dragdrop/os_exchange_data_provider_win.cc
      Line 382, Patchset 22: ClipboardFormatType::UrlType().ToFormatEtc(), storage));
      Daniel Cheng . resolved

      I'm not sure that it's valid to pass a URL list here.

      https://learn.microsoft.com/en-us/windows/win32/shell/clipboard#cfstr_ineturl

      "This format gives the best clipboard representation of a single URL."

      Joone Hur

      For multiple URLs, we can provide them in CF_TEXT as a standard fallback. For a single URL, we need to continue providing it in CFSTR_INETURL for compatibility with other applications.

      Joone Hur

      For this CL, we're maintaining this text/uri-list approach for multi-URL writes as it works across browsers because it follows the Web standard(text/uri-list). We can create a follow-up bug to investigate non-browser application compatibility more thoroughly if desired.

      Daniel Cheng

      I don't think I understand this comment. It might happen to work across browsers, but this concretely changes what we write to the clipboard.

      Before, we would write out something that was a bunch of URLs concatenated together... but canonicalized to be a valid URL.

      After this though, we can write something that another app, trying to interpret as a **single** URL (which is what the type claims to represent) that would now be invalid. It doesn't matter that Chrome itself is updated to handle this case correctly; we need to care about compatibility with non-Chrome apps too

      We either need to take the Mac approach (where we drop everything but the first URL for now), or we should figure out how to properly plumb it through. What we should not do is ignore the MSDN docs that `CFSTR_INETURL` represents a single URL and just write out multiple URLs here.

      Joone Hur

      This CL addresses a bug by aligning Chromium’s handling of the text/uri-list drag type with Firefox, using the MIME type defined by the web standard. While the Windows CFSTR_INETURL clipboard format is traditionally intended for a single URL, it appears to tolerate multiple URLs without issue—it doesn’t seem to validate them strictly, and arbitrary strings are accepted

      That said, I understand the concern: writing multiple URLs under a format that some applications interpret as a single URL could lead to compatibility issues. However, the current behavior already causes problems—by concatenating multiple URLs into a single, invalid URL string.

      If this CL introduces issues with non-browser applications, Firefox would likely exhibit the same behavior, since it uses the same MIME type.

      I propose we land this CL to fix the existing bug and improve standards alignment. In parallel, we can file a follow-up issue to investigate how non-browser applications interpret multi-URL clipboard content.

      Daniel Cheng

      Just because Firefox does it doesn't make it correct. Drag and drop is a compatibility nightmare because people didn't read the docs and just write whatever they want into the X selection. We shouldn't match compatibility with Firefox and just assume nothing else will break.

      I'm assuming the Firefox snippet in question is https://searchfox.org/mozilla-central/source/widget/windows/nsClipboard.cpp#257, and it's really not clear to me that it's intentional anyway...

      I see two paths forward here.

      1. Microsoft updates the MSDN docs to specifically state multiple URLs are allowed and dictates a format. Presumably someone will need to do this compatibility testing.
      2. We don't break compatibility with other, pre-existing Windows apps and figure out another way to transport this data (probably using another clipboard format–potentially custom–that specifically supports multiple URLs)

      Joone Hur

      I will investigate whether creating a custom clipboard format with the text/uri-list format enables proper support for multiple URLs.

      File ui/base/x/x11_os_exchange_data_provider.cc
      Line 299, Patchset 42: if (!test_url.SchemeIsFile() ||
      Daniel Cheng . resolved

      We should also probably skip adding here if the URL is invalid?

      Joone Hur

      Done

      Line 315, Patchset 42: GURL url(tokens[0]);
      Daniel Cheng . resolved

      Same here.

      Joone Hur

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      • David Trainor
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
      Gerrit-Change-Number: 6608042
      Gerrit-PatchSet: 46
      Gerrit-Owner: Joone Hur <joon...@microsoft.com>
      Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
      Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
      Gerrit-Reviewer: Min Qin <qin...@chromium.org>
      Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
      Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
      Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Attention: David Trainor <dtra...@chromium.org>
      Gerrit-Comment-Date: Wed, 30 Jul 2025 00:35:19 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      Comment-In-Reply-To: Joone Hur <joon...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      David Trainor (Gerrit)

      unread,
      Jul 30, 2025, 12:29:15 PMJul 30
      to Joone Hur, Sylvain Defresne, Min Qin, Avi Drissman, Rakina Zata Amni, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
      Attention needed from Daniel Cheng and Joone Hur

      David Trainor added 4 comments

      Patchset-level comments
      File-level comment, Patchset 46 (Latest):
      David Trainor . resolved

      general lgtm on chrome/browser integration pieces - only question is around the std::optional has_value() and the assumption on empty() on the underlying vector if it's present.

      File chrome/browser/ui/views/frame/multi_contents_drop_target_view.cc
      Line 223, Patchset 46 (Latest): CHECK(!url_infos->empty());
      David Trainor . unresolved

      Worth still checking has_value() as well?

      File chrome/browser/ui/views/omnibox/omnibox_view_views.cc
      Line 2145, Patchset 46 (Latest): url_infos.has_value()) {
      David Trainor . unresolved

      Do you have to check that the vector is not empty? If that's never supposed to happen if the optional has a value, can we CHECK inside of the if statement?

      File chrome/browser/ui/views/toolbar/home_button.cc
      Line 186, Patchset 46 (Latest): if (url_info.has_value() && prefs_) {
      David Trainor . unresolved

      Do you have to check that the vector is not empty here as well?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      • Joone Hur
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
        Gerrit-Change-Number: 6608042
        Gerrit-PatchSet: 46
        Gerrit-Owner: Joone Hur <joon...@microsoft.com>
        Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
        Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
        Gerrit-Reviewer: Min Qin <qin...@chromium.org>
        Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
        Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
        Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
        Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
        Gerrit-Attention: Joone Hur <joon...@microsoft.com>
        Gerrit-Comment-Date: Wed, 30 Jul 2025 16:29:03 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Joone Hur (Gerrit)

        unread,
        Jul 30, 2025, 10:28:19 PMJul 30
        to Sylvain Defresne, Min Qin, Avi Drissman, Rakina Zata Amni, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
        Attention needed from Avi Drissman, Daniel Cheng, David Trainor, Min Qin and Sylvain Defresne

        Joone Hur added 3 comments

        File chrome/browser/ui/views/frame/multi_contents_drop_target_view.cc
        Line 223, Patchset 46: CHECK(!url_infos->empty());
        David Trainor . resolved

        Worth still checking has_value() as well?

        Joone Hur

        Yes, a condition will be added to explicitly check url_infos.has_value() to ensure the presence of URLs before further processing.

        File chrome/browser/ui/views/omnibox/omnibox_view_views.cc
        Line 2145, Patchset 46: url_infos.has_value()) {
        David Trainor . resolved

        Do you have to check that the vector is not empty? If that's never supposed to happen if the optional has a value, can we CHECK inside of the if statement?

        Joone Hur

        Done

        File chrome/browser/ui/views/toolbar/home_button.cc
        Line 186, Patchset 46: if (url_info.has_value() && prefs_) {
        David Trainor . resolved

        Do you have to check that the vector is not empty here as well?

        Joone Hur

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Avi Drissman
        • Daniel Cheng
        • David Trainor
        • Min Qin
        • Sylvain Defresne
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
          Gerrit-Change-Number: 6608042
          Gerrit-PatchSet: 47
          Gerrit-Owner: Joone Hur <joon...@microsoft.com>
          Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
          Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
          Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
          Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
          Gerrit-Reviewer: Min Qin <qin...@chromium.org>
          Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
          Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
          Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
          Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
          Gerrit-Attention: Avi Drissman <a...@chromium.org>
          Gerrit-Attention: David Trainor <dtra...@chromium.org>
          Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
          Gerrit-Attention: Min Qin <qin...@chromium.org>
          Gerrit-Comment-Date: Thu, 31 Jul 2025 02:28:06 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: David Trainor <dtra...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Joone Hur (Gerrit)

          unread,
          Jul 30, 2025, 10:35:30 PMJul 30
          to Sylvain Defresne, Min Qin, Avi Drissman, Rakina Zata Amni, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
          Attention needed from Avi Drissman, Daniel Cheng, David Trainor, Min Qin and Sylvain Defresne

          Joone Hur added 1 comment

          File ui/base/dragdrop/os_exchange_data_provider_win.cc
          Joone Hur

          @dch...@chromium.org ClipboardFormatType::MultiUrlType() has been added for the text/uri-list format. GetUrl() (in clipboard_util_win.cc) and OSExchangeDataProviderWin::SetURLs (in os_exchange_data_provider_win.cc) now use this custom clipboard format to hanlde multiple URLs properly.

          Gerrit-Comment-Date: Thu, 31 Jul 2025 02:35:19 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Sylvain Defresne (Gerrit)

          unread,
          Jul 31, 2025, 8:53:56 AMJul 31
          to Joone Hur, Min Qin, Avi Drissman, Rakina Zata Amni, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
          Attention needed from Avi Drissman, Daniel Cheng, David Trainor, Joone Hur and Min Qin

          Sylvain Defresne voted and added 1 comment

          Votes added by Sylvain Defresne

          Code-Review+1

          1 comment

          Patchset-level comments
          File-level comment, Patchset 47 (Latest):
          Sylvain Defresne . resolved

          still lgtm

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Avi Drissman
          • Daniel Cheng
          • David Trainor
          • Joone Hur
          • Min Qin
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
            Gerrit-Change-Number: 6608042
            Gerrit-PatchSet: 47
            Gerrit-Owner: Joone Hur <joon...@microsoft.com>
            Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
            Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
            Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
            Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
            Gerrit-Reviewer: Min Qin <qin...@chromium.org>
            Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
            Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
            Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
            Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
            Gerrit-Attention: Avi Drissman <a...@chromium.org>
            Gerrit-Attention: David Trainor <dtra...@chromium.org>
            Gerrit-Attention: Min Qin <qin...@chromium.org>
            Gerrit-Attention: Joone Hur <joon...@microsoft.com>
            Gerrit-Comment-Date: Thu, 31 Jul 2025 12:53:42 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Avi Drissman (Gerrit)

            unread,
            Jul 31, 2025, 11:18:12 AMJul 31
            to Joone Hur, Avi Drissman, Sylvain Defresne, Min Qin, Rakina Zata Amni, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
            Attention needed from Daniel Cheng, David Trainor, Joone Hur and Min Qin

            Avi Drissman voted Code-Review+1

            Code-Review+1
            Open in Gerrit

            Related details

            Attention is currently required from:
            Gerrit-Attention: David Trainor <dtra...@chromium.org>
            Gerrit-Attention: Min Qin <qin...@chromium.org>
            Gerrit-Attention: Joone Hur <joon...@microsoft.com>
            Gerrit-Comment-Date: Thu, 31 Jul 2025 15:18:06 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Daniel Cheng (Gerrit)

            unread,
            Jul 31, 2025, 4:01:26 PMJul 31
            to Joone Hur, Avi Drissman, Sylvain Defresne, Min Qin, Rakina Zata Amni, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
            Attention needed from David Trainor, Joone Hur and Min Qin

            Daniel Cheng added 2 comments

            File ui/base/clipboard/clipboard_util_win.cc
            Line 94, Patchset 47 (Latest):// Parses a multi-line string from the clipboard to extract URLs and
            Daniel Cheng . unresolved

            I think it would be better if we didn't change our interpretation of existing types, unless it's shown to improve compatiblity or fix other bugs.

            This also changes the behavior; before, if we only had a URL, we'd set the string as both the URL and the title. After this, we no longer do that.

            In addition, if we add a new function for parsing text/uri-list, maybe it should match the behavior of reusing the URL's spec as the title if there is no explict title? (I'll note the RFC for that MIME type also specifically states that comment lines are allowed, though it seems OK to punt on that specific part of it for now: https://www.rfc-editor.org/rfc/rfc2483.html#section-5)

            Line 551, Patchset 47 (Latest): return true;
            Daniel Cheng . unresolved

            We should check that the list is non-empty here right? Is there a reason we shouldn't?

            Open in Gerrit

            Related details

            Attention is currently required from:
            • David Trainor
            • Joone Hur
            • Min Qin
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
              Gerrit-Change-Number: 6608042
              Gerrit-PatchSet: 47
              Gerrit-Owner: Joone Hur <joon...@microsoft.com>
              Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
              Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
              Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
              Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
              Gerrit-Reviewer: Min Qin <qin...@chromium.org>
              Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
              Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
              Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
              Gerrit-Attention: David Trainor <dtra...@chromium.org>
              Gerrit-Attention: Min Qin <qin...@chromium.org>
              Gerrit-Attention: Joone Hur <joon...@microsoft.com>
              Gerrit-Comment-Date: Thu, 31 Jul 2025 20:01:13 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              David Trainor (Gerrit)

              unread,
              Aug 1, 2025, 3:53:08 PMAug 1
              to Joone Hur, Avi Drissman, Sylvain Defresne, Min Qin, Rakina Zata Amni, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
              Attention needed from Joone Hur and Min Qin

              David Trainor added 2 comments

              File chrome/browser/ui/views/frame/multi_contents_drop_target_view.cc
              Line 223, Patchset 46: CHECK(!url_infos->empty());
              David Trainor . resolved

              Worth still checking has_value() as well?

              Joone Hur

              Yes, a condition will be added to explicitly check url_infos.has_value() to ensure the presence of URLs before further processing.

              David Trainor

              The previous path looked like it worked via:

              • std::optional has_value - CHECK
              • Empty unchecked.

              The current path looks like it works via:

              • std::optional has_value - return early
              • Empty - CHECK

              Is this behavioral change intentional?

              File chrome/browser/ui/views/toolbar/home_button.cc
              Line 187, Patchset 51 (Latest): CHECK(!url_infos->empty());
              David Trainor . unresolved

              This looks like a behavioral change as well - if we're pruning out invalid URLs before we get to this point, is the empty check something we should CHECK() on or just if-check? We if-checked' the is_valid() previously, which would be reflected as an empty list post change right?

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Joone Hur
              • Min Qin
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
              Gerrit-Change-Number: 6608042
              Gerrit-PatchSet: 51
              Gerrit-Owner: Joone Hur <joon...@microsoft.com>
              Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
              Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
              Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
              Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
              Gerrit-Reviewer: Min Qin <qin...@chromium.org>
              Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
              Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
              Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
              Gerrit-Attention: Min Qin <qin...@chromium.org>
              Gerrit-Attention: Joone Hur <joon...@microsoft.com>
              Gerrit-Comment-Date: Fri, 01 Aug 2025 19:52:54 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Joone Hur (Gerrit)

              unread,
              Aug 1, 2025, 5:38:03 PMAug 1
              to Avi Drissman, Sylvain Defresne, Min Qin, Rakina Zata Amni, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
              Attention needed from Daniel Cheng and Min Qin

              Joone Hur added 1 comment

              File ui/base/clipboard/clipboard_util_win.cc
              Line 94, Patchset 47:// Parses a multi-line string from the clipboard to extract URLs and
              Daniel Cheng . resolved

              I think it would be better if we didn't change our interpretation of existing types, unless it's shown to improve compatiblity or fix other bugs.

              This also changes the behavior; before, if we only had a URL, we'd set the string as both the URL and the title. After this, we no longer do that.

              In addition, if we add a new function for parsing text/uri-list, maybe it should match the behavior of reusing the URL's spec as the title if there is no explict title? (I'll note the RFC for that MIME type also specifically states that comment lines are allowed, though it seems OK to punt on that specific part of it for now: https://www.rfc-editor.org/rfc/rfc2483.html#section-5)

              Joone Hur

              I tried to update SplitUrlAndTitle to use the URL itself as the title when no explicit title was provided. However, this led to many test failures because the Linux port expects an empty title in this scenario. It appears `title->assign(str)` is never called even if the str doesn't include a title because the string received by SplitUrlAndTitle (from the clipboard storage) has a \n at its end in this case. This is due to how URLs are stored in the clipboard: even if the title is empty, a newline is always appended after the URL. See SetURL code:


              ```cpp
              void OSExchangeDataProviderWin::SetURL(const GURL& url,
              std::u16string_view title) {
              // Add text/x-moz-url for drags from Firefox
              STGMEDIUM storage = CreateStorageForString(
              base::StrCat({base::UTF8ToUTF16(url.spec()), u"\n", title}));
              data_->contents_.push_back(DataObjectImpl::StoredDataInfo::TakeStorageMedium(
              ClipboardFormatType::MozUrlType().ToFormatEtc(), storage));

              ```

              Therefore, this CL doesn't change the existing single-URL behavior while also correctly parsing multiple URLs.

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Daniel Cheng
              • Min Qin
              Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
              Gerrit-Attention: Min Qin <qin...@chromium.org>
              Gerrit-Comment-Date: Fri, 01 Aug 2025 21:37:53 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Joone Hur (Gerrit)

              unread,
              Aug 1, 2025, 6:28:05 PMAug 1
              to Avi Drissman, Sylvain Defresne, Min Qin, Rakina Zata Amni, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
              Attention needed from Daniel Cheng, David Trainor and Min Qin

              Joone Hur added 2 comments

              File chrome/browser/ui/views/frame/multi_contents_drop_target_view.cc
              Line 223, Patchset 46: CHECK(!url_infos->empty());
              David Trainor . resolved

              Worth still checking has_value() as well?

              Joone Hur

              Yes, a condition will be added to explicitly check url_infos.has_value() to ensure the presence of URLs before further processing.

              David Trainor

              The previous path looked like it worked via:

              • std::optional has_value - CHECK
              • Empty unchecked.

              The current path looks like it works via:

              • std::optional has_value - return early
              • Empty - CHECK

              Is this behavioral change intentional?

              Joone Hur

              Yes, this behavioral change is intentional.

              File ui/base/clipboard/clipboard_util_win.cc
              Line 551, Patchset 47: return true;
              Daniel Cheng . resolved

              We should check that the list is non-empty here right? Is there a reason we shouldn't?

              Joone Hur

              Yes, we should check that the list is non-empty.

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Daniel Cheng
              • David Trainor
              • Min Qin
              Gerrit-Attention: David Trainor <dtra...@chromium.org>
              Gerrit-Attention: Min Qin <qin...@chromium.org>
              Gerrit-Comment-Date: Fri, 01 Aug 2025 22:27:51 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Joone Hur (Gerrit)

              unread,
              Aug 1, 2025, 6:41:09 PMAug 1
              to Avi Drissman, Sylvain Defresne, Min Qin, Rakina Zata Amni, David Trainor, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
              Attention needed from Daniel Cheng, David Trainor and Min Qin

              Joone Hur added 1 comment

              File chrome/browser/ui/views/toolbar/home_button.cc
              Line 187, Patchset 51 (Latest): CHECK(!url_infos->empty());
              David Trainor . resolved

              This looks like a behavioral change as well - if we're pruning out invalid URLs before we get to this point, is the empty check something we should CHECK() on or just if-check? We if-checked' the is_valid() previously, which would be reflected as an empty list post change right?

              Joone Hur

              You're right. I will add the empty check in the if condition. Thanks!

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Daniel Cheng
              • David Trainor
              • Min Qin
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement satisfiedCode-Review
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
              Gerrit-Change-Number: 6608042
              Gerrit-PatchSet: 51
              Gerrit-Owner: Joone Hur <joon...@microsoft.com>
              Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
              Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
              Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
              Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
              Gerrit-Reviewer: Min Qin <qin...@chromium.org>
              Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
              Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
              Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
              Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
              Gerrit-Attention: David Trainor <dtra...@chromium.org>
              Gerrit-Attention: Min Qin <qin...@chromium.org>
              Gerrit-Comment-Date: Fri, 01 Aug 2025 22:40:59 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: David Trainor <dtra...@chromium.org>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              David Trainor (Gerrit)

              unread,
              Aug 4, 2025, 10:28:27 PMAug 4
              to Joone Hur, Avi Drissman, Sylvain Defresne, Min Qin, Rakina Zata Amni, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
              Attention needed from Daniel Cheng, Joone Hur and Min Qin

              David Trainor voted and added 1 comment

              Votes added by David Trainor

              Code-Review+1

              1 comment

              Patchset-level comments
              File-level comment, Patchset 52 (Latest):
              David Trainor . resolved

              lgtm % remaining reviewers. Thanks!

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Daniel Cheng
              • Joone Hur
              • Min Qin
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement satisfiedCode-Review
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
              Gerrit-Change-Number: 6608042
              Gerrit-PatchSet: 52
              Gerrit-Owner: Joone Hur <joon...@microsoft.com>
              Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
              Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
              Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
              Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
              Gerrit-Reviewer: Min Qin <qin...@chromium.org>
              Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
              Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
              Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
              Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
              Gerrit-Attention: Min Qin <qin...@chromium.org>
              Gerrit-Attention: Joone Hur <joon...@microsoft.com>
              Gerrit-Comment-Date: Tue, 05 Aug 2025 02:28:16 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Daniel Cheng (Gerrit)

              unread,
              Aug 6, 2025, 3:19:57 PMAug 6
              to Joone Hur, David Trainor, Avi Drissman, Sylvain Defresne, Min Qin, Rakina Zata Amni, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
              Attention needed from Joone Hur and Min Qin

              Daniel Cheng added 1 comment

              File ui/base/clipboard/clipboard_util_win.cc
              Line 94, Patchset 47:// Parses a multi-line string from the clipboard to extract URLs and
              Daniel Cheng . unresolved

              I think it would be better if we didn't change our interpretation of existing types, unless it's shown to improve compatiblity or fix other bugs.

              This also changes the behavior; before, if we only had a URL, we'd set the string as both the URL and the title. After this, we no longer do that.

              In addition, if we add a new function for parsing text/uri-list, maybe it should match the behavior of reusing the URL's spec as the title if there is no explict title? (I'll note the RFC for that MIME type also specifically states that comment lines are allowed, though it seems OK to punt on that specific part of it for now: https://www.rfc-editor.org/rfc/rfc2483.html#section-5)

              Joone Hur

              I tried to update SplitUrlAndTitle to use the URL itself as the title when no explicit title was provided. However, this led to many test failures because the Linux port expects an empty title in this scenario. It appears `title->assign(str)` is never called even if the str doesn't include a title because the string received by SplitUrlAndTitle (from the clipboard storage) has a \n at its end in this case. This is due to how URLs are stored in the clipboard: even if the title is empty, a newline is always appended after the URL. See SetURL code:


              ```cpp
              void OSExchangeDataProviderWin::SetURL(const GURL& url,
              std::u16string_view title) {
              // Add text/x-moz-url for drags from Firefox
              STGMEDIUM storage = CreateStorageForString(
              base::StrCat({base::UTF8ToUTF16(url.spec()), u"\n", title}));
              data_->contents_.push_back(DataObjectImpl::StoredDataInfo::TakeStorageMedium(
              ClipboardFormatType::MozUrlType().ToFormatEtc(), storage));

              ```

              Therefore, this CL doesn't change the existing single-URL behavior while also correctly parsing multiple URLs.

              Daniel Cheng

              I should have been clearer. I think text/uri-list should have its own parsing function. It's not clear at all that text/x-moz-url or any of the other current formats are intended to handle multiple URLs at all, so the existing parsing helper shouldn't need to handle the multiple URL case at all.

              There are clearly some problems/edge cases that aren't handled well for the previous code; it'd be nice to fix them, but the text-uri/list parsing is straightforward and should not inherit its problems.

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Joone Hur
              • Min Qin
              Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Owners
                • requirement satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
                Gerrit-Change-Number: 6608042
                Gerrit-PatchSet: 52
                Gerrit-Owner: Joone Hur <joon...@microsoft.com>
                Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
                Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
                Gerrit-Reviewer: Min Qin <qin...@chromium.org>
                Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
                Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
                Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
                Gerrit-Attention: Min Qin <qin...@chromium.org>
                Gerrit-Attention: Joone Hur <joon...@microsoft.com>
                Gerrit-Comment-Date: Wed, 06 Aug 2025 19:19:43 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Daniel Cheng (Gerrit)

                unread,
                Aug 6, 2025, 5:44:39 PMAug 6
                to Joone Hur, David Trainor, Avi Drissman, Sylvain Defresne, Min Qin, Rakina Zata Amni, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
                Attention needed from Joone Hur and Min Qin

                Daniel Cheng added 5 comments

                Patchset-level comments
                Daniel Cheng . unresolved

                I think the compatibility and interop implications of this CL are quite tricky. Even if we make the plumbing work just within Chrome, the different formats support different subsets of capabilities (text/x-moz-url supports URL + title, text/uri-list supports multiple URLs), and it's not clear how to combine those capabilities in a coherent way that works well for all use cases.

                At this point, I think what's needed is to figure out these problems outside this code review, and then update this once we have a design we're happy with. Iterating on this in a code review feels like it's going to be slow and frustrating for everyone involved.

                File ui/base/clipboard/clipboard_util_win.cc
                Line 94, Patchset 47:// Parses a multi-line string from the clipboard to extract URLs and
                Daniel Cheng . unresolved

                I think it would be better if we didn't change our interpretation of existing types, unless it's shown to improve compatiblity or fix other bugs.

                This also changes the behavior; before, if we only had a URL, we'd set the string as both the URL and the title. After this, we no longer do that.

                In addition, if we add a new function for parsing text/uri-list, maybe it should match the behavior of reusing the URL's spec as the title if there is no explict title? (I'll note the RFC for that MIME type also specifically states that comment lines are allowed, though it seems OK to punt on that specific part of it for now: https://www.rfc-editor.org/rfc/rfc2483.html#section-5)

                Joone Hur

                I tried to update SplitUrlAndTitle to use the URL itself as the title when no explicit title was provided. However, this led to many test failures because the Linux port expects an empty title in this scenario. It appears `title->assign(str)` is never called even if the str doesn't include a title because the string received by SplitUrlAndTitle (from the clipboard storage) has a \n at its end in this case. This is due to how URLs are stored in the clipboard: even if the title is empty, a newline is always appended after the URL. See SetURL code:


                ```cpp
                void OSExchangeDataProviderWin::SetURL(const GURL& url,
                std::u16string_view title) {
                // Add text/x-moz-url for drags from Firefox
                STGMEDIUM storage = CreateStorageForString(
                base::StrCat({base::UTF8ToUTF16(url.spec()), u"\n", title}));
                data_->contents_.push_back(DataObjectImpl::StoredDataInfo::TakeStorageMedium(
                ClipboardFormatType::MozUrlType().ToFormatEtc(), storage));

                ```

                Therefore, this CL doesn't change the existing single-URL behavior while also correctly parsing multiple URLs.

                Daniel Cheng

                I should have been clearer. I think text/uri-list should have its own parsing function. It's not clear at all that text/x-moz-url or any of the other current formats are intended to handle multiple URLs at all, so the existing parsing helper shouldn't need to handle the multiple URL case at all.

                There are clearly some problems/edge cases that aren't handled well for the previous code; it'd be nice to fix them, but the text-uri/list parsing is straightforward and should not inherit its problems.

                Daniel Cheng

                Sorry but one more thing I thought of. Even if we separate the parsing functions, we may still affect what we parse out of the clipboard.

                This might matter for things like the bookmark manager, where carrying around a title to associate with the bookmark matters.

                Line 543, Patchset 52 (Latest): if (GetData(data_object, ClipboardFormatType::MozUrlType(), &store) ||
                Daniel Cheng . unresolved

                text/x-moz-url doesn't actually appear to support multiple URLs (from what I could tell from reading FF source code)

                Line 544, Patchset 52 (Latest): GetData(data_object, ClipboardFormatType::MultiUrlType(), &store)) {
                Daniel Cheng . unresolved

                But in that case, we have a fundamental tradeoff when reading from the clipboard because:

                • text/x-moz-url supports titles
                • but text/uri-list does not

                We could try to figure out how to integrate data by reading both... but that seems messy too.

                File ui/base/dragdrop/os_exchange_data_provider_win.cc
                Line 359, Patchset 52 (Latest): {base::UTF8ToUTF16(url_list), u"\n", url_infos.front().title}));
                Daniel Cheng . unresolved

                i.e. I'm not sure it's actually OK to write out a list of URLs here.

                Gerrit-Comment-Date: Wed, 06 Aug 2025 21:44:26 +0000
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Joone Hur (Gerrit)

                unread,
                Aug 7, 2025, 3:10:56 AMAug 7
                to David Trainor, Avi Drissman, Sylvain Defresne, Min Qin, Rakina Zata Amni, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
                Attention needed from Daniel Cheng and Min Qin

                Joone Hur added 6 comments

                Patchset-level comments
                Daniel Cheng . resolved

                I think the compatibility and interop implications of this CL are quite tricky. Even if we make the plumbing work just within Chrome, the different formats support different subsets of capabilities (text/x-moz-url supports URL + title, text/uri-list supports multiple URLs), and it's not clear how to combine those capabilities in a coherent way that works well for all use cases.

                At this point, I think what's needed is to figure out these problems outside this code review, and then update this once we have a design we're happy with. Iterating on this in a code review feels like it's going to be slow and frustrating for everyone involved.

                Joone Hur

                That makes sense. I agree that the compatibility and interop issues are tricky, and trying to solve them in a code review isn't the best approach. I'll open a design doc to figure out the current issues and solutions.

                Joone Hur . resolved

                Thanks for your feedback!

                File ui/base/clipboard/clipboard_util_win.cc
                Line 94, Patchset 47:// Parses a multi-line string from the clipboard to extract URLs and
                Daniel Cheng . resolved

                I think it would be better if we didn't change our interpretation of existing types, unless it's shown to improve compatiblity or fix other bugs.

                This also changes the behavior; before, if we only had a URL, we'd set the string as both the URL and the title. After this, we no longer do that.

                In addition, if we add a new function for parsing text/uri-list, maybe it should match the behavior of reusing the URL's spec as the title if there is no explict title? (I'll note the RFC for that MIME type also specifically states that comment lines are allowed, though it seems OK to punt on that specific part of it for now: https://www.rfc-editor.org/rfc/rfc2483.html#section-5)

                Joone Hur

                I tried to update SplitUrlAndTitle to use the URL itself as the title when no explicit title was provided. However, this led to many test failures because the Linux port expects an empty title in this scenario. It appears `title->assign(str)` is never called even if the str doesn't include a title because the string received by SplitUrlAndTitle (from the clipboard storage) has a \n at its end in this case. This is due to how URLs are stored in the clipboard: even if the title is empty, a newline is always appended after the URL. See SetURL code:


                ```cpp
                void OSExchangeDataProviderWin::SetURL(const GURL& url,
                std::u16string_view title) {
                // Add text/x-moz-url for drags from Firefox
                STGMEDIUM storage = CreateStorageForString(
                base::StrCat({base::UTF8ToUTF16(url.spec()), u"\n", title}));
                data_->contents_.push_back(DataObjectImpl::StoredDataInfo::TakeStorageMedium(
                ClipboardFormatType::MozUrlType().ToFormatEtc(), storage));

                ```

                Therefore, this CL doesn't change the existing single-URL behavior while also correctly parsing multiple URLs.

                Daniel Cheng

                I should have been clearer. I think text/uri-list should have its own parsing function. It's not clear at all that text/x-moz-url or any of the other current formats are intended to handle multiple URLs at all, so the existing parsing helper shouldn't need to handle the multiple URL case at all.

                There are clearly some problems/edge cases that aren't handled well for the previous code; it'd be nice to fix them, but the text-uri/list parsing is straightforward and should not inherit its problems.

                Daniel Cheng

                Sorry but one more thing I thought of. Even if we separate the parsing functions, we may still affect what we parse out of the clipboard.

                This might matter for things like the bookmark manager, where carrying around a title to associate with the bookmark matters.

                Joone Hur

                I see. First, I will create a new function specifically for text/uri-list that handles multiple URLs. I will also ensure that the existing parsing logic for single URLs is not changed and continues to correctly extract both the URL and its associated title, preserving the current behavior for features like the bookmark manager. This approach will prevent any unintended side effects from my new code.

                Line 543, Patchset 52 (Latest): if (GetData(data_object, ClipboardFormatType::MozUrlType(), &store) ||
                Daniel Cheng . resolved

                text/x-moz-url doesn't actually appear to support multiple URLs (from what I could tell from reading FF source code)

                Joone Hur

                Got it. I'll make sure the CL handles text/x-moz-url with only a single URL, consistent with what you found in the FF code

                Line 544, Patchset 52 (Latest): GetData(data_object, ClipboardFormatType::MultiUrlType(), &store)) {
                Daniel Cheng . resolved

                But in that case, we have a fundamental tradeoff when reading from the clipboard because:

                • text/x-moz-url supports titles
                • but text/uri-list does not

                We could try to figure out how to integrate data by reading both... but that seems messy too.

                Joone Hur

                That's exactly why we need to separate the parsing functions. text/x-moz-url can be parsed for a title and URL, while a new function can handle text/uri-list's multiple URLs. The application can choose which data is more useful after reading them.

                File ui/base/dragdrop/os_exchange_data_provider_win.cc
                Line 359, Patchset 52 (Latest): {base::UTF8ToUTF16(url_list), u"\n", url_infos.front().title}));
                Daniel Cheng . resolved

                i.e. I'm not sure it's actually OK to write out a list of URLs here.

                Joone Hur

                I'll undo this change and ensure that text/x-moz-url only handles a single URL.

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Daniel Cheng
                • Min Qin
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Owners
                • requirement satisfiedCode-Review
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
                Gerrit-Change-Number: 6608042
                Gerrit-PatchSet: 52
                Gerrit-Owner: Joone Hur <joon...@microsoft.com>
                Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
                Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
                Gerrit-Reviewer: Min Qin <qin...@chromium.org>
                Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
                Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
                Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
                Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                Gerrit-Attention: Min Qin <qin...@chromium.org>
                Gerrit-Comment-Date: Thu, 07 Aug 2025 07:10:38 +0000
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Joone Hur (Gerrit)

                unread,
                Aug 8, 2025, 3:12:26 AMAug 8
                to David Trainor, Avi Drissman, Sylvain Defresne, Min Qin, Rakina Zata Amni, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
                Attention needed from Daniel Cheng and Min Qin

                Joone Hur added 1 comment

                Patchset-level comments
                File-level comment, Patchset 56 (Latest):
                Joone Hur . resolved

                Hi @dch...@chromium.org, I've updated the CL to keep the existing single-URL handling code. This ensures we don't break the ability to get a title for a single URL. I've also separated the handler for the text/uri-list format so that it doesn't affect x-moz-url handling code.

                Please check the below code:
                ui/base/dragdrop/os_exchange_data_provider_win.cc
                ui/base/clipboard/clipboard_util_win.cc

                Therefore, I think we can land the current CL. I've also added more details to the design document, as we discussed.

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Daniel Cheng
                • Min Qin
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Owners
                • requirement satisfiedCode-Review
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
                Gerrit-Change-Number: 6608042
                Gerrit-PatchSet: 56
                Gerrit-Owner: Joone Hur <joon...@microsoft.com>
                Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
                Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
                Gerrit-Reviewer: Min Qin <qin...@chromium.org>
                Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
                Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
                Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
                Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                Gerrit-Attention: Min Qin <qin...@chromium.org>
                Gerrit-Comment-Date: Fri, 08 Aug 2025 07:12:15 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Sylvain Defresne (Gerrit)

                unread,
                Aug 14, 2025, 6:29:37 AMAug 14
                to Joone Hur, David Trainor, Avi Drissman, Min Qin, Rakina Zata Amni, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
                Attention needed from Avi Drissman, Daniel Cheng, David Trainor, Joone Hur and Min Qin

                Sylvain Defresne voted and added 1 comment

                Votes added by Sylvain Defresne

                Code-Review+1

                1 comment

                Patchset-level comments
                File-level comment, Patchset 57 (Latest):
                Sylvain Defresne . resolved

                lgtm for //components/bookmarks

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Avi Drissman
                • Daniel Cheng
                • David Trainor
                • Joone Hur
                • Min Qin
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Owners
                • requirement satisfiedCode-Review
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
                Gerrit-Change-Number: 6608042
                Gerrit-PatchSet: 57
                Gerrit-Owner: Joone Hur <joon...@microsoft.com>
                Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
                Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
                Gerrit-Reviewer: Min Qin <qin...@chromium.org>
                Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
                Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
                Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
                Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                Gerrit-Attention: Avi Drissman <a...@chromium.org>
                Gerrit-Attention: David Trainor <dtra...@chromium.org>
                Gerrit-Attention: Min Qin <qin...@chromium.org>
                Gerrit-Attention: Joone Hur <joon...@microsoft.com>
                Gerrit-Comment-Date: Thu, 14 Aug 2025 10:29:20 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: Yes
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Joone Hur (Gerrit)

                unread,
                Aug 25, 2025, 3:52:55 AMAug 25
                to Sylvain Defresne, David Trainor, Avi Drissman, Min Qin, Rakina Zata Amni, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
                Attention needed from Daniel Cheng, David Trainor and Min Qin

                Joone Hur added 1 comment

                Patchset-level comments
                Joone Hur . resolved

                Hi @dch...@chromium.org, I've updated the CL to keep the existing single-URL handling code. This ensures we don't break the ability to get a title for a single URL. I've also separated the handler for the text/uri-list format so that it doesn't affect x-moz-url handling code.

                Please check the below code:
                ui/base/dragdrop/os_exchange_data_provider_win.cc
                ui/base/clipboard/clipboard_util_win.cc

                Therefore, I think we can land the current CL. I've also added more details to the design document, as we discussed.

                Joone Hur

                Hi @dch...@chromium.org, I've updated the CL to keep the existing single-URL handling code. This ensures we don't break the ability to get a title for a single URL. I've also separated the handler for the text/uri-list format so that it doesn't affect x-moz-url handling code.

                Please check the below code:
                ui/base/dragdrop/os_exchange_data_provider_win.cc
                ui/base/clipboard/clipboard_util_win.cc

                Therefore, I think we can land the current CL. I've also added more details to the design document, as we discussed.

                Attention is currently required from:
                • Daniel Cheng
                • David Trainor
                • Min Qin
                Gerrit-Attention: David Trainor <dtra...@chromium.org>
                Gerrit-Attention: Min Qin <qin...@chromium.org>
                Gerrit-Comment-Date: Mon, 25 Aug 2025 07:52:41 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                Comment-In-Reply-To: Joone Hur <joon...@microsoft.com>
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Daniel Cheng (Gerrit)

                unread,
                Sep 19, 2025, 6:07:43 PMSep 19
                to Joone Hur, Sylvain Defresne, David Trainor, Avi Drissman, Min Qin, Rakina Zata Amni, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
                Attention needed from David Trainor, Joone Hur, Min Qin and Sylvain Defresne

                Daniel Cheng added 4 comments

                Patchset-level comments
                File-level comment, Patchset 75 (Latest):
                Daniel Cheng . unresolved

                The design doc helps; however, I should have been specific that the part that is important to focus on is how to translate between the web formats and the platform-specific formats. The actual C++ code isn't that interesting for the design doc; it's how we want to do the transform, and how we can do it in a way that's not surprising and doesn't lose data in edge cases.

                File ui/base/clipboard/clipboard_format_type_win.cc
                Line 180, Patchset 75 (Latest): RegisterClipboardFormatChecked(L"multi-url/title"));
                Daniel Cheng . unresolved

                We should either:

                • not try to make this MIME-ish and just name this with a name like "PNG" or "HTML Format" or "Web Custom Format Map"
                • or this should be something like `chromium/x-source-url`

                Personally I would recommend the former here; I don't think there's a strong convention about clipboard foramt names being MIME types on Windows.

                It would also be a good courtesy to at least reach out to Apple and Mozilla to see if they want to be able to interoperate here.

                File ui/base/dragdrop/os_exchange_data_provider_win.cc
                Line 341, Patchset 75 (Latest): if (url_infos.empty()) {
                Daniel Cheng . unresolved

                I think we should probably `DCHECK()` that this is not the case, but I'm not 100% sure...

                Line 360, Patchset 75 (Latest): if (!url_info.title.empty()) {
                Daniel Cheng . unresolved

                If we keep the format as-is, we probably want to unconditionally serialize a title, even if it's empty. This simplifies the parsing, which will just have to deal with URL <-> title pairs.

                Otherwise, the parsing will have to deal with ambiguity: what happens if the title also happens to be a valid URL?

                Also, what happens if the title has an embedded newline? I don't think anything necessarily prevents that.

                The lazy answer here is "encode the URL + titles as an array of JSON values", but I'm not sure if that's the best approach either and that's somethign the design doc should probably talk about more.

                Open in Gerrit

                Related details

                Attention is currently required from:
                • David Trainor
                • Joone Hur
                • Min Qin
                • Sylvain Defresne
                Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                  Gerrit-MessageType: comment
                  Gerrit-Project: chromium/src
                  Gerrit-Branch: main
                  Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
                  Gerrit-Change-Number: 6608042
                  Gerrit-PatchSet: 75
                  Gerrit-Owner: Joone Hur <joon...@microsoft.com>
                  Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
                  Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
                  Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
                  Gerrit-Reviewer: Min Qin <qin...@chromium.org>
                  Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
                  Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
                  Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
                  Gerrit-Attention: Joone Hur <joon...@microsoft.com>
                  Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
                  Gerrit-Attention: David Trainor <dtra...@chromium.org>
                  Gerrit-Attention: Min Qin <qin...@chromium.org>
                  Gerrit-Comment-Date: Fri, 19 Sep 2025 22:07:32 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Joone Hur (Gerrit)

                  unread,
                  Sep 19, 2025, 8:51:25 PMSep 19
                  to Sylvain Defresne, David Trainor, Avi Drissman, Min Qin, Rakina Zata Amni, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
                  Attention needed from Daniel Cheng, David Trainor, Min Qin and Sylvain Defresne

                  Joone Hur added 5 comments

                  Patchset-level comments
                  Joone Hur . resolved

                  Thanks for the review!

                  Daniel Cheng . resolved

                  The design doc helps; however, I should have been specific that the part that is important to focus on is how to translate between the web formats and the platform-specific formats. The actual C++ code isn't that interesting for the design doc; it's how we want to do the transform, and how we can do it in a way that's not surprising and doesn't lose data in edge cases.

                  Joone Hur

                  I also added more context about the new clipboard format: https://docs.google.com/document/d/1zNvn2hQOfMCc9-L9_Wt-Q4rBhmSAQHhUYWMDdNKLCGU/edit?tab=t.0#heading=h.xy3joqqkfkn3, and I’ll include a section explaining how the data is converted through the clipboard.

                  File ui/base/clipboard/clipboard_format_type_win.cc
                  Line 180, Patchset 75 (Latest): RegisterClipboardFormatChecked(L"multi-url/title"));
                  Daniel Cheng . resolved

                  We should either:

                  • not try to make this MIME-ish and just name this with a name like "PNG" or "HTML Format" or "Web Custom Format Map"
                  • or this should be something like `chromium/x-source-url`

                  Personally I would recommend the former here; I don't think there's a strong convention about clipboard foramt names being MIME types on Windows.

                  It would also be a good courtesy to at least reach out to Apple and Mozilla to see if they want to be able to interoperate here.

                  Joone Hur

                  How about using "Web Bookmark List"? It fits well with existing Windows clipboard format naming conventions like "HTML Format" or "Web Custom Format Map". I’ll start by updating the format name to this, and we can revisit it later if a better name comes up during discussions with others.

                  File ui/base/dragdrop/os_exchange_data_provider_win.cc
                  Line 341, Patchset 75 (Latest): if (url_infos.empty()) {
                  Daniel Cheng . resolved

                  I think we should probably `DCHECK()` that this is not the case, but I'm not 100% sure...

                  Joone Hur
                  We can remove this condition since url_infos is already validated in PrepareDragData:
                  ```
                  if (!drop_data.url_infos.empty()) {
                  provider->SetURLs(drop_data.url_infos);
                  }
                  ```
                  Line 360, Patchset 75 (Latest): if (!url_info.title.empty()) {
                  Daniel Cheng . resolved

                  If we keep the format as-is, we probably want to unconditionally serialize a title, even if it's empty. This simplifies the parsing, which will just have to deal with URL <-> title pairs.

                  Otherwise, the parsing will have to deal with ambiguity: what happens if the title also happens to be a valid URL?

                  Also, what happens if the title has an embedded newline? I don't think anything necessarily prevents that.

                  The lazy answer here is "encode the URL + titles as an array of JSON values", but I'm not sure if that's the best approach either and that's somethign the design doc should probably talk about more.

                  Joone Hur

                  Okay, I'll simplify the parsing code by skipping the check for empty titles.
                  I'll also mention "using an array of JSON values" as an alternative format in the design document.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Daniel Cheng
                  • David Trainor
                  • Min Qin
                  • Sylvain Defresne
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                  Gerrit-MessageType: comment
                  Gerrit-Project: chromium/src
                  Gerrit-Branch: main
                  Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
                  Gerrit-Change-Number: 6608042
                  Gerrit-PatchSet: 75
                  Gerrit-Owner: Joone Hur <joon...@microsoft.com>
                  Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
                  Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
                  Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
                  Gerrit-Reviewer: Min Qin <qin...@chromium.org>
                  Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
                  Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
                  Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
                  Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
                  Gerrit-Attention: David Trainor <dtra...@chromium.org>
                  Gerrit-Attention: Min Qin <qin...@chromium.org>
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Comment-Date: Sat, 20 Sep 2025 00:51:14 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Joone Hur (Gerrit)

                  unread,
                  Sep 29, 2025, 3:36:36 AM (8 days ago) Sep 29
                  to Sylvain Defresne, David Trainor, Avi Drissman, Min Qin, Rakina Zata Amni, Daniel Cheng, Sadrul Chowdhury, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ajwong...@chromium.org, omnibox-...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ozone-...@chromium.org, max+watc...@igalia.com, kinuko+...@chromium.org, nickdiego+wa...@igalia.com, mac-r...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, dcheng+c...@chromium.org, jdonnel...@chromium.org, mahmad...@chromium.org, navigation...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
                  Attention needed from Daniel Cheng, David Trainor, Min Qin and Sylvain Defresne

                  Joone Hur added 1 comment

                  Patchset-level comments
                  File-level comment, Patchset 78 (Latest):
                  Joone Hur . resolved
                  The new clipboard format for multiple URLs has been renamed from `MultiUrlTitleType` to `BookmarkListType`:
                  ```
                  const ClipboardFormatType& ClipboardFormatType::BookmarkListType() {
                  static base::NoDestructor<ClipboardFormatType> format(
                  RegisterClipboardFormatChecked(L"Bookmark List"));
                  return *format;
                  }
                  ```
                  The design document has also been updated to include details on how the data is transformed during the drag operation.
                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Daniel Cheng
                  • David Trainor
                  • Min Qin
                  • Sylvain Defresne
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                  Gerrit-MessageType: comment
                  Gerrit-Project: chromium/src
                  Gerrit-Branch: main
                  Gerrit-Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
                  Gerrit-Change-Number: 6608042
                  Gerrit-PatchSet: 78
                  Gerrit-Owner: Joone Hur <joon...@microsoft.com>
                  Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
                  Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
                  Gerrit-Reviewer: Joone Hur <joon...@microsoft.com>
                  Gerrit-Reviewer: Min Qin <qin...@chromium.org>
                  Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
                  Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
                  Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
                  Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
                  Gerrit-Attention: David Trainor <dtra...@chromium.org>
                  Gerrit-Attention: Min Qin <qin...@chromium.org>
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Comment-Date: Mon, 29 Sep 2025 07:36:25 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy
                  Reply all
                  Reply to author
                  Forward
                  0 new messages