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

Unified Diff: third_party/WebKit/Source/core/clipboard/DataTransferItem.cpp

Issue 2586173003: Inline StringCallback::scheduleCallback to the caller (Closed)
Patch Set: Created 4 years 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 | « no previous file | third_party/WebKit/Source/core/dom/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/clipboard/DataTransferItem.cpp
diff --git a/third_party/WebKit/Source/core/clipboard/DataTransferItem.cpp b/third_party/WebKit/Source/core/clipboard/DataTransferItem.cpp
index bd4831775d2173d6988fd56586312c773b792729..46c47d0c697827a10e575837748fe0dca1ac33a1 100644
--- a/third_party/WebKit/Source/core/clipboard/DataTransferItem.cpp
+++ b/third_party/WebKit/Source/core/clipboard/DataTransferItem.cpp
@@ -33,9 +33,13 @@
#include "bindings/core/v8/V8Binding.h"
#include "core/clipboard/DataObjectItem.h"
#include "core/clipboard/DataTransfer.h"
+#include "core/dom/ExecutionContext.h"
+#include "core/dom/ExecutionContextTask.h"
#include "core/dom/StringCallback.h"
#include "core/dom/TaskRunnerHelper.h"
+#include "public/platform/WebTraceLocation.h"
#include "wtf/StdLibExtras.h"
+#include "wtf/text/WTFString.h"
namespace blink {
@@ -72,9 +76,11 @@ void DataTransferItem::getAsString(ExecutionContext* context,
if (!callback || m_item->kind() != DataObjectItem::StringKind)
return;
- StringCallback::scheduleCallback(TaskType::UserInteraction, callback, context,
- m_item->getAsString(),
- "DataTransferItem.getAsString");
+ context->postTask(
+ TaskType::UserInteraction, BLINK_FROM_HERE,
+ createSameThreadTask(&StringCallback::handleEvent,
+ wrapPersistent(callback), m_item->getAsString()),
+ "DataTransferItem.getAsString");
}
Blob* DataTransferItem::getAsFile() const {
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698