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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8ValueCache.h

Issue 2227933002: Revert CompressibleString (and its UMA) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address on Ilya's review Created 4 years, 4 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/V8ValueCache.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ValueCache.h b/third_party/WebKit/Source/bindings/core/v8/V8ValueCache.h
index ca51342075f7850754d13b27aa161cd2e7c334fe..3bc2e00a289657813f6d9724aad46ce8651f8fc3 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ValueCache.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ValueCache.h
@@ -28,7 +28,6 @@
#include "bindings/core/v8/V8GlobalValueMap.h"
#include "core/CoreExport.h"
-#include "platform/text/CompressibleString.h"
#include "wtf/Allocator.h"
#include "wtf/HashMap.h"
#include "wtf/Noncopyable.h"
@@ -65,41 +64,12 @@ public:
static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType>&);
};
-class CompressibleStringCacheMapTraits : public V8GlobalValueMapTraits<CompressibleStringImpl*, v8::String, v8::kWeakWithParameter> {
- STATIC_ONLY(CompressibleStringCacheMapTraits);
-public:
- // Weak traits:
- typedef CompressibleStringImpl WeakCallbackDataType;
- typedef v8::GlobalValueMap<CompressibleStringImpl*, v8::String, CompressibleStringCacheMapTraits> MapType;
-
- static WeakCallbackDataType* WeakCallbackParameter(
- MapType* map, CompressibleStringImpl* key, v8::Local<v8::String>& value) { return key; }
- static void DisposeCallbackData(WeakCallbackDataType* callbackData) { }
-
- static MapType* MapFromWeakCallbackInfo(
- const v8::WeakCallbackInfo<WeakCallbackDataType>&);
-
- static CompressibleStringImpl* KeyFromWeakCallbackInfo(
- const v8::WeakCallbackInfo<WeakCallbackDataType>& data)
- {
- return data.GetParameter();
- }
-
- static void OnWeakCallback(const v8::WeakCallbackInfo<WeakCallbackDataType>&);
-
- static void Dispose(v8::Isolate*, v8::Global<v8::String> value, CompressibleStringImpl* key);
- static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType>&);
-};
class CORE_EXPORT StringCache {
USING_FAST_MALLOC(StringCache);
WTF_MAKE_NONCOPYABLE(StringCache);
public:
- explicit StringCache(v8::Isolate* isolate)
- : m_stringCache(isolate)
- , m_compressibleStringCache(isolate)
- {
- }
+ explicit StringCache(v8::Isolate* isolate) : m_stringCache(isolate) { }
v8::Local<v8::String> v8ExternalString(v8::Isolate* isolate, StringImpl* stringImpl)
{
@@ -109,13 +79,6 @@ public:
return v8ExternalStringSlow(isolate, stringImpl);
}
- v8::Local<v8::String> v8ExternalString(v8::Isolate* isolate, const CompressibleString& string)
- {
- // Note that the last CompressibleString is not cached.
- ASSERT(!string.isNull());
- return v8ExternalStringSlow(isolate, string);
- }
-
void setReturnValueFromString(v8::ReturnValue<v8::Value> returnValue, StringImpl* stringImpl)
{
ASSERT(stringImpl);
@@ -128,21 +91,16 @@ public:
void dispose();
friend class StringCacheMapTraits;
- friend class CompressibleStringCacheMapTraits;
private:
v8::Local<v8::String> v8ExternalStringSlow(v8::Isolate*, StringImpl*);
- v8::Local<v8::String> v8ExternalStringSlow(v8::Isolate*, const CompressibleString&);
void setReturnValueFromStringSlow(v8::ReturnValue<v8::Value>, StringImpl*);
v8::Local<v8::String> createStringAndInsertIntoCache(v8::Isolate*, StringImpl*);
- v8::Local<v8::String> createStringAndInsertIntoCache(v8::Isolate*, const CompressibleString&);
void InvalidateLastString();
StringCacheMapTraits::MapType m_stringCache;
StringCacheMapTraits::MapType::PersistentValueReference m_lastV8String;
- CompressibleStringCacheMapTraits::MapType m_compressibleStringCache;
-
// Note: RefPtr is a must as we cache by StringImpl* equality, not identity
// hence lastStringImpl might be not a key of the cache (in sense of identity)
// and hence it's not refed on addition.

Powered by Google App Engine
This is Rietveld 408576698