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

Unified Diff: Source/web/WebKit.cpp

Issue 657113006: Add retry logic to partition alloc (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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/wtf/PartitionAlloc.h » ('j') | Source/wtf/PartitionAlloc.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebKit.cpp
diff --git a/Source/web/WebKit.cpp b/Source/web/WebKit.cpp
index a6d8754f039f03651bf6d9c7c4ae1cc86cba318e..bc93ccb6aa27231197d420c666ae3c6c054d2260 100644
--- a/Source/web/WebKit.cpp
+++ b/Source/web/WebKit.cpp
@@ -82,6 +82,13 @@ public:
}
};
+void partitionAlmostFullHandler()
+{
+ v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ if (isolate)
+ isolate->LowMemoryNotification();
+}
+
} // namespace
static WebThread::TaskObserver* s_endOfTaskRunner = 0;
@@ -109,6 +116,8 @@ void initialize(Platform* platform)
s_endOfTaskRunner = new EndOfTaskRunner;
currentThread->addTaskObserver(s_endOfTaskRunner);
}
+
+ partitionSetFreeUpMemoryCallback(partitionAlmostFullHandler);
}
v8::Isolate* mainThreadIsolate()
@@ -205,6 +214,8 @@ void shutdown()
s_messageLoopInterruptor = 0;
}
+ partitionSetFreeUpMemoryCallback(nullptr);
+
v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate();
V8PerIsolateData::willBeDestroyed(isolate);
« no previous file with comments | « no previous file | Source/wtf/PartitionAlloc.h » ('j') | Source/wtf/PartitionAlloc.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698