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

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

Issue 17029020: linux_aura: Redo how memory is handled in clipboard/drag code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes for sky; ptal Created 7 years, 6 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_requestor.h ('k') | ui/base/x/selection_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/x/selection_requestor.cc
diff --git a/ui/base/x/selection_requestor.cc b/ui/base/x/selection_requestor.cc
index 1fd28729c28188895e2dfbd2ef1371290c4f1a39..405c0592f8010dff841a9993bc2740c213c5cc70 100644
--- a/ui/base/x/selection_requestor.cc
+++ b/ui/base/x/selection_requestor.cc
@@ -38,7 +38,7 @@ SelectionRequestor::~SelectionRequestor() {}
bool SelectionRequestor::PerformBlockingConvertSelection(
Atom target,
- unsigned char** out_data,
+ scoped_refptr<base::RefCountedMemory>* out_data,
size_t* out_data_bytes,
size_t* out_data_items,
Atom* out_type) {
@@ -73,11 +73,11 @@ bool SelectionRequestor::PerformBlockingConvertSelection(
out_type);
}
-scoped_ptr<SelectionData> SelectionRequestor::RequestAndWaitForTypes(
+SelectionData SelectionRequestor::RequestAndWaitForTypes(
const std::vector< ::Atom>& types) {
for (std::vector< ::Atom>::const_iterator it = types.begin();
it != types.end(); ++it) {
- unsigned char* data = NULL;
+ scoped_refptr<base::RefCountedMemory> data;
size_t data_bytes = 0;
::Atom type = None;
if (PerformBlockingConvertSelection(*it,
@@ -86,13 +86,11 @@ scoped_ptr<SelectionData> SelectionRequestor::RequestAndWaitForTypes(
NULL,
&type) &&
type == *it) {
- scoped_ptr<SelectionData> data_out(new SelectionData);
- data_out->Set(type, (char*)data, data_bytes, true);
- return data_out.Pass();
+ return SelectionData(type, data);
}
}
- return scoped_ptr<SelectionData>();
+ return SelectionData();
}
void SelectionRequestor::OnSelectionNotify(const XSelectionEvent& event) {
« no previous file with comments | « ui/base/x/selection_requestor.h ('k') | ui/base/x/selection_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698