| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
void PerformConvertSelection(x11::Atom selection,Should this also have "Async" in the name?
auto request = std::make_unique<Request>(selection, target, timeout,Just merge into line 65.
x11::Atom target = types.front();Does the ordering matter? If this can grab the back element, then the next line can just pop the back element instead of copying all the other elements.
if (!weak_this) {Given this, should line 167, 172, etc all have a warning comment to say "do nothing since `this` may be gone"?
if (index >= requests_.size()) {Pre-existing: Can this happen?
std::vector<uint8_t> data1 = future1.Get<1>();Const-ref to avoid a copy.
EXPECT_EQ("Data1", std::string(data1.begin(), data1.end()));Maybe string_view to avoid a copy.
EXPECT_FALSE(future.Get<0>());Should this check elements 1 and 2?
std::string data_str(span.begin(), span.end());string_view / merge into next line.
base::WeakPtrFactory<XClipboardHelper> self_ptr_factory_{this};Maybe just use the common "weak_ptr_factory_" name since there are no other WeakPtrFactories.
// Returns the first of |types| offered by the current selection holder, orUpdate comment since this no longer returns.
const char kClipboardManager[] = "CLIPBOARD_MANAGER";Curious what this was for and why it's safe to remove.
std::sort(common_types.begin(), common_types.end());std::ranges::sort(common_types); ?
std::unique(common_types.begin(), common_types.end()),std::ranges::unique?
std::vector<x11::Atom> out;Remove and just use base::ToVector(atom_array) on line 373.
// TODO(crbug.com/40054419): Consider adding a way of filtering mime types andIs this TODO still relevant?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
Should this also have "Async" in the name?
Done
auto request = std::make_unique<Request>(selection, target, timeout,Just merge into line 65.
Done
Does the ordering matter? If this can grab the back element, then the next line can just pop the back element instead of copying all the other elements.
Done
Given this, should line 167, 172, etc all have a warning comment to say "do nothing since `this` may be gone"?
Done
if (index >= requests_.size()) {Thomas AndersonPre-existing: Can this happen?
changed to CHECK_LT
// 3. Update requests_ queueThomas AndersonWrap in backticks.
Done
Const-ref to avoid a copy.
Done
EXPECT_EQ("Data1", std::string(data1.begin(), data1.end()));Maybe string_view to avoid a copy.
Done
Should this check elements 1 and 2?
Done
string_view / merge into next line.
Done
base::WeakPtrFactory<XClipboardHelper> self_ptr_factory_{this};Maybe just use the common "weak_ptr_factory_" name since there are no other WeakPtrFactories.
Done
// Returns the first of |types| offered by the current selection holder, orUpdate comment since this no longer returns.
Done
const char kClipboardManager[] = "CLIPBOARD_MANAGER";Curious what this was for and why it's safe to remove.
It was used in XClipboardHelper::StoreCopyPasteDataAndWait, but that function was not called anywhere (even before this change), so it was removed.
std::sort(common_types.begin(), common_types.end());Thomas Andersonstd::ranges::sort(common_types); ?
Done
std::unique(common_types.begin(), common_types.end()),Thomas Andersonstd::ranges::unique?
Done
std::vector<x11::Atom> out;Thomas AndersonCall reserve()
Done
Remove and just use base::ToVector(atom_array) on line 373.
Done
// TODO(crbug.com/40054419): Consider adding a way of filtering mime types andIs this TODO still relevant?
it's not relevant any more since the new interface Clipboard::GetAllAvailableFormats needs to fetch them all.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
std::reverse(remaining_types.begin(), remaining_types.end());Use `std::ranges::reverse_copy(types, std::back_inserter(remaining_types));` or some other way to do it in one shot.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
thestig@ ptal again. I've made a change in chrome/browser/ui/views/bookmarks/bookmark_bar_view.* to fix a failing test
std::reverse(remaining_types.begin(), remaining_types.end());Use `std::ranges::reverse_copy(types, std::back_inserter(remaining_types));` or some other way to do it in one shot.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
thestig@ ptal again. I've made a change in chrome/browser/ui/views/bookmarks/bookmark_bar_view.* to fix a failing test
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
Lei Zhangthestig@ ptal again. I've made a change in chrome/browser/ui/views/bookmarks/bookmark_bar_view.* to fix a failing test
Please mention it in the CL description.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Still have red bots.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
11 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
[X11] Convert clipboard backend to asynchronous architecture
This change refactors the X11 clipboard backend to eliminate synchronous
event dispatching and nested run-loops, which were prone to re-entrancy
issues and deadlocks.
Key changes:
- SelectionRequestor: Replaced PerformBlockingConvertSelection with an
asynchronous PerformConvertSelection that uses callbacks. Introduced
RequestTypesAsync for chained type requests and used base::OneShotTimer
for timeouts.
- XClipboardHelper: Converted Read, GetTargetList, and IsFormatAvailable
to asynchronous versions. Consolidated available type queries into
GetAvailableMimeTypesAsync using base::BarrierCallback for parallel
atom name resolution.
- X11ClipboardOzone: Integrated the new asynchronous helper methods into
the Ozone platform clipboard.
- Unit Tests: Updated and re-enabled SelectionRequestorTest.NestedRequests
to verify correct asynchronous behavior.
- Safety: Improved memory management in SelectionRequestor by ensuring
re-entrancy safety in CompleteRequest and preventing use-after-free
in AbortStaleRequests using WeakPtr checks.
- Performance: Optimized data transfer by using move semantics for
clipboard data in callbacks.
- BookmarkBarView now adds the anchor highlight before obtaining the
clipboard state to satisfy test expectations.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |