Commit 856849e1 authored by Darwin Huang's avatar Darwin Huang Committed by Commit Bot

Android Clipboard: Update legacy implementation comment.

Update the comment and explain it a bit better. Bitmaps have been
supported in the Native Android clipboard since https://crrev.com/c/2147890.

While I'm unsure of the first instance of this comment, an early
iteration is active in March 2012(https://crrev.com/9264014),
and a recent, more well-documented change that expanded this comment
is available here(https://crrev.com/12633009)

Change-Id: I192d3abd050577c026f126ed99c9d9313756555c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2382881
Auto-Submit: Darwin Huang <huangdarwin@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#802884}
parent d3ef8cd9
...@@ -32,16 +32,21 @@ ...@@ -32,16 +32,21 @@
#include "ui/gfx/android/java_bitmap.h" #include "ui/gfx/android/java_bitmap.h"
#include "ui/gfx/image/image.h" #include "ui/gfx/image/image.h"
// TODO:(andrewhayden) Support additional formats in Android: Bitmap, URI, HTML, // TODO:(andrewhayden) Support additional formats in Android: URI, HTML,
// HTML+text now that Android's clipboard system supports them, then nuke the // HTML+text now that Android's clipboard system supports them, then nuke the
// legacy implementation note below. // legacy implementation note below.
// Legacy implementation note: // Legacy implementation note:
// The Android clipboard system used to only support text format. So we used the // The Android clipboard, and hence `ClipboardAndroid` as well, used to only
// Android system when some text was added or retrieved from the system. For // support text. Since then, bitmap support has been added, but not support
// anything else, we STILL store the value in some process wide static // for any other formats.
// variable protected by a lock. So the (non-text) clipboard will only work //
// within the same process. // Therefore, Clipboard data is stored:
// - on the Android system, for text and bitmaps.
// - in a process-wide static variable protected by a lock, for other formats.
//
// These "other formats" only work within the same process, and can't be copied
// between Android applications.
using base::android::AttachCurrentThread; using base::android::AttachCurrentThread;
using base::android::ClearException; using base::android::ClearException;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment