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

Side by Side Diff: ui/base/x/selection_requestor.cc

Issue 1803263002: base: Make RefCountedBytes::TakeVector return ref ptr instead of raw ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/print_preview/print_preview_ui.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/x/selection_requestor.h" 5 #include "ui/base/x/selection_requestor.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 9
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 for (size_t i = 0; i < data.size(); ++i) 47 for (size_t i = 0; i < data.size(); ++i)
48 length += data[i]->size(); 48 length += data[i]->size();
49 std::vector<unsigned char> combined_data; 49 std::vector<unsigned char> combined_data;
50 combined_data.reserve(length); 50 combined_data.reserve(length);
51 51
52 for (size_t i = 0; i < data.size(); ++i) { 52 for (size_t i = 0; i < data.size(); ++i) {
53 combined_data.insert(combined_data.end(), 53 combined_data.insert(combined_data.end(),
54 data[i]->front(), 54 data[i]->front(),
55 data[i]->front() + data[i]->size()); 55 data[i]->front() + data[i]->size());
56 } 56 }
57 return scoped_refptr<base::RefCountedMemory>( 57 return base::RefCountedBytes::TakeVector(&combined_data);
58 base::RefCountedBytes::TakeVector(&combined_data));
59 } 58 }
60 59
61 } // namespace 60 } // namespace
62 61
63 SelectionRequestor::SelectionRequestor(XDisplay* x_display, 62 SelectionRequestor::SelectionRequestor(XDisplay* x_display,
64 XID x_window, 63 XID x_window,
65 PlatformEventDispatcher* dispatcher) 64 PlatformEventDispatcher* dispatcher)
66 : x_display_(x_display), 65 : x_display_(x_display),
67 x_window_(x_window), 66 x_window_(x_window),
68 x_property_(None), 67 x_property_(None),
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 out_type(None), 311 out_type(None),
313 success(false), 312 success(false),
314 timeout(timeout), 313 timeout(timeout),
315 completed(false) { 314 completed(false) {
316 } 315 }
317 316
318 SelectionRequestor::Request::~Request() { 317 SelectionRequestor::Request::~Request() {
319 } 318 }
320 319
321 } // namespace ui 320 } // namespace ui
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/print_preview/print_preview_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698