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

Side by Side Diff: third_party/WebKit/Source/core/loader/NavigationScheduler.cpp

Issue 1983913002: Test to see if we can bring in document data from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WebLocalFrameImpl::loadData Created 4 years, 7 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, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2009 Adam Barth. All rights reserved. 5 * Copyright (C) 2009 Adam Barth. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 10 *
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 return new ScheduledLocationChange(originDocument, url, replacesCurrentI tem); 166 return new ScheduledLocationChange(originDocument, url, replacesCurrentI tem);
167 } 167 }
168 168
169 private: 169 private:
170 ScheduledLocationChange(Document* originDocument, const String& url, bool re placesCurrentItem) 170 ScheduledLocationChange(Document* originDocument, const String& url, bool re placesCurrentItem)
171 : ScheduledURLNavigation(0.0, originDocument, url, replacesCurrentItem, !protocolIsJavaScript(url)) { } 171 : ScheduledURLNavigation(0.0, originDocument, url, replacesCurrentItem, !protocolIsJavaScript(url)) { }
172 }; 172 };
173 173
174 class ScheduledReload final : public ScheduledNavigation { 174 class ScheduledReload final : public ScheduledNavigation {
175 public: 175 public:
176 static ScheduledReload* create() 176 static ScheduledReload* create(Document* originDocument)
177 { 177 {
178 return new ScheduledReload; 178 return new ScheduledReload(originDocument);
179 } 179 }
180 180
181 void fire(LocalFrame* frame) override 181 void fire(LocalFrame* frame) override
182 { 182 {
183 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat or(); 183 OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicat or();
184 ResourceRequest resourceRequest = frame->loader().resourceRequestForRelo ad(FrameLoadTypeReload, KURL(), ClientRedirectPolicy::ClientRedirect); 184 ResourceRequest resourceRequest = frame->loader().resourceRequestForRelo ad(FrameLoadTypeReload, KURL(), ClientRedirectPolicy::ClientRedirect);
185 if (resourceRequest.isNull()) 185 if (resourceRequest.isNull())
186 return; 186 return;
187 FrameLoadRequest request = FrameLoadRequest(nullptr, resourceRequest); 187 FrameLoadRequest request = FrameLoadRequest(originDocument(), resourceRe quest);
188 request.setClientRedirect(ClientRedirectPolicy::ClientRedirect); 188 request.setClientRedirect(ClientRedirectPolicy::ClientRedirect);
189 frame->loader().load(request, FrameLoadTypeReload); 189 frame->loader().load(request, FrameLoadTypeReload);
190 } 190 }
191 191
192 private: 192 private:
193 ScheduledReload() 193 ScheduledReload(Document* originDocument)
194 : ScheduledNavigation(0.0, nullptr, true, true) 194 : ScheduledNavigation(0.0, originDocument, true, true)
195 { 195 {
196 } 196 }
197 }; 197 };
198 198
199 class ScheduledPageBlock final : public ScheduledURLNavigation { 199 class ScheduledPageBlock final : public ScheduledURLNavigation {
200 public: 200 public:
201 static ScheduledPageBlock* create(Document* originDocument, const String& ur l) 201 static ScheduledPageBlock* create(Document* originDocument, const String& ur l)
202 { 202 {
203 return new ScheduledPageBlock(originDocument, url); 203 return new ScheduledPageBlock(originDocument, url);
204 } 204 }
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 ASSERT(m_frame->page()); 371 ASSERT(m_frame->page());
372 schedule(ScheduledFormSubmission::create(document, submission, mustReplaceCu rrentItem(m_frame))); 372 schedule(ScheduledFormSubmission::create(document, submission, mustReplaceCu rrentItem(m_frame)));
373 } 373 }
374 374
375 void NavigationScheduler::scheduleReload() 375 void NavigationScheduler::scheduleReload()
376 { 376 {
377 if (!shouldScheduleReload()) 377 if (!shouldScheduleReload())
378 return; 378 return;
379 if (m_frame->document()->url().isEmpty()) 379 if (m_frame->document()->url().isEmpty())
380 return; 380 return;
381 schedule(ScheduledReload::create()); 381 schedule(ScheduledReload::create(m_frame->document()));
382 } 382 }
383 383
384 void NavigationScheduler::navigateTask() 384 void NavigationScheduler::navigateTask()
385 { 385 {
386 Platform::current()->currentThread()->scheduler()->removePendingNavigation(m _frameType); 386 Platform::current()->currentThread()->scheduler()->removePendingNavigation(m _frameType);
387 387
388 if (!m_frame->page()) 388 if (!m_frame->page())
389 return; 389 return;
390 if (m_frame->page()->defersLoading()) { 390 if (m_frame->page()->defersLoading()) {
391 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame); 391 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 m_redirect.clear(); 445 m_redirect.clear();
446 } 446 }
447 447
448 DEFINE_TRACE(NavigationScheduler) 448 DEFINE_TRACE(NavigationScheduler)
449 { 449 {
450 visitor->trace(m_frame); 450 visitor->trace(m_frame);
451 visitor->trace(m_redirect); 451 visitor->trace(m_redirect);
452 } 452 }
453 453
454 } // namespace blink 454 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoaderClient.h ('k') | third_party/WebKit/Source/core/page/CreateWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698