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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp

Issue 1583263002: Experimental CompressibleString UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adopt lazy-initializing way Created 4 years, 11 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/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 9e17ff28c30c1461742161060958e1d9dbeab044..dfb64233937c17875c97fc53a8e5fa6b034d476b 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp
@@ -13,6 +13,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)
@@ -82,7 +87,7 @@ void ScriptSourceCode::treatNullSourceAsEmpty()
// 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();
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.h ('k') | third_party/WebKit/Source/bindings/core/v8/V8Binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698