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

Unified Diff: Source/platform/network/FormData.cpp

Issue 1276203004: Implement FormData::isSafeToSendToAnotherThread() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use range-based for. Created 5 years, 4 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 | « Source/platform/network/FormData.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/network/FormData.cpp
diff --git a/Source/platform/network/FormData.cpp b/Source/platform/network/FormData.cpp
index 29c655aba4176a3236a04312d86fa7a0c43ca46a..c56f4c8f394813b1d5840345c16f6ede28e82ee9 100644
--- a/Source/platform/network/FormData.cpp
+++ b/Source/platform/network/FormData.cpp
@@ -29,6 +29,13 @@
namespace blink {
+bool FormDataElement::isSafeToSendToAnotherThread() const
+{
+ return m_filename.isSafeToSendToAnotherThread()
+ && m_blobUUID.isSafeToSendToAnotherThread()
+ && m_fileSystemURL.isSafeToSendToAnotherThread();
+}
+
inline FormData::FormData()
: m_identifier(0)
, m_containsPasswordData(false)
@@ -187,4 +194,15 @@ unsigned long long FormData::sizeInBytes() const
return size;
}
+bool FormData::isSafeToSendToAnotherThread() const
+{
+ if (!hasOneRef())
+ return false;
+ for (auto& element : m_elements) {
+ if (!element.isSafeToSendToAnotherThread())
+ return false;
+ }
+ return true;
+}
+
} // namespace blink
« no previous file with comments | « Source/platform/network/FormData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698