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

Side by Side Diff: third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp

Issue 1371673002: Remove a bunch of provisionalDataSource() usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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) 2009, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 client->frameDetached(m_webFrame, static_cast<WebFrameClient::DetachType>(ty pe)); 349 client->frameDetached(m_webFrame, static_cast<WebFrameClient::DetachType>(ty pe));
350 // Clear our reference to LocalFrame at the very end, in case the client 350 // Clear our reference to LocalFrame at the very end, in case the client
351 // refers to it. 351 // refers to it.
352 m_webFrame->setCoreFrame(nullptr); 352 m_webFrame->setCoreFrame(nullptr);
353 } 353 }
354 354
355 void FrameLoaderClientImpl::dispatchWillSendRequest( 355 void FrameLoaderClientImpl::dispatchWillSendRequest(
356 DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, 356 DocumentLoader* loader, unsigned long identifier, ResourceRequest& request,
357 const ResourceResponse& redirectResponse) 357 const ResourceResponse& redirectResponse)
358 { 358 {
359 if (!loader)
360 loader = m_webFrame->frame()->loader().documentLoader();
359 // Give the WebFrameClient a crack at the request. 361 // Give the WebFrameClient a crack at the request.
360 if (m_webFrame->client()) { 362 if (m_webFrame->client()) {
361 WrappedResourceRequest webreq(request); 363 WrappedResourceRequest webreq(request);
362 WrappedResourceResponse webresp(redirectResponse); 364 WrappedResourceResponse webresp(redirectResponse);
363 m_webFrame->client()->willSendRequest( 365 m_webFrame->client()->willSendRequest(
364 m_webFrame, identifier, webreq, webresp); 366 WebDataSourceImpl::fromDocumentLoader(loader), identifier, webreq, w ebresp);
365 } 367 }
366 } 368 }
367 369
368 void FrameLoaderClientImpl::dispatchDidReceiveResponse(DocumentLoader* loader, 370 void FrameLoaderClientImpl::dispatchDidReceiveResponse(DocumentLoader* loader,
369 unsigned long identifier, 371 unsigned long identifier,
370 const ResourceResponse& r esponse) 372 const ResourceResponse& r esponse)
371 { 373 {
372 if (m_webFrame->client()) { 374 if (m_webFrame->client()) {
373 WrappedResourceResponse webresp(response); 375 WrappedResourceResponse webresp(response);
374 m_webFrame->client()->didReceiveResponse(m_webFrame, identifier, webresp ); 376 m_webFrame->client()->didReceiveResponse(m_webFrame, identifier, webresp );
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 if (m_webFrame->client()) 429 if (m_webFrame->client())
428 m_webFrame->client()->didNavigateWithinPage(m_webFrame, WebHistoryItem(i tem), static_cast<WebHistoryCommitType>(commitType)); 430 m_webFrame->client()->didNavigateWithinPage(m_webFrame, WebHistoryItem(i tem), static_cast<WebHistoryCommitType>(commitType));
429 } 431 }
430 432
431 void FrameLoaderClientImpl::dispatchWillClose() 433 void FrameLoaderClientImpl::dispatchWillClose()
432 { 434 {
433 if (m_webFrame->client()) 435 if (m_webFrame->client())
434 m_webFrame->client()->willClose(m_webFrame); 436 m_webFrame->client()->willClose(m_webFrame);
435 } 437 }
436 438
437 void FrameLoaderClientImpl::dispatchDidStartProvisionalLoad(double triggeringEve ntTime) 439 void FrameLoaderClientImpl::dispatchDidStartProvisionalLoad(DocumentLoader* load er, double triggeringEventTime)
438 { 440 {
439 if (m_webFrame->client()) 441 if (m_webFrame->client())
440 m_webFrame->client()->didStartProvisionalLoad(m_webFrame, triggeringEven tTime); 442 m_webFrame->client()->didStartProvisionalLoad(WebDataSourceImpl::fromDoc umentLoader(loader), triggeringEventTime);
441 } 443 }
442 444
443 void FrameLoaderClientImpl::dispatchDidReceiveTitle(const String& title) 445 void FrameLoaderClientImpl::dispatchDidReceiveTitle(const String& title)
444 { 446 {
445 if (m_webFrame->client()) 447 if (m_webFrame->client())
446 m_webFrame->client()->didReceiveTitle(m_webFrame, title, WebTextDirectio nLeftToRight); 448 m_webFrame->client()->didReceiveTitle(m_webFrame, title, WebTextDirectio nLeftToRight);
447 } 449 }
448 450
449 void FrameLoaderClientImpl::dispatchDidChangeIcons(IconType type) 451 void FrameLoaderClientImpl::dispatchDidChangeIcons(IconType type)
450 { 452 {
451 if (m_webFrame->client()) 453 if (m_webFrame->client())
452 m_webFrame->client()->didChangeIcon(m_webFrame, static_cast<WebIconURL:: Type>(type)); 454 m_webFrame->client()->didChangeIcon(m_webFrame, static_cast<WebIconURL:: Type>(type));
453 } 455 }
454 456
455 void FrameLoaderClientImpl::dispatchDidCommitLoad(HistoryItem* item, HistoryComm itType commitType) 457 void FrameLoaderClientImpl::dispatchDidCommitLoad(HistoryItem* item, HistoryComm itType commitType)
456 { 458 {
457 m_webFrame->viewImpl()->didCommitLoad(commitType == StandardCommit, false); 459 m_webFrame->viewImpl()->didCommitLoad(commitType == StandardCommit, false);
458 if (m_webFrame->client()) 460 if (m_webFrame->client())
459 m_webFrame->client()->didCommitProvisionalLoad(m_webFrame, WebHistoryIte m(item), static_cast<WebHistoryCommitType>(commitType)); 461 m_webFrame->client()->didCommitProvisionalLoad(m_webFrame, WebHistoryIte m(item), static_cast<WebHistoryCommitType>(commitType));
460 WebDevToolsAgentImpl* devToolsAgent = WebLocalFrameImpl::fromFrame(m_webFram e->frame()->localFrameRoot())->devToolsAgentImpl(); 462 WebDevToolsAgentImpl* devToolsAgent = WebLocalFrameImpl::fromFrame(m_webFram e->frame()->localFrameRoot())->devToolsAgentImpl();
461 if (devToolsAgent) 463 if (devToolsAgent)
462 devToolsAgent->didCommitLoadForLocalFrame(m_webFrame->frame()); 464 devToolsAgent->didCommitLoadForLocalFrame(m_webFrame->frame());
463 } 465 }
464 466
465 void FrameLoaderClientImpl::dispatchDidFailProvisionalLoad( 467 void FrameLoaderClientImpl::dispatchDidFailProvisionalLoad(DocumentLoader* loade r,
466 const ResourceError& error, HistoryCommitType commitType) 468 const ResourceError& error, HistoryCommitType commitType)
467 { 469 {
468 OwnPtr<WebPluginLoadObserver> observer = pluginLoadObserver(m_webFrame->fram e()->loader().provisionalDocumentLoader()); 470 OwnPtr<WebPluginLoadObserver> observer = pluginLoadObserver(loader);
469 m_webFrame->didFail(error, true, commitType); 471 if (m_webFrame->client())
472 m_webFrame->client()->didFailProvisionalLoad(WebDataSourceImpl::fromDocu mentLoader(loader), error, static_cast<WebHistoryCommitType>(commitType));
470 if (observer) 473 if (observer)
471 observer->didFailLoading(error); 474 observer->didFailLoading(error);
472 } 475 }
473 476
474 void FrameLoaderClientImpl::dispatchDidFailLoad(const ResourceError& error, Hist oryCommitType commitType) 477 void FrameLoaderClientImpl::dispatchDidFailLoad(DocumentLoader* loader, const Re sourceError& error, HistoryCommitType commitType)
475 { 478 {
476 OwnPtr<WebPluginLoadObserver> observer = pluginLoadObserver(m_webFrame->fram e()->loader().documentLoader()); 479 OwnPtr<WebPluginLoadObserver> observer = pluginLoadObserver(loader);
477 m_webFrame->didFail(error, false, commitType); 480 if (m_webFrame->client())
481 m_webFrame->client()->didFailLoad(WebDataSourceImpl::fromDocumentLoader( loader), error, static_cast<WebHistoryCommitType>(commitType));
478 if (observer) 482 if (observer)
479 observer->didFailLoading(error); 483 observer->didFailLoading(error);
480 484
481 // Don't clear the redirect chain, this will happen in the middle of client 485 // Don't clear the redirect chain, this will happen in the middle of client
482 // redirects, and we need the context. The chain will be cleared when the 486 // redirects, and we need the context. The chain will be cleared when the
483 // provisional load succeeds or fails, not the "real" one. 487 // provisional load succeeds or fails, not the "real" one.
484 } 488 }
485 489
486 void FrameLoaderClientImpl::dispatchDidFinishLoad() 490 void FrameLoaderClientImpl::dispatchDidFinishLoad()
487 { 491 {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 577
574 return m_webFrame->client()->hasPendingNavigation(m_webFrame); 578 return m_webFrame->client()->hasPendingNavigation(m_webFrame);
575 } 579 }
576 580
577 void FrameLoaderClientImpl::dispatchWillSendSubmitEvent(HTMLFormElement* form) 581 void FrameLoaderClientImpl::dispatchWillSendSubmitEvent(HTMLFormElement* form)
578 { 582 {
579 if (m_webFrame->client()) 583 if (m_webFrame->client())
580 m_webFrame->client()->willSendSubmitEvent(m_webFrame, WebFormElement(for m)); 584 m_webFrame->client()->willSendSubmitEvent(m_webFrame, WebFormElement(for m));
581 } 585 }
582 586
583 void FrameLoaderClientImpl::dispatchWillSubmitForm(HTMLFormElement* form) 587 void FrameLoaderClientImpl::dispatchWillSubmitForm(DocumentLoader* loader, HTMLF ormElement* form)
584 { 588 {
585 if (m_webFrame->client()) 589 if (m_webFrame->client())
586 m_webFrame->client()->willSubmitForm(m_webFrame, WebFormElement(form)); 590 m_webFrame->client()->willSubmitForm(WebDataSourceImpl::fromDocumentLoad er(loader), WebFormElement(form));
587 } 591 }
588 592
589 void FrameLoaderClientImpl::didStartLoading(LoadStartType loadStartType) 593 void FrameLoaderClientImpl::didStartLoading(LoadStartType loadStartType)
590 { 594 {
591 if (m_webFrame->client()) 595 if (m_webFrame->client())
592 m_webFrame->client()->didStartLoading(loadStartType == NavigationToDiffe rentDocument); 596 m_webFrame->client()->didStartLoading(loadStartType == NavigationToDiffe rentDocument);
593 } 597 }
594 598
595 void FrameLoaderClientImpl::progressEstimateChanged(double progressEstimate) 599 void FrameLoaderClientImpl::progressEstimateChanged(double progressEstimate)
596 { 600 {
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 960
957 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde nTerminationDisablerType type) 961 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde nTerminationDisablerType type)
958 { 962 {
959 if (m_webFrame->client()) { 963 if (m_webFrame->client()) {
960 m_webFrame->client()->suddenTerminationDisablerChanged( 964 m_webFrame->client()->suddenTerminationDisablerChanged(
961 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>( type)); 965 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>( type));
962 } 966 }
963 } 967 }
964 968
965 } // namespace blink 969 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/FrameLoaderClientImpl.h ('k') | third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698