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

Unified Diff: ui/base/x/selection_owner.cc

Issue 2700043002: [Desktop Linux]: Fix copy and pasting long selections (Closed)
Patch Set: Merge branch 'master' into selection_requestor Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/x/selection_owner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/x/selection_owner.cc
diff --git a/ui/base/x/selection_owner.cc b/ui/base/x/selection_owner.cc
index ea0ad226f32eafebc45101073a89fba1b5e146c6..83e6f38183e1fe117fa884b1c433aa5fd6e9c00d 100644
--- a/ui/base/x/selection_owner.cc
+++ b/ui/base/x/selection_owner.cc
@@ -9,6 +9,7 @@
#include <X11/Xatom.h>
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "ui/base/x/selection_utils.h"
#include "ui/base/x/x11_util.h"
#include "ui/base/x/x11_window_event_manager.h"
@@ -269,10 +270,10 @@ bool SelectionOwner::ProcessTarget(XAtom target,
base::TimeTicks timeout =
base::TimeTicks::Now() +
base::TimeDelta::FromMilliseconds(kIncrementalTransferTimeoutMs);
- requestor_events_.reset(
- new ui::XScopedEventSelector(requestor, PropertyChangeMask));
incremental_transfers_.push_back(IncrementalTransfer(
- requestor, target, property, it->second, 0, timeout));
+ requestor, target, property,
+ base::MakeUnique<XScopedEventSelector>(requestor, PropertyChangeMask),
Daniel Erat 2017/02/21 18:09:28 nit, just to check: is this what clang-format sugg
pkotwicz 2017/02/22 03:06:30 Run "git cl format" on this CL does not result in
+ it->second, 0, timeout));
// Start a timer to abort the data transfer in case that the selection
// requestor does not support the INCR property or gets destroyed during
@@ -338,8 +339,6 @@ void SelectionOwner::AbortStaleIncrementalTransfers() {
void SelectionOwner::CompleteIncrementalTransfer(
std::vector<IncrementalTransfer>::iterator it) {
- requestor_events_.reset();
-
incremental_transfers_.erase(it);
if (incremental_transfers_.empty())
@@ -364,18 +363,23 @@ SelectionOwner::IncrementalTransfer::IncrementalTransfer(
XID window,
XAtom target,
XAtom property,
+ std::unique_ptr<XScopedEventSelector> event_selector,
const scoped_refptr<base::RefCountedMemory>& data,
int offset,
base::TimeTicks timeout)
: window(window),
target(target),
property(property),
+ event_selector(std::move(event_selector)),
data(data),
offset(offset),
timeout(timeout) {}
SelectionOwner::IncrementalTransfer::IncrementalTransfer(
- const IncrementalTransfer& other) = default;
+ IncrementalTransfer&& other) = default;
+
+SelectionOwner::IncrementalTransfer& SelectionOwner::IncrementalTransfer::
+operator=(IncrementalTransfer&&) = default;
SelectionOwner::IncrementalTransfer::~IncrementalTransfer() {
}
« no previous file with comments | « ui/base/x/selection_owner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698