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

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

Issue 2562323002: Devirtualize Frame::domWindow(). (Closed)
Patch Set: Created 4 years 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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 // to send the event to, to mitigate side effects from event handlers 525 // to send the event to, to mitigate side effects from event handlers
526 // potentially interfering with others. 526 // potentially interfering with others.
527 HeapVector<Member<Frame>> frames; 527 HeapVector<Member<Frame>> frames;
528 for (Frame* f = frame(); f; f = f->tree().traverseNext()) 528 for (Frame* f = frame(); f; f = f->tree().traverseNext())
529 frames.append(f); 529 frames.append(f);
530 530
531 for (size_t i = 0; i < frames.size(); ++i) { 531 for (size_t i = 0; i < frames.size(); ++i) {
532 if (!frames[i]->isLocalFrame()) 532 if (!frames[i]->isLocalFrame())
533 continue; 533 continue;
534 toLocalFrame(frames[i].get()) 534 toLocalFrame(frames[i].get())
535 ->localDOMWindow() 535 ->domWindow()
536 ->dispatchEvent(Event::create(EventTypeNames::orientationchange)); 536 ->dispatchEvent(Event::create(EventTypeNames::orientationchange));
537 } 537 }
538 } 538 }
539 539
540 int LocalDOMWindow::orientation() const { 540 int LocalDOMWindow::orientation() const {
541 ASSERT(RuntimeEnabledFeatures::orientationEventEnabled()); 541 ASSERT(RuntimeEnabledFeatures::orientationEventEnabled());
542 542
543 if (!frame() || !frame()->host()) 543 if (!frame() || !frame()->host())
544 return 0; 544 return 0;
545 545
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 1567
1568 LocalFrame* LocalDOMWindow::frame() const { 1568 LocalFrame* LocalDOMWindow::frame() const {
1569 // If the LocalDOMWindow still has a frame reference, that frame must point 1569 // If the LocalDOMWindow still has a frame reference, that frame must point
1570 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation 1570 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation
1571 // where script execution leaks between different LocalDOMWindows. 1571 // where script execution leaks between different LocalDOMWindows.
1572 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this); 1572 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this);
1573 return m_frame; 1573 return m_frame;
1574 } 1574 }
1575 1575
1576 } // namespace blink 1576 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698