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

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

Issue 153813002: Support "await a stable state" and "provide a stable state" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: assert more Created 6 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 #include "core/frame/Frame.h" 63 #include "core/frame/Frame.h"
64 #include "core/frame/FrameHost.h" 64 #include "core/frame/FrameHost.h"
65 #include "core/frame/FrameView.h" 65 #include "core/frame/FrameView.h"
66 #include "core/frame/History.h" 66 #include "core/frame/History.h"
67 #include "core/frame/Location.h" 67 #include "core/frame/Location.h"
68 #include "core/frame/Navigator.h" 68 #include "core/frame/Navigator.h"
69 #include "core/frame/PageConsole.h" 69 #include "core/frame/PageConsole.h"
70 #include "core/frame/Screen.h" 70 #include "core/frame/Screen.h"
71 #include "core/frame/Settings.h" 71 #include "core/frame/Settings.h"
72 #include "core/html/HTMLFrameOwnerElement.h" 72 #include "core/html/HTMLFrameOwnerElement.h"
73 #include "core/html/StableState.h"
73 #include "core/inspector/InspectorInstrumentation.h" 74 #include "core/inspector/InspectorInstrumentation.h"
74 #include "core/inspector/ScriptCallStack.h" 75 #include "core/inspector/ScriptCallStack.h"
75 #include "core/loader/DocumentLoader.h" 76 #include "core/loader/DocumentLoader.h"
76 #include "core/loader/FrameLoadRequest.h" 77 #include "core/loader/FrameLoadRequest.h"
77 #include "core/loader/FrameLoader.h" 78 #include "core/loader/FrameLoader.h"
78 #include "core/loader/FrameLoaderClient.h" 79 #include "core/loader/FrameLoaderClient.h"
79 #include "core/loader/SinkDocument.h" 80 #include "core/loader/SinkDocument.h"
80 #include "core/loader/appcache/ApplicationCache.h" 81 #include "core/loader/appcache/ApplicationCache.h"
81 #include "core/page/BackForwardClient.h" 82 #include "core/page/BackForwardClient.h"
82 #include "core/page/Chrome.h" 83 #include "core/page/Chrome.h"
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 1006
1006 FrameHost* host = m_frame->host(); 1007 FrameHost* host = m_frame->host();
1007 if (!host) 1008 if (!host)
1008 return; 1009 return;
1009 1010
1010 if (m_frame->loader().documentLoader()->isLoading()) { 1011 if (m_frame->loader().documentLoader()->isLoading()) {
1011 m_shouldPrintWhenFinishedLoading = true; 1012 m_shouldPrintWhenFinishedLoading = true;
1012 return; 1013 return;
1013 } 1014 }
1014 m_shouldPrintWhenFinishedLoading = false; 1015 m_shouldPrintWhenFinishedLoading = false;
1016
1017 // http://whatwg.org/html#pause
1018 StableState::provide();
1019
1015 host->chrome().print(m_frame); 1020 host->chrome().print(m_frame);
1016 } 1021 }
1017 1022
1018 void DOMWindow::stop() 1023 void DOMWindow::stop()
1019 { 1024 {
1020 if (!m_frame) 1025 if (!m_frame)
1021 return; 1026 return;
1022 m_frame->loader().stopAllLoaders(); 1027 m_frame->loader().stopAllLoaders();
1023 } 1028 }
1024 1029
1025 void DOMWindow::alert(const String& message) 1030 void DOMWindow::alert(const String& message)
1026 { 1031 {
1027 if (!m_frame) 1032 if (!m_frame)
1028 return; 1033 return;
1029 1034
1030 m_frame->document()->updateStyleIfNeeded(); 1035 m_frame->document()->updateStyleIfNeeded();
1031 1036
1032 FrameHost* host = m_frame->host(); 1037 FrameHost* host = m_frame->host();
1033 if (!host) 1038 if (!host)
1034 return; 1039 return;
1035 1040
1041 // http://whatwg.org/html#pause
1042 StableState::provide();
acolwell GONE FROM CHROMIUM 2014/02/10 22:36:05 nit: You should probably find a good home for the
philipj_slow 2014/02/11 17:25:21 Yeah, I started looking for a place and a name but
1043
1036 host->chrome().runJavaScriptAlert(m_frame, message); 1044 host->chrome().runJavaScriptAlert(m_frame, message);
1037 } 1045 }
1038 1046
1039 bool DOMWindow::confirm(const String& message) 1047 bool DOMWindow::confirm(const String& message)
1040 { 1048 {
1041 if (!m_frame) 1049 if (!m_frame)
1042 return false; 1050 return false;
1043 1051
1044 m_frame->document()->updateStyleIfNeeded(); 1052 m_frame->document()->updateStyleIfNeeded();
1045 1053
1046 FrameHost* host = m_frame->host(); 1054 FrameHost* host = m_frame->host();
1047 if (!host) 1055 if (!host)
1048 return false; 1056 return false;
1049 1057
1058 // http://whatwg.org/html#pause
1059 StableState::provide();
1060
1050 return host->chrome().runJavaScriptConfirm(m_frame, message); 1061 return host->chrome().runJavaScriptConfirm(m_frame, message);
1051 } 1062 }
1052 1063
1053 String DOMWindow::prompt(const String& message, const String& defaultValue) 1064 String DOMWindow::prompt(const String& message, const String& defaultValue)
1054 { 1065 {
1055 if (!m_frame) 1066 if (!m_frame)
1056 return String(); 1067 return String();
1057 1068
1058 m_frame->document()->updateStyleIfNeeded(); 1069 m_frame->document()->updateStyleIfNeeded();
1059 1070
1060 FrameHost* host = m_frame->host(); 1071 FrameHost* host = m_frame->host();
1061 if (!host) 1072 if (!host)
1062 return String(); 1073 return String();
1063 1074
1075 // http://whatwg.org/html#pause
1076 StableState::provide();
1077
1064 String returnValue; 1078 String returnValue;
1065 if (host->chrome().runJavaScriptPrompt(m_frame, message, defaultValue, retur nValue)) 1079 if (host->chrome().runJavaScriptPrompt(m_frame, message, defaultValue, retur nValue))
1066 return returnValue; 1080 return returnValue;
1067 1081
1068 return String(); 1082 return String();
1069 } 1083 }
1070 1084
1071 bool DOMWindow::find(const String& string, bool caseSensitive, bool backwards, b ool wrap, bool /*wholeWord*/, bool /*searchInFrames*/, bool /*showDialog*/) cons t 1085 bool DOMWindow::find(const String& string, bool caseSensitive, bool backwards, b ool wrap, bool /*wholeWord*/, bool /*searchInFrames*/, bool /*showDialog*/) cons t
1072 { 1086 {
1073 if (!isCurrentlyDisplayedInFrame()) 1087 if (!isCurrentlyDisplayedInFrame())
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
1890 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<DOMWindow>: :lifecycleNotifier()); 1904 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<DOMWindow>: :lifecycleNotifier());
1891 } 1905 }
1892 1906
1893 PassOwnPtr<LifecycleNotifier<DOMWindow> > DOMWindow::createLifecycleNotifier() 1907 PassOwnPtr<LifecycleNotifier<DOMWindow> > DOMWindow::createLifecycleNotifier()
1894 { 1908 {
1895 return DOMWindowLifecycleNotifier::create(this); 1909 return DOMWindowLifecycleNotifier::create(this);
1896 } 1910 }
1897 1911
1898 1912
1899 } // namespace WebCore 1913 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698