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

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

Issue 879423003: Move Location to DOMWindow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: resetLocation call to Frame::detach Created 5 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 | Annotate | Revision Log
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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 m_history = nullptr; 636 m_history = nullptr;
637 m_locationbar = nullptr; 637 m_locationbar = nullptr;
638 m_menubar = nullptr; 638 m_menubar = nullptr;
639 m_personalbar = nullptr; 639 m_personalbar = nullptr;
640 m_scrollbars = nullptr; 640 m_scrollbars = nullptr;
641 m_statusbar = nullptr; 641 m_statusbar = nullptr;
642 m_toolbar = nullptr; 642 m_toolbar = nullptr;
643 m_console = nullptr; 643 m_console = nullptr;
644 m_navigator = nullptr; 644 m_navigator = nullptr;
645 m_performance = nullptr; 645 m_performance = nullptr;
646 m_location = nullptr;
647 m_media = nullptr; 646 m_media = nullptr;
648 m_applicationCache = nullptr; 647 m_applicationCache = nullptr;
649 #if ENABLE(ASSERT) 648 #if ENABLE(ASSERT)
650 m_hasBeenReset = true; 649 m_hasBeenReset = true;
651 #endif 650 #endif
652 651
652 resetLocation();
dcheng 2015/02/10 23:02:18 Is it still necessary to call this here? Is this b
Nate Chapin 2015/02/10 23:30:18 This is also called at commit time. Documents shou
dcheng 2015/02/11 00:16:13 IIRC, this is called at commit-time on the old DOM
653
653 LocalDOMWindow::notifyContextDestroyed(); 654 LocalDOMWindow::notifyContextDestroyed();
654 } 655 }
655 656
656 void LocalDOMWindow::sendOrientationChangeEvent() 657 void LocalDOMWindow::sendOrientationChangeEvent()
657 { 658 {
658 ASSERT(RuntimeEnabledFeatures::orientationEventEnabled()); 659 ASSERT(RuntimeEnabledFeatures::orientationEventEnabled());
659 660
660 // Before dispatching the event, build a list of the child frames to 661 // Before dispatching the event, build a list of the child frames to
661 // also send the event to, to mitigate side effects from event handlers 662 // also send the event to, to mitigate side effects from event handlers
662 // potentially interfering with others. 663 // potentially interfering with others.
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 return m_navigator.get(); 777 return m_navigator.get();
777 } 778 }
778 779
779 Performance* LocalDOMWindow::performance() const 780 Performance* LocalDOMWindow::performance() const
780 { 781 {
781 if (!m_performance) 782 if (!m_performance)
782 m_performance = Performance::create(frame()); 783 m_performance = Performance::create(frame());
783 return m_performance.get(); 784 return m_performance.get();
784 } 785 }
785 786
786 Location* LocalDOMWindow::location() const
787 {
788 if (!m_location)
789 m_location = Location::create(frame());
790 return m_location.get();
791 }
792
793 void LocalDOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, cons t MessagePortArray* ports, const String& targetOrigin, LocalDOMWindow* source, E xceptionState& exceptionState) 787 void LocalDOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, cons t MessagePortArray* ports, const String& targetOrigin, LocalDOMWindow* source, E xceptionState& exceptionState)
794 { 788 {
795 if (!isCurrentlyDisplayedInFrame()) 789 if (!isCurrentlyDisplayedInFrame())
796 return; 790 return;
797 791
798 Document* sourceDocument = source->document(); 792 Document* sourceDocument = source->document();
799 793
800 // Compute the target origin. We need to do this synchronously in order 794 // Compute the target origin. We need to do this synchronously in order
801 // to generate the SyntaxError exception correctly. 795 // to generate the SyntaxError exception correctly.
802 RefPtr<SecurityOrigin> target; 796 RefPtr<SecurityOrigin> target;
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1825 visitor->trace(m_screen); 1819 visitor->trace(m_screen);
1826 visitor->trace(m_history); 1820 visitor->trace(m_history);
1827 visitor->trace(m_locationbar); 1821 visitor->trace(m_locationbar);
1828 visitor->trace(m_menubar); 1822 visitor->trace(m_menubar);
1829 visitor->trace(m_personalbar); 1823 visitor->trace(m_personalbar);
1830 visitor->trace(m_scrollbars); 1824 visitor->trace(m_scrollbars);
1831 visitor->trace(m_statusbar); 1825 visitor->trace(m_statusbar);
1832 visitor->trace(m_toolbar); 1826 visitor->trace(m_toolbar);
1833 visitor->trace(m_console); 1827 visitor->trace(m_console);
1834 visitor->trace(m_navigator); 1828 visitor->trace(m_navigator);
1835 visitor->trace(m_location);
1836 visitor->trace(m_media); 1829 visitor->trace(m_media);
1837 visitor->trace(m_applicationCache); 1830 visitor->trace(m_applicationCache);
1838 visitor->trace(m_performance); 1831 visitor->trace(m_performance);
1839 visitor->trace(m_css); 1832 visitor->trace(m_css);
1840 visitor->trace(m_eventQueue); 1833 visitor->trace(m_eventQueue);
1841 visitor->trace(m_postMessageTimers); 1834 visitor->trace(m_postMessageTimers);
1842 HeapSupplementable<LocalDOMWindow>::trace(visitor); 1835 HeapSupplementable<LocalDOMWindow>::trace(visitor);
1843 #endif 1836 #endif
1844 DOMWindow::trace(visitor); 1837 DOMWindow::trace(visitor);
1845 LifecycleContext<LocalDOMWindow>::trace(visitor); 1838 LifecycleContext<LocalDOMWindow>::trace(visitor);
1846 } 1839 }
1847 1840
1848 LocalFrame* LocalDOMWindow::frame() const 1841 LocalFrame* LocalDOMWindow::frame() const
1849 { 1842 {
1850 return m_frameObserver->frame(); 1843 return m_frameObserver->frame();
1851 } 1844 }
1852 1845
1853 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte xt, v8::Isolate* isolate) 1846 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte xt, v8::Isolate* isolate)
1854 { 1847 {
1855 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8]. 1848 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8].
1856 return v8::Handle<v8::Object>(); 1849 return v8::Handle<v8::Object>();
1857 } 1850 }
1858 1851
1859 } // namespace blink 1852 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698