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

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

Issue 2211283004: Drop test-only WebFrameClient params/functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 // Signal that no further communication with WebFrameClient should take 377 // Signal that no further communication with WebFrameClient should take
378 // place at this point since we are no longer associated with the Page. 378 // place at this point since we are no longer associated with the Page.
379 m_webFrame->setClient(0); 379 m_webFrame->setClient(0);
380 380
381 client->frameDetached(m_webFrame, static_cast<WebFrameClient::DetachType>(ty pe)); 381 client->frameDetached(m_webFrame, static_cast<WebFrameClient::DetachType>(ty pe));
382 // Clear our reference to LocalFrame at the very end, in case the client 382 // Clear our reference to LocalFrame at the very end, in case the client
383 // refers to it. 383 // refers to it.
384 m_webFrame->setCoreFrame(nullptr); 384 m_webFrame->setCoreFrame(nullptr);
385 } 385 }
386 386
387 void FrameLoaderClientImpl::dispatchWillSendRequest( 387 void FrameLoaderClientImpl::dispatchWillSendRequest(ResourceRequest& request)
388 DocumentLoader* loader, unsigned long identifier, ResourceRequest& request,
389 const ResourceResponse& redirectResponse)
390 { 388 {
391 // Give the WebFrameClient a crack at the request. 389 // Give the WebFrameClient a crack at the request.
392 if (m_webFrame->client()) { 390 if (m_webFrame->client()) {
393 WrappedResourceRequest webreq(request); 391 WrappedResourceRequest webreq(request);
394 WrappedResourceResponse webresp(redirectResponse); 392 m_webFrame->client()->willSendRequest(m_webFrame, webreq);
395 m_webFrame->client()->willSendRequest(
396 m_webFrame, identifier, webreq, webresp);
397 } 393 }
398 } 394 }
399 395
400 void FrameLoaderClientImpl::dispatchDidReceiveResponse(DocumentLoader* loader, 396 void FrameLoaderClientImpl::dispatchDidReceiveResponse(const ResourceResponse& r esponse)
401 unsigned long identifier,
402 const ResourceResponse& r esponse)
403 { 397 {
404 if (m_webFrame->client()) { 398 if (m_webFrame->client()) {
405 WrappedResourceResponse webresp(response); 399 WrappedResourceResponse webresp(response);
406 m_webFrame->client()->didReceiveResponse(identifier, webresp); 400 m_webFrame->client()->didReceiveResponse(webresp);
407 } 401 }
408 } 402 }
409 403
410 void FrameLoaderClientImpl::dispatchDidChangeResourcePriority(unsigned long iden tifier, ResourceLoadPriority priority, int intraPriorityValue)
411 {
412 if (m_webFrame->client())
413 m_webFrame->client()->didChangeResourcePriority(identifier, static_cast< WebURLRequest::Priority>(priority), intraPriorityValue);
414 }
415
416 // Called when a particular resource load completes
417 void FrameLoaderClientImpl::dispatchDidFinishLoading(DocumentLoader* loader,
418 unsigned long identifier)
419 {
420 if (m_webFrame->client())
421 m_webFrame->client()->didFinishResourceLoad(m_webFrame, identifier);
422 }
423
424 void FrameLoaderClientImpl::dispatchDidFinishDocumentLoad() 404 void FrameLoaderClientImpl::dispatchDidFinishDocumentLoad()
425 { 405 {
426 // TODO(dglazkov): Sadly, workers are WebFrameClients, and they can totally 406 // TODO(dglazkov): Sadly, workers are WebFrameClients, and they can totally
427 // destroy themselves when didFinishDocumentLoad is invoked, and in turn des troy 407 // destroy themselves when didFinishDocumentLoad is invoked, and in turn des troy
428 // the fake WebLocalFrame that they create, which means that you should not 408 // the fake WebLocalFrame that they create, which means that you should not
429 // put any code touching `this` after the two lines below. 409 // put any code touching `this` after the two lines below.
430 if (m_webFrame->client()) 410 if (m_webFrame->client())
431 m_webFrame->client()->didFinishDocumentLoad(m_webFrame); 411 m_webFrame->client()->didFinishDocumentLoad(m_webFrame);
432 } 412 }
433 413
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 { 1009 {
1030 return WebLocalFrameImpl::fromFrame(m_webFrame->frame()->localFrameRoot())-> devToolsAgentImpl(); 1010 return WebLocalFrameImpl::fromFrame(m_webFrame->frame()->localFrameRoot())-> devToolsAgentImpl();
1031 } 1011 }
1032 1012
1033 KURL FrameLoaderClientImpl::overrideFlashEmbedWithHTML(const KURL& url) 1013 KURL FrameLoaderClientImpl::overrideFlashEmbedWithHTML(const KURL& url)
1034 { 1014 {
1035 return m_webFrame->client()->overrideFlashEmbedWithHTML(WebURL(url)); 1015 return m_webFrame->client()->overrideFlashEmbedWithHTML(WebURL(url));
1036 } 1016 }
1037 1017
1038 } // namespace blink 1018 } // 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