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

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

Issue 9419036: Change all platforms except Windows to access the clipboard solely from the UI thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 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_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/clipboard/clipboard_aurax11.cc
diff --git a/ui/base/clipboard/clipboard_aurax11.cc b/ui/base/clipboard/clipboard_aurax11.cc
index b8635a2c89731e9075a10638514705d5135a07cd..18cbb8c7ecd2d0d3639e3940ca631f9c900d356e 100644
--- a/ui/base/clipboard/clipboard_aurax11.cc
+++ b/ui/base/clipboard/clipboard_aurax11.cc
@@ -416,15 +416,18 @@ bool Clipboard::FormatType::Equals(const FormatType& other) const {
}
Clipboard::Clipboard() {
+ DCHECK(CalledOnValidThread());
// Make sure clipboard is created.
GetClipboard();
}
Clipboard::~Clipboard() {
+ DCHECK(CalledOnValidThread());
DeleteClipboard();
}
void Clipboard::WriteObjects(Buffer buffer, const ObjectMap& objects) {
+ DCHECK(CalledOnValidThread());
DCHECK(IsValidBuffer(buffer));
for (ObjectMap::const_iterator iter = objects.begin();
iter != objects.end(); ++iter) {
@@ -435,6 +438,7 @@ void Clipboard::WriteObjects(Buffer buffer, const ObjectMap& objects) {
bool Clipboard::IsFormatAvailable(const FormatType& format,
Buffer buffer) const {
+ DCHECK(CalledOnValidThread());
DCHECK(IsValidBuffer(buffer));
AuraClipboard* clipboard = GetClipboard();
if (GetPlainTextFormatType().Equals(format))
@@ -455,6 +459,7 @@ bool Clipboard::IsFormatAvailable(const FormatType& format,
void Clipboard::ReadAvailableTypes(Buffer buffer, std::vector<string16>* types,
bool* contains_filenames) const {
+ DCHECK(CalledOnValidThread());
if (!types || !contains_filenames) {
NOTREACHED();
return;
@@ -477,10 +482,12 @@ void Clipboard::ReadAvailableTypes(Buffer buffer, std::vector<string16>* types,
}
void Clipboard::ReadText(Buffer buffer, string16* result) const {
+ DCHECK(CalledOnValidThread());
GetClipboard()->ReadText(result);
}
void Clipboard::ReadAsciiText(Buffer buffer, std::string* result) const {
+ DCHECK(CalledOnValidThread());
GetClipboard()->ReadAsciiText(result);
}
@@ -489,28 +496,34 @@ void Clipboard::ReadHTML(Buffer buffer,
std::string* src_url,
uint32* fragment_start,
uint32* fragment_end) const {
+ DCHECK(CalledOnValidThread());
GetClipboard()->ReadHTML(markup, src_url, fragment_start, fragment_end);
}
SkBitmap Clipboard::ReadImage(Buffer buffer) const {
+ DCHECK(CalledOnValidThread());
return GetClipboard()->ReadImage();
}
void Clipboard::ReadCustomData(Buffer buffer,
const string16& type,
string16* result) const {
+ DCHECK(CalledOnValidThread());
GetClipboard()->ReadCustomData(type, result);
}
void Clipboard::ReadBookmark(string16* title, std::string* url) const {
+ DCHECK(CalledOnValidThread());
GetClipboard()->ReadBookmark(title, url);
}
void Clipboard::ReadData(const FormatType& format, std::string* result) const {
+ DCHECK(CalledOnValidThread());
GetClipboard()->ReadData(format.ToString(), result);
}
uint64 Clipboard::GetSequenceNumber(Buffer buffer) {
+ DCHECK(CalledOnValidThread());
return GetClipboard()->GetNumClipboardEntries();
}
« no previous file with comments | « ui/base/clipboard/clipboard.h ('k') | ui/base/clipboard/clipboard_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698