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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp

Issue 2033293002: Implement StringImpl sharing for StringView::toString(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix preload scanner bug. Created 4 years, 6 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
Index: third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
index 2ae1766171f77bdc9b73668c8f8e54d842cbd2c4..40c27a3953e91fcfd515d9a918da8e1e19689c1b 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
@@ -193,7 +193,11 @@ public:
void handlePictureSourceURL(PictureData& pictureData)
{
if (match(m_tagImpl, sourceTag) && m_matched && pictureData.sourceURL.isEmpty()) {
- pictureData.sourceURL = m_srcsetImageCandidate.toString();
+ // Must create an isolatedCopy() since the srcset attribute value will
+ // get sent back to the main thread between when we set this, and when we
+ // process the closing tag which would clear m_pictureData. Having any
+ // ref to a string we're going to send will fail isSafeToSendToAnotherThread().
esprehn 2016/06/03 20:28:29 This was a bug that already existed, but StringVie
+ pictureData.sourceURL = m_srcsetImageCandidate.toString().isolatedCopy();
pictureData.sourceSizeSet = m_sourceSizeSet;
pictureData.sourceSize = m_sourceSize;
pictureData.picked = true;
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/text/StringBuilder.h » ('j') | third_party/WebKit/Source/wtf/text/StringBuilder.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698