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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/frame/DOMWindow.h" 5 #include "core/frame/DOMWindow.h"
6 6
7 #include "bindings/core/v8/ScriptCallStackFactory.h" 7 #include "bindings/core/v8/ScriptCallStackFactory.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/ExceptionCode.h" 9 #include "core/dom/ExceptionCode.h"
10 #include "core/dom/ExecutionContext.h" 10 #include "core/dom/ExecutionContext.h"
11 #include "core/dom/SecurityContext.h" 11 #include "core/dom/SecurityContext.h"
12 #include "core/events/MessageEvent.h" 12 #include "core/events/MessageEvent.h"
13 #include "core/frame/Frame.h" 13 #include "core/frame/Frame.h"
14 #include "core/frame/FrameClient.h" 14 #include "core/frame/FrameClient.h"
15 #include "core/frame/FrameConsole.h" 15 #include "core/frame/FrameConsole.h"
16 #include "core/frame/LocalDOMWindow.h" 16 #include "core/frame/LocalDOMWindow.h"
17 #include "core/frame/Location.h" 17 #include "core/frame/Location.h"
18 #include "core/frame/RemoteFrame.h" 18 #include "core/frame/RemoteFrame.h"
19 #include "core/frame/Settings.h" 19 #include "core/frame/Settings.h"
20 #include "core/frame/UseCounter.h" 20 #include "core/frame/UseCounter.h"
21 #include "core/input/EventHandler.h" 21 #include "core/input/EventHandler.h"
22 #include "core/inspector/ConsoleMessageStorage.h" 22 #include "core/inspector/ConsoleMessageStorage.h"
23 #include "core/inspector/InspectorInstrumentation.h" 23 #include "core/inspector/InspectorInstrumentation.h"
24 #include "core/inspector/ScriptCallStack.h" 24 #include "core/inspector/ScriptCallStack.h"
25 #include "core/loader/FrameLoaderClient.h" 25 #include "core/loader/FrameLoaderClient.h"
26 #include "core/loader/MixedContentChecker.h" 26 #include "core/loader/MixedContentChecker.h"
27 #include "core/page/ChromeClient.h" 27 #include "core/page/ChromeClient.h"
28 #include "core/page/FocusController.h" 28 #include "core/page/FocusController.h"
29 #include "core/page/Page.h" 29 #include "core/page/Page.h"
30 #include "platform/MemoryPurgeController.h"
30 #include "platform/weborigin/KURL.h" 31 #include "platform/weborigin/KURL.h"
31 #include "platform/weborigin/SecurityOrigin.h" 32 #include "platform/weborigin/SecurityOrigin.h"
32 33
33 namespace blink { 34 namespace blink {
34 35
35 DOMWindow::DOMWindow() 36 DOMWindow::DOMWindow()
36 : m_windowIsClosing(false) 37 : m_windowIsClosing(false)
37 { 38 {
38 } 39 }
39 40
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 allowFocus = opener() && (opener() != this) && (toDocument(context)->dom Window() == opener()); 362 allowFocus = opener() && (opener() != this) && (toDocument(context)->dom Window() == opener());
362 } 363 }
363 364
364 // If we're a top level window, bring the window to the front. 365 // If we're a top level window, bring the window to the front.
365 if (frame()->isMainFrame() && allowFocus) 366 if (frame()->isMainFrame() && allowFocus)
366 page->chromeClient().focus(); 367 page->chromeClient().focus();
367 368
368 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */ ); 369 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */ );
369 } 370 }
370 371
372 void DOMWindow::purgeMemory(ExceptionState& exceptionState)
373 {
374 Document* currentDocument = document();
375 if (!currentDocument || !currentDocument->page()) {
376 exceptionState.throwDOMException(InvalidAccessError, currentDocument ? " The document's page cannot be retrieved." : "No context document can be obtained .");
377 return;
378 }
379 MemoryPurgeController& controller = currentDocument->page()->memoryPurgeCont roller();
380 controller.purgeMemory();
381 }
382
371 DEFINE_TRACE(DOMWindow) 383 DEFINE_TRACE(DOMWindow)
372 { 384 {
373 visitor->trace(m_location); 385 visitor->trace(m_location);
374 EventTargetWithInlineData::trace(visitor); 386 EventTargetWithInlineData::trace(visitor);
375 } 387 }
376 388
377 } // namespace blink 389 } // namespace blink
OLDNEW
« 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