OLD | NEW |
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. | 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
5 * (http://www.torchmobile.com/) | 5 * (http://www.torchmobile.com/) |
6 * Copyright (C) 2009 Adam Barth. All rights reserved. | 6 * Copyright (C) 2009 Adam Barth. All rights reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 request.setClientRedirect(ClientRedirectPolicy::ClientRedirect); | 271 request.setClientRedirect(ClientRedirectPolicy::ClientRedirect); |
272 maybeLogScheduledNavigationClobber(ScheduledNavigationType::ScheduledReload, | 272 maybeLogScheduledNavigationClobber(ScheduledNavigationType::ScheduledReload, |
273 frame); | 273 frame); |
274 frame->loader().load(request, FrameLoadTypeReload); | 274 frame->loader().load(request, FrameLoadTypeReload); |
275 } | 275 } |
276 | 276 |
277 private: | 277 private: |
278 ScheduledReload() : ScheduledNavigation(0.0, nullptr, true, true) {} | 278 ScheduledReload() : ScheduledNavigation(0.0, nullptr, true, true) {} |
279 }; | 279 }; |
280 | 280 |
281 class ScheduledPageBlock final : public ScheduledURLNavigation { | 281 class ScheduledPageBlock final : public ScheduledNavigation { |
282 public: | 282 public: |
283 static ScheduledPageBlock* create(Document* originDocument, | 283 static ScheduledPageBlock* create(Document* originDocument, int reason) { |
284 const String& url) { | 284 return new ScheduledPageBlock(originDocument, reason); |
285 return new ScheduledPageBlock(originDocument, url); | |
286 } | 285 } |
287 | 286 |
288 void fire(LocalFrame* frame) override { | 287 void fire(LocalFrame* frame) override { |
289 std::unique_ptr<UserGestureIndicator> gestureIndicator = | 288 frame->loader().client()->loadErrorPage(m_reason); |
290 createUserGestureIndicator(); | |
291 SubstituteData substituteData(SharedBuffer::create(), "text/plain", "UTF-8", | |
292 KURL(), ForceSynchronousLoad); | |
293 FrameLoadRequest request(originDocument(), url(), substituteData); | |
294 request.setReplacesCurrentItem(true); | |
295 request.setClientRedirect(ClientRedirectPolicy::ClientRedirect); | |
296 maybeLogScheduledNavigationClobber( | |
297 ScheduledNavigationType::ScheduledPageBlock, frame); | |
298 frame->loader().load(request); | |
299 } | 289 } |
300 | 290 |
301 private: | 291 private: |
302 ScheduledPageBlock(Document* originDocument, const String& url) | 292 ScheduledPageBlock(Document* originDocument, int reason) |
303 : ScheduledURLNavigation(0.0, originDocument, url, true, true) {} | 293 : ScheduledNavigation(0.0, originDocument, true, true), |
| 294 m_reason(reason) {} |
| 295 |
| 296 int m_reason; |
304 }; | 297 }; |
305 | 298 |
306 class ScheduledFormSubmission final : public ScheduledNavigation { | 299 class ScheduledFormSubmission final : public ScheduledNavigation { |
307 public: | 300 public: |
308 static ScheduledFormSubmission* create(Document* document, | 301 static ScheduledFormSubmission* create(Document* document, |
309 FormSubmission* submission, | 302 FormSubmission* submission, |
310 bool replacesCurrentItem) { | 303 bool replacesCurrentItem) { |
311 return new ScheduledFormSubmission(document, submission, | 304 return new ScheduledFormSubmission(document, submission, |
312 replacesCurrentItem); | 305 replacesCurrentItem); |
313 } | 306 } |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 request.setClientRedirect(ClientRedirectPolicy::ClientRedirect); | 444 request.setClientRedirect(ClientRedirectPolicy::ClientRedirect); |
452 m_frame->loader().load(request); | 445 m_frame->loader().load(request); |
453 return; | 446 return; |
454 } | 447 } |
455 } | 448 } |
456 | 449 |
457 schedule(ScheduledLocationChange::create(originDocument, url, | 450 schedule(ScheduledLocationChange::create(originDocument, url, |
458 replacesCurrentItem)); | 451 replacesCurrentItem)); |
459 } | 452 } |
460 | 453 |
461 void NavigationScheduler::schedulePageBlock(Document* originDocument) { | 454 void NavigationScheduler::schedulePageBlock(Document* originDocument, |
| 455 int reason) { |
462 DCHECK(m_frame->page()); | 456 DCHECK(m_frame->page()); |
463 const KURL& url = m_frame->document()->url(); | 457 schedule(ScheduledPageBlock::create(originDocument, reason)); |
464 schedule(ScheduledPageBlock::create(originDocument, url)); | |
465 } | 458 } |
466 | 459 |
467 void NavigationScheduler::scheduleFormSubmission(Document* document, | 460 void NavigationScheduler::scheduleFormSubmission(Document* document, |
468 FormSubmission* submission) { | 461 FormSubmission* submission) { |
469 DCHECK(m_frame->page()); | 462 DCHECK(m_frame->page()); |
470 schedule(ScheduledFormSubmission::create(document, submission, | 463 schedule(ScheduledFormSubmission::create(document, submission, |
471 mustReplaceCurrentItem(m_frame))); | 464 mustReplaceCurrentItem(m_frame))); |
472 } | 465 } |
473 | 466 |
474 void NavigationScheduler::scheduleReload() { | 467 void NavigationScheduler::scheduleReload() { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 m_navigateTaskHandle.cancel(); | 543 m_navigateTaskHandle.cancel(); |
551 m_redirect.clear(); | 544 m_redirect.clear(); |
552 } | 545 } |
553 | 546 |
554 DEFINE_TRACE(NavigationScheduler) { | 547 DEFINE_TRACE(NavigationScheduler) { |
555 visitor->trace(m_frame); | 548 visitor->trace(m_frame); |
556 visitor->trace(m_redirect); | 549 visitor->trace(m_redirect); |
557 } | 550 } |
558 | 551 |
559 } // namespace blink | 552 } // namespace blink |
OLD | NEW |