| 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 442a2d7d36c649e224618198bd85fa70aa31290f..d37f29fd1b3a8c697a9b03d958e2bab0f5e056f1 100644
|
| --- a/third_party/WebKit/Source/core/frame/DOMWindow.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/DOMWindow.cpp
|
| @@ -25,6 +25,7 @@
|
| #include "core/loader/MixedContentChecker.h"
|
| #include "core/page/ChromeClient.h"
|
| #include "core/page/Page.h"
|
| +#include "platform/MemoryPurgeController.h"
|
| #include "platform/weborigin/KURL.h"
|
| #include "platform/weborigin/SecurityOrigin.h"
|
|
|
| @@ -341,6 +342,17 @@ void DOMWindow::close(ExecutionContext* context)
|
| m_windowIsClosing = true;
|
| }
|
|
|
| +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(MemoryPurgeMode::NotSpecified);
|
| +}
|
| +
|
| DEFINE_TRACE(DOMWindow)
|
| {
|
| visitor->trace(m_location);
|
|
|