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

Unified Diff: third_party/WebKit/Source/core/fetch/TextResource.cpp

Issue 1819593002: Preload scan external css for @import (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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/fetch/TextResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/TextResource.cpp b/third_party/WebKit/Source/core/fetch/TextResource.cpp
index f4878dd3c04ced697feb7a0274df619b21e602aa..d5b213cd8e45c7dcc3fcf1f317949006124ebf57 100644
--- a/third_party/WebKit/Source/core/fetch/TextResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/TextResource.cpp
@@ -32,16 +32,22 @@ String TextResource::encoding() const
String TextResource::decodedText() const
{
+ size_t position = 0;
+ return streamDecodedText(&position);
+}
+
+String TextResource::streamDecodedText(size_t* position) const
+{
ASSERT(m_data);
Yoav Weiss 2016/03/30 21:38:31 ASSERT that position is not null
Charlie Harrison 2016/03/31 03:59:59 Done.
StringBuilder builder;
const char* data;
- size_t position = 0;
- while (size_t length = m_data->getSomeData(data, position)) {
+ while (size_t length = m_data->getSomeData(data, *position)) {
builder.append(m_decoder->decode(data, length));
- position += length;
+ *position += length;
}
builder.append(m_decoder->flush());
+
return builder.toString();
}

Powered by Google App Engine
This is Rietveld 408576698