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

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

Issue 2626403002: Move Frame pointer to be held by DOMWindow base class. (Closed)
Patch Set: . Created 3 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 "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/ExceptionCode.h" 8 #include "core/dom/ExceptionCode.h"
9 #include "core/dom/ExecutionContext.h" 9 #include "core/dom/ExecutionContext.h"
10 #include "core/dom/SecurityContext.h" 10 #include "core/dom/SecurityContext.h"
(...skipping 16 matching lines...) Expand all
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/weborigin/KURL.h" 30 #include "platform/weborigin/KURL.h"
31 #include "platform/weborigin/SecurityOrigin.h" 31 #include "platform/weborigin/SecurityOrigin.h"
32 #include "platform/weborigin/Suborigin.h" 32 #include "platform/weborigin/Suborigin.h"
33 #include <memory> 33 #include <memory>
34 34
35 namespace blink { 35 namespace blink {
36 36
37 DOMWindow::DOMWindow() : m_windowIsClosing(false) {} 37 DOMWindow::DOMWindow(Frame& frame) : m_frame(frame), m_windowIsClosing(false) {}
38 38
39 DOMWindow::~DOMWindow() {} 39 DOMWindow::~DOMWindow() {
40 // The frame must be disconnected before finalization.
41 DCHECK(!m_frame);
42 }
40 43
41 v8::Local<v8::Object> DOMWindow::wrap(v8::Isolate*, 44 v8::Local<v8::Object> DOMWindow::wrap(v8::Isolate*,
42 v8::Local<v8::Object> creationContext) { 45 v8::Local<v8::Object> creationContext) {
43 LOG(FATAL) << "DOMWindow must never be wrapped with wrap method. The " 46 LOG(FATAL) << "DOMWindow must never be wrapped with wrap method. The "
44 "wrappers must be created at WindowProxy::createContext() and " 47 "wrappers must be created at WindowProxy::createContext() and "
45 "setupWindowPrototypeChain()."; 48 "setupWindowPrototypeChain().";
46 return v8::Local<v8::Object>(); 49 return v8::Local<v8::Object>();
47 } 50 }
48 51
49 v8::Local<v8::Object> DOMWindow::associateWithWrapper( 52 v8::Local<v8::Object> DOMWindow::associateWithWrapper(
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 } 428 }
426 429
427 // If we're a top level window, bring the window to the front. 430 // If we're a top level window, bring the window to the front.
428 if (frame()->isMainFrame() && allowFocus) 431 if (frame()->isMainFrame() && allowFocus)
429 page->chromeClient().focus(); 432 page->chromeClient().focus();
430 433
431 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */); 434 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */);
432 } 435 }
433 436
434 DEFINE_TRACE(DOMWindow) { 437 DEFINE_TRACE(DOMWindow) {
438 visitor->trace(m_frame);
435 visitor->trace(m_location); 439 visitor->trace(m_location);
436 EventTargetWithInlineData::trace(visitor); 440 EventTargetWithInlineData::trace(visitor);
437 } 441 }
438 442
439 } // namespace blink 443 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698