Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp |
| index 306d636b949661b5bec92ae512876d50336d40cd..692f70f4764b47fc49b7224b7fa16b16c408462a 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp |
| @@ -14,6 +14,11 @@ ScriptSourceCode::ScriptSourceCode() |
| } |
| ScriptSourceCode::ScriptSourceCode(const String& source, const KURL& url, const TextPosition& startPosition) |
| + : ScriptSourceCode(CompressibleString(source.impl()), url, startPosition) |
| +{ |
| +} |
| + |
| +ScriptSourceCode::ScriptSourceCode(const CompressibleString& source, const KURL& url, const TextPosition& startPosition) |
| : m_source(source) |
| , m_resource(0) |
| , m_url(url) |
| @@ -76,14 +81,14 @@ String ScriptSourceCode::sourceMapUrl() const |
| void ScriptSourceCode::treatNullSourceAsEmpty() |
| { |
| // ScriptSourceCode allows for the representation of the null/not-there-really ScriptSourceCode value. |
| - // Encoded by way of a m_source.isNull() being true, with the nullary constructor to be used to |
| + // Encoded by way of a m_source->isNull() being true, with the nullary constructor to be used to |
|
hajimehoshi
2015/11/26 10:56:19
nit
|
| // construct such a value. |
| // |
| // Should the other constructors be passed a null string, that is interpreted as representing |
| // the empty script. Consequently, we need to disambiguate between such null string occurrences. |
| // Do that by converting the latter case's null strings into empty ones. |
| if (m_source.isNull()) |
| - m_source = ""; |
| + m_source = CompressibleString(StringImpl::empty()); |
| } |
| } // namespace blink |