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

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

Issue 1053073002: Improve window.closed fidelity. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 5 years, 8 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 /* 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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 frameConsole()->addMessage(ConsoleMessage::create(JSMessageSource, Warni ngMessageLevel, "Scripts may close only the windows that were opened by it.")); 810 frameConsole()->addMessage(ConsoleMessage::create(JSMessageSource, Warni ngMessageLevel, "Scripts may close only the windows that were opened by it."));
811 return; 811 return;
812 } 812 }
813 813
814 if (!frame()->loader().shouldClose()) 814 if (!frame()->loader().shouldClose())
815 return; 815 return;
816 816
817 InspectorInstrumentation::willCloseWindow(context); 817 InspectorInstrumentation::willCloseWindow(context);
818 818
819 page->chrome().closeWindowSoon(); 819 page->chrome().closeWindowSoon();
820 // So as to make window.closed return the expected result
821 // after window.close(), separately record the to-be-closed
822 // state of this window. Scripts may access window.closed
823 // before the deferred close operation has gone ahead.
824 m_windowIsClosing = true;
820 } 825 }
821 826
822 void LocalDOMWindow::print() 827 void LocalDOMWindow::print()
823 { 828 {
824 if (!frame()) 829 if (!frame())
825 return; 830 return;
826 831
827 FrameHost* host = frame()->host(); 832 FrameHost* host = frame()->host();
828 if (!host) 833 if (!host)
829 return; 834 return;
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 return m_frameObserver->frame(); 1664 return m_frameObserver->frame();
1660 } 1665 }
1661 1666
1662 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte xt, v8::Isolate* isolate) 1667 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte xt, v8::Isolate* isolate)
1663 { 1668 {
1664 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8]. 1669 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8].
1665 return v8::Handle<v8::Object>(); 1670 return v8::Handle<v8::Object>();
1666 } 1671 }
1667 1672
1668 } // namespace blink 1673 } // namespace blink
OLDNEW
« Source/core/frame/DOMWindow.cpp ('K') | « Source/core/frame/DOMWindow.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698