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

Side by Side Diff: third_party/WebKit/Source/core/frame/DOMWindow.cpp

Issue 2687903002: Track constant InputDeviceCapabilities objects per-window. (Closed)
Patch Set: Created 3 years, 10 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 <memory>
7 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
8 #include "core/dom/ExceptionCode.h" 9 #include "core/dom/ExceptionCode.h"
9 #include "core/dom/ExecutionContext.h" 10 #include "core/dom/ExecutionContext.h"
10 #include "core/dom/SecurityContext.h" 11 #include "core/dom/SecurityContext.h"
11 #include "core/events/MessageEvent.h" 12 #include "core/events/MessageEvent.h"
12 #include "core/frame/External.h" 13 #include "core/frame/External.h"
13 #include "core/frame/Frame.h" 14 #include "core/frame/Frame.h"
14 #include "core/frame/FrameClient.h" 15 #include "core/frame/FrameClient.h"
15 #include "core/frame/FrameConsole.h" 16 #include "core/frame/FrameConsole.h"
16 #include "core/frame/LocalDOMWindow.h" 17 #include "core/frame/LocalDOMWindow.h"
17 #include "core/frame/Location.h" 18 #include "core/frame/Location.h"
18 #include "core/frame/RemoteDOMWindow.h" 19 #include "core/frame/RemoteDOMWindow.h"
19 #include "core/frame/RemoteFrame.h" 20 #include "core/frame/RemoteFrame.h"
20 #include "core/frame/Settings.h" 21 #include "core/frame/Settings.h"
21 #include "core/frame/UseCounter.h" 22 #include "core/frame/UseCounter.h"
22 #include "core/input/EventHandler.h" 23 #include "core/input/EventHandler.h"
24 #include "core/input/InputDeviceCapabilities.h"
23 #include "core/inspector/ConsoleMessage.h" 25 #include "core/inspector/ConsoleMessage.h"
24 #include "core/inspector/InspectorInstrumentation.h" 26 #include "core/inspector/InspectorInstrumentation.h"
25 #include "core/loader/FrameLoaderClient.h" 27 #include "core/loader/FrameLoaderClient.h"
26 #include "core/loader/MixedContentChecker.h" 28 #include "core/loader/MixedContentChecker.h"
27 #include "core/page/ChromeClient.h" 29 #include "core/page/ChromeClient.h"
28 #include "core/page/FocusController.h" 30 #include "core/page/FocusController.h"
29 #include "core/page/Page.h" 31 #include "core/page/Page.h"
30 #include "platform/weborigin/KURL.h" 32 #include "platform/weborigin/KURL.h"
31 #include "platform/weborigin/SecurityOrigin.h" 33 #include "platform/weborigin/SecurityOrigin.h"
32 #include "platform/weborigin/Suborigin.h" 34 #include "platform/weborigin/Suborigin.h"
33 #include <memory>
34 35
35 namespace blink { 36 namespace blink {
36 37
37 DOMWindow::DOMWindow(Frame& frame) : m_frame(frame), m_windowIsClosing(false) {} 38 DOMWindow::DOMWindow(Frame& frame) : m_frame(frame), m_windowIsClosing(false) {}
38 39
39 DOMWindow::~DOMWindow() { 40 DOMWindow::~DOMWindow() {
40 // The frame must be disconnected before finalization. 41 // The frame must be disconnected before finalization.
41 DCHECK(!m_frame); 42 DCHECK(!m_frame);
42 } 43 }
43 44
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 (toDocument(context)->domWindow() == opener()); 431 (toDocument(context)->domWindow() == opener());
431 } 432 }
432 433
433 // If we're a top level window, bring the window to the front. 434 // If we're a top level window, bring the window to the front.
434 if (frame()->isMainFrame() && allowFocus) 435 if (frame()->isMainFrame() && allowFocus)
435 page->chromeClient().focus(); 436 page->chromeClient().focus();
436 437
437 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */); 438 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */);
438 } 439 }
439 440
441 InputDeviceCapabilitiesConstants* DOMWindow::getInputDeviceCapabilities() {
442 if (!m_inputCapabilities)
443 m_inputCapabilities = new InputDeviceCapabilitiesConstants;
444 return m_inputCapabilities;
445 }
446
440 DEFINE_TRACE(DOMWindow) { 447 DEFINE_TRACE(DOMWindow) {
441 visitor->trace(m_frame); 448 visitor->trace(m_frame);
449 visitor->trace(m_inputCapabilities);
442 visitor->trace(m_location); 450 visitor->trace(m_location);
443 visitor->trace(m_external); 451 visitor->trace(m_external);
444 EventTargetWithInlineData::trace(visitor); 452 EventTargetWithInlineData::trace(visitor);
445 } 453 }
446 454
447 } // namespace blink 455 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMWindow.h ('k') | third_party/WebKit/Source/core/html/HTMLSelectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698