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

Unified Diff: ui/base/clipboard/clipboard_gtk.cc

Issue 9167002: Revert 116956 - GTK: Seal up GSEALs, focusing on GtkSelectionData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 11 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 | « content/browser/tab_contents/web_drag_source_gtk.cc ('k') | ui/base/dragdrop/gtk_dnd_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/clipboard/clipboard_gtk.cc
===================================================================
--- ui/base/clipboard/clipboard_gtk.cc (revision 116976)
+++ ui/base/clipboard/clipboard_gtk.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -129,8 +129,7 @@
Clipboard::TargetMap* data_map =
reinterpret_cast<Clipboard::TargetMap*>(user_data);
- std::string target_string = GdkAtomToString(
- gtk_selection_data_get_target(selection_data));
+ std::string target_string = GdkAtomToString(selection_data->target);
Clipboard::TargetMap::iterator iter = data_map->find(target_string);
if (iter == data_map->end())
@@ -140,8 +139,7 @@
gtk_selection_data_set_pixbuf(selection_data,
reinterpret_cast<GdkPixbuf*>(iter->second.first));
} else {
- gtk_selection_data_set(selection_data,
- gtk_selection_data_get_target(selection_data), 8,
+ gtk_selection_data_set(selection_data, selection_data->target, 8,
reinterpret_cast<guchar*>(iter->second.first),
iter->second.second);
}
@@ -423,9 +421,7 @@
clipboard, GetWebCustomDataFormatType().ToGdkAtom());
if (!data)
return;
- ReadCustomDataTypes(gtk_selection_data_get_data(data),
- gtk_selection_data_get_length(data),
- types);
+ ReadCustomDataTypes(data->data, data->length, types);
gtk_selection_data_free(data);
}
@@ -488,15 +484,12 @@
// If the data starts with 0xFEFF, i.e., Byte Order Mark, assume it is
// UTF-16, otherwise assume UTF-8.
- gint data_length = gtk_selection_data_get_length(data);
- const guchar* raw_data = gtk_selection_data_get_data(data);
-
- if (data_length >= 2 &&
- reinterpret_cast<const uint16_t*>(raw_data)[0] == 0xFEFF) {
- markup->assign(reinterpret_cast<const uint16_t*>(raw_data) + 1,
- (data_length / 2) - 1);
+ if (data->length >= 2 &&
+ reinterpret_cast<uint16_t*>(data->data)[0] == 0xFEFF) {
+ markup->assign(reinterpret_cast<uint16_t*>(data->data) + 1,
+ (data->length / 2) - 1);
} else {
- UTF8ToUTF16(reinterpret_cast<const char*>(raw_data), data_length, markup);
+ UTF8ToUTF16(reinterpret_cast<char*>(data->data), data->length, markup);
}
// If there is a terminating NULL, drop it.
@@ -539,9 +532,7 @@
clipboard, GetWebCustomDataFormatType().ToGdkAtom());
if (!data)
return;
- ReadCustomDataForType(gtk_selection_data_get_data(data),
- gtk_selection_data_get_length(data),
- type, result);
+ ReadCustomDataForType(data->data, data->length, type, result);
gtk_selection_data_free(data);
}
@@ -555,9 +546,7 @@
gtk_clipboard_wait_for_contents(clipboard_, format.ToGdkAtom());
if (!data)
return;
- result->assign(reinterpret_cast<const char*>(
- gtk_selection_data_get_data(data)),
- gtk_selection_data_get_length(data));
+ result->assign(reinterpret_cast<char*>(data->data), data->length);
gtk_selection_data_free(data);
}
« no previous file with comments | « content/browser/tab_contents/web_drag_source_gtk.cc ('k') | ui/base/dragdrop/gtk_dnd_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698