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

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

Issue 12298037: Revert 183123 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1417/src/
Patch Set: Created 7 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/clipboard/clipboard.h ('k') | ui/base/clipboard/clipboard_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/clipboard/clipboard.cc
===================================================================
--- ui/base/clipboard/clipboard.cc (revision 183210)
+++ ui/base/clipboard/clipboard.cc (working copy)
@@ -92,15 +92,6 @@
static base::LazyInstance<base::Lock>::Leaky
g_clipboard_map_lock = LAZY_INSTANCE_INITIALIZER;
-const std::size_t kSourceTagSize = sizeof(Clipboard::SourceTag);
-
-// The union serves to easily convert SourceTag into its binary representation
-// and vice versa.
-union SourceTag2BinaryHelper {
- Clipboard::SourceTag tag;
- uint8 bytes[kSourceTagSize];
-};
-
} // namespace
const char Clipboard::kMimeTypeText[] = "text/plain";
@@ -111,24 +102,6 @@
const char Clipboard::kMimeTypePNG[] = "image/png";
// static
-Clipboard::ObjectMapParam Clipboard::SourceTag2Binary(SourceTag tag) {
- SourceTag2BinaryHelper helper;
- helper.tag = tag;
- std::vector<char> bytes(kSourceTagSize);
- memcpy(&bytes[0], helper.bytes, kSourceTagSize);
- return bytes;
-}
-
-// static
-Clipboard::SourceTag Clipboard::Binary2SourceTag(const std::string& binary) {
- if (binary.size() != kSourceTagSize)
- return SourceTag();
- SourceTag2BinaryHelper helper;
- memcpy(helper.bytes, binary.c_str(), kSourceTagSize);
- return helper.tag;
-}
-
-// static
void Clipboard::SetAllowedThreads(
const std::vector<base::PlatformThreadId>& allowed_threads) {
base::AutoLock lock(g_clipboard_map_lock.Get());
@@ -180,14 +153,6 @@
}
}
-void Clipboard::WriteObjects(Buffer buffer,
- const ObjectMap& objects,
- SourceTag tag) {
- WriteObjectsImpl(buffer, objects, tag);
- if (!write_objects_callback_.is_null())
- write_objects_callback_.Run(buffer);
-}
-
void Clipboard::DispatchObject(ObjectType type, const ObjectMapParams& params) {
// All types apart from CBF_WEBKIT need at least 1 non-empty param.
if (type != CBF_WEBKIT && (params.empty() || params[0].empty()))
« no previous file with comments | « ui/base/clipboard/clipboard.h ('k') | ui/base/clipboard/clipboard_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698