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

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

Issue 2811863002: Move ScriptState::GetExecutionContext (Part 4) (Closed)
Patch Set: Fix Document.cpp Created 3 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) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 10 matching lines...) Expand all
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "core/frame/History.h" 26 #include "core/frame/History.h"
27 27
28 #include "bindings/core/v8/ExceptionState.h" 28 #include "bindings/core/v8/ExceptionState.h"
29 #include "bindings/core/v8/ScriptState.h" 29 #include "bindings/core/v8/ScriptState.h"
30 #include "core/dom/Document.h" 30 #include "core/dom/Document.h"
31 #include "core/dom/ExecutionContext.h"
31 #include "core/frame/LocalFrame.h" 32 #include "core/frame/LocalFrame.h"
32 #include "core/frame/LocalFrameClient.h" 33 #include "core/frame/LocalFrameClient.h"
33 #include "core/loader/DocumentLoader.h" 34 #include "core/loader/DocumentLoader.h"
34 #include "core/loader/FrameLoader.h" 35 #include "core/loader/FrameLoader.h"
35 #include "core/loader/HistoryItem.h" 36 #include "core/loader/HistoryItem.h"
36 #include "core/loader/NavigationScheduler.h" 37 #include "core/loader/NavigationScheduler.h"
37 #include "core/page/Page.h" 38 #include "core/page/Page.h"
38 #include "platform/weborigin/KURL.h" 39 #include "platform/weborigin/KURL.h"
39 #include "platform/weborigin/SecurityOrigin.h" 40 #include "platform/weborigin/SecurityOrigin.h"
40 #include "wtf/text/StringView.h" 41 #include "wtf/text/StringView.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 130
130 void History::forward(ScriptState* script_state) { 131 void History::forward(ScriptState* script_state) {
131 go(script_state, 1); 132 go(script_state, 1);
132 } 133 }
133 134
134 void History::go(ScriptState* script_state, int delta) { 135 void History::go(ScriptState* script_state, int delta) {
135 if (!GetFrame() || !GetFrame()->Loader().Client()) 136 if (!GetFrame() || !GetFrame()->Loader().Client())
136 return; 137 return;
137 138
138 DCHECK(IsMainThread()); 139 DCHECK(IsMainThread());
139 Document* active_document = ToDocument(script_state->GetExecutionContext()); 140 Document* active_document = ToDocument(ExecutionContext::From(script_state));
140 if (!active_document) 141 if (!active_document)
141 return; 142 return;
142 143
143 if (!active_document->GetFrame() || 144 if (!active_document->GetFrame() ||
144 !active_document->GetFrame()->CanNavigate(*GetFrame()) || 145 !active_document->GetFrame()->CanNavigate(*GetFrame()) ||
145 !active_document->GetFrame()->IsNavigationAllowed() || 146 !active_document->GetFrame()->IsNavigationAllowed() ||
146 !NavigationDisablerForBeforeUnload::IsNavigationAllowed()) { 147 !NavigationDisablerForBeforeUnload::IsNavigationAllowed()) {
147 return; 148 return;
148 } 149 }
149 150
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 "' and URL '" + GetFrame()->GetDocument()->Url().ElidedString() + "'."); 229 "' and URL '" + GetFrame()->GetDocument()->Url().ElidedString() + "'.");
229 return; 230 return;
230 } 231 }
231 232
232 GetFrame()->Loader().UpdateForSameDocumentNavigation( 233 GetFrame()->Loader().UpdateForSameDocumentNavigation(
233 full_url, kSameDocumentNavigationHistoryApi, std::move(data), 234 full_url, kSameDocumentNavigationHistoryApi, std::move(data),
234 restoration_type, type, GetFrame()->GetDocument()); 235 restoration_type, type, GetFrame()->GetDocument());
235 } 236 }
236 237
237 } // namespace blink 238 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fileapi/URLFileAPI.cpp ('k') | third_party/WebKit/Source/core/html/FormData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698