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

Unified Diff: Source/core/dom/Text.cpp

Issue 1085023002: patch from issue 1063083002 at patchset 20001 (http://crrev.com/1063083002#ps20001) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | Source/platform/heap/Heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Text.cpp
diff --git a/Source/core/dom/Text.cpp b/Source/core/dom/Text.cpp
index d48c27e8cd5c3a82c78f874b84b63c0c2e0b9177..75c7e9b84acc865595d502dbc42f1f78f1e6f028 100644
--- a/Source/core/dom/Text.cpp
+++ b/Source/core/dom/Text.cpp
@@ -42,48 +42,13 @@
namespace blink {
-#if ENABLE(OILPAN)
-namespace {
-// If the external string kept by a Text node exceed this threshold length,
-// Oilpan is informed. External allocation amounts owned by heap objects are
-// taken into account when scheduling urgent Oilpan GCs.
-//
-// FIXME: having only Text nodes with strings above an ad-hoc local threshold
-// influence Oilpan's GC behavior isn't a satisfactory long-term solution.
-// But code that allocates a lot of Text nodes in tight loops, and not much more,
-// we do have to trigger Oilpan GCs to avoid PartitionAlloc OOMs. The accounting
-// does add overhead on the allocation of every Text node however, so for now, only
-// register those above the given threshold. TBC.
-const size_t stringLengthThreshold = 256;
-
-void increaseExternallyAllocatedBytesIfNeeded(size_t length)
-{
- if (length > stringLengthThreshold)
- Heap::increaseExternallyAllocatedBytes(length);
-}
-
-void increaseExternallyAllocatedBytesAliveIfNeeded(size_t length)
-{
- if (length > stringLengthThreshold)
- Heap::increaseExternallyAllocatedBytesAlive(length);
-}
-
-} // namespace
-#endif
-
PassRefPtrWillBeRawPtr<Text> Text::create(Document& document, const String& data)
{
-#if ENABLE(OILPAN)
- increaseExternallyAllocatedBytesIfNeeded(data.length());
-#endif
return adoptRefWillBeNoop(new Text(document, data, CreateText));
}
PassRefPtrWillBeRawPtr<Text> Text::createEditingText(Document& document, const String& data)
{
-#if ENABLE(OILPAN)
- increaseExternallyAllocatedBytesIfNeeded(data.length());
-#endif
return adoptRefWillBeNoop(new Text(document, data, CreateEditingText));
}
@@ -445,9 +410,6 @@ PassRefPtrWillBeRawPtr<Text> Text::cloneWithData(const String& data)
DEFINE_TRACE(Text)
{
-#if ENABLE(OILPAN)
- increaseExternallyAllocatedBytesAliveIfNeeded(m_data.length());
-#endif
CharacterData::trace(visitor);
}
« no previous file with comments | « no previous file | Source/platform/heap/Heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698