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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.h

Issue 2025503002: Revert of Expand WTF::StringView's API to be more like StringPiece. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/HTMLSrcsetParser.h
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.h b/third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.h
index 612b4425d0466e4f72fa20257bbdde108510e4aa..16492ee1c58b5f9af60161b893e3b278a74e4150 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.h
+++ b/third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.h
@@ -34,7 +34,6 @@
#include "core/CoreExport.h"
#include "wtf/Allocator.h"
-#include "wtf/text/StringView.h"
#include "wtf/text/WTFString.h"
namespace blink {
@@ -87,22 +86,21 @@
}
ImageCandidate(const String& source, unsigned start, unsigned length, const DescriptorParsingResult& result, OriginAttribute originAttribute)
- : m_source(source)
- , m_string(source, start, length)
- , m_density(result.hasDensity() ? result.density() : UninitializedDescriptor)
- , m_resourceWidth(result.hasWidth() ? result.getResourceWidth() : UninitializedDescriptor)
+ : m_string(source.createView(start, length))
+ , m_density(result.hasDensity()?result.density():UninitializedDescriptor)
+ , m_resourceWidth(result.hasWidth()?result.getResourceWidth():UninitializedDescriptor)
, m_originAttribute(originAttribute)
{
}
String toString() const
{
- return m_string.toString();
+ return String(m_string.toString());
}
AtomicString url() const
{
- return AtomicString(toString());
+ return AtomicString(m_string.toString());
}
void setDensity(float factor)
@@ -131,7 +129,6 @@
}
private:
- String m_source; // Keep the StringView buffer alive.
StringView m_string;
float m_density;
int m_resourceWidth;

Powered by Google App Engine
This is Rietveld 408576698