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

Unified Diff: third_party/WebKit/Source/core/frame/DOMWindow.cpp

Issue 1389383003: WIP: Introduce CompressibleString Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase onto crrev.com/1564773002 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMWindow.h ('k') | third_party/WebKit/Source/core/frame/Window.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/DOMWindow.cpp
diff --git a/third_party/WebKit/Source/core/frame/DOMWindow.cpp b/third_party/WebKit/Source/core/frame/DOMWindow.cpp
index 2a86da71d221ddebc047a2fb71340e0eb8a77c9a..2a0e23ea67619ac8d1591be3fcb10f02c1d9f879 100644
--- a/third_party/WebKit/Source/core/frame/DOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/DOMWindow.cpp
@@ -27,6 +27,7 @@
#include "core/page/ChromeClient.h"
#include "core/page/FocusController.h"
#include "core/page/Page.h"
+#include "platform/MemoryPurgeController.h"
#include "platform/weborigin/KURL.h"
#include "platform/weborigin/SecurityOrigin.h"
@@ -368,6 +369,17 @@ void DOMWindow::focus(ExecutionContext* context)
page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */);
}
+void DOMWindow::purgeMemory(ExceptionState& exceptionState)
+{
+ Document* currentDocument = document();
+ if (!currentDocument || !currentDocument->page()) {
+ exceptionState.throwDOMException(InvalidAccessError, currentDocument ? "The document's page cannot be retrieved." : "No context document can be obtained.");
+ return;
+ }
+ MemoryPurgeController& controller = currentDocument->page()->memoryPurgeController();
+ controller.purgeMemory();
+}
+
DEFINE_TRACE(DOMWindow)
{
visitor->trace(m_location);
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMWindow.h ('k') | third_party/WebKit/Source/core/frame/Window.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698