Chromium Code Reviews| Index: ui/base/x/selection_owner.h |
| diff --git a/ui/base/x/selection_owner.h b/ui/base/x/selection_owner.h |
| index fd2326c9752151a0f129f7ae38cf0882812439c7..ec0ea56fc415fbc739192900e0363c7010db2eb3 100644 |
| --- a/ui/base/x/selection_owner.h |
| +++ b/ui/base/x/selection_owner.h |
| @@ -65,10 +65,10 @@ class UI_BASE_EXPORT SelectionOwner { |
| IncrementalTransfer(XID window, |
| XAtom target, |
| XAtom property, |
| + std::unique_ptr<XScopedEventSelector> event_selector, |
| const scoped_refptr<base::RefCountedMemory>& data, |
| int offset, |
| base::TimeTicks timeout); |
| - IncrementalTransfer(const IncrementalTransfer& other); |
| ~IncrementalTransfer(); |
| // Parameters from the XSelectionRequest. The data is transferred over |
| @@ -77,6 +77,9 @@ class UI_BASE_EXPORT SelectionOwner { |
| XAtom target; |
| XAtom property; |
| + // Selects events on |window|. |
| + std::unique_ptr<XScopedEventSelector> event_selector; |
| + |
| // The data to be transferred. |
| scoped_refptr<base::RefCountedMemory> data; |
| @@ -87,8 +90,13 @@ class UI_BASE_EXPORT SelectionOwner { |
| // Time when the transfer should be aborted because the selection requestor |
| // is taking too long to notify us that we can send the next chunk. |
| base::TimeTicks timeout; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(IncrementalTransfer); |
| }; |
| + typedef typename std::vector<std::unique_ptr<IncrementalTransfer>>::iterator |
|
dcheng
2017/02/17 07:42:13
Nit: prefer using A = B; rather than typename B A;
pkotwicz
2017/02/17 19:19:07
Done.
|
| + IncrementalTransferIt; |
| + |
| // Attempts to convert the selection to |target|. If the conversion is |
| // successful, true is returned and the result is stored in the |property| |
| // of |requestor|. |
| @@ -101,21 +109,16 @@ class UI_BASE_EXPORT SelectionOwner { |
| void AbortStaleIncrementalTransfers(); |
| // Called when the transfer at |it| has completed to do cleanup. |
| - void CompleteIncrementalTransfer( |
| - std::vector<IncrementalTransfer>::iterator it); |
| + void CompleteIncrementalTransfer(IncrementalTransferIt it); |
| // Returns the incremental data transfer, if any, which was waiting for |
| // |event|. |
| - std::vector<IncrementalTransfer>::iterator FindIncrementalTransferForEvent( |
| - const XEvent& event); |
| + IncrementalTransferIt FindIncrementalTransferForEvent(const XEvent& event); |
| // Our X11 state. |
| XDisplay* x_display_; |
| XID x_window_; |
| - // Events selected on the requesting window. |
| - std::unique_ptr<XScopedEventSelector> requestor_events_; |
| - |
| // The X11 selection that this instance communicates on. |
| XAtom selection_name_; |
| @@ -128,7 +131,7 @@ class UI_BASE_EXPORT SelectionOwner { |
| // The data we are currently serving. |
| SelectionFormatMap format_map_; |
| - std::vector<IncrementalTransfer> incremental_transfers_; |
| + std::vector<std::unique_ptr<IncrementalTransfer>> incremental_transfers_; |
|
dcheng
2017/02/17 07:42:13
Another possibility (to make the typename shorter)
pkotwicz
2017/02/17 19:19:07
I'd rather not implement a custom move assignment
dcheng
2017/02/17 19:21:16
That's what = default is for though =)
Incrementa
|
| // Used to abort stale incremental data transfers. |
| base::RepeatingTimer incremental_transfer_abort_timer_; |