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

Unified Diff: third_party/WebKit/Source/platform/bindings/V8ValueCache.h

Issue 2851563004: Add documentation for platform/bindings (Closed)
Patch Set: Address code review Created 3 years, 8 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/platform/bindings/V8ValueCache.h
diff --git a/third_party/WebKit/Source/platform/bindings/V8ValueCache.h b/third_party/WebKit/Source/platform/bindings/V8ValueCache.h
index f34d4b0ef4f2559471daac8fb146637fc0404e14..9bf17e93b5bb9f98e82e865f31607272c0acc98f 100644
--- a/third_party/WebKit/Source/platform/bindings/V8ValueCache.h
+++ b/third_party/WebKit/Source/platform/bindings/V8ValueCache.h
@@ -74,6 +74,11 @@ class StringCacheMapTraits
static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType>&);
};
+// String cache helps convert WTF strings (StringImpl*) into v8 strings by
+// only creating a v8::String for a particular StringImpl* once and caching it
+// for future use. It is held by and can be retrieved from V8PerIsolateData, and
+// is cleared when the isolate is destroyed. Entries are removed from the
+// backing global value map when weak references to the values are collected.
class PLATFORM_EXPORT StringCache {
USING_FAST_MALLOC(StringCache);
WTF_MAKE_NONCOPYABLE(StringCache);

Powered by Google App Engine
This is Rietveld 408576698