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

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

Issue 1837483002: Allow LoadNavigationErrorPage to run scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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) 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 m_webFrame->viewImpl()->mainFrameDocumentElementAvailable(); 188 m_webFrame->viewImpl()->mainFrameDocumentElementAvailable();
189 } 189 }
190 190
191 void FrameLoaderClientImpl::runScriptsAtDocumentElementAvailable() 191 void FrameLoaderClientImpl::runScriptsAtDocumentElementAvailable()
192 { 192 {
193 if (m_webFrame->client()) 193 if (m_webFrame->client())
194 m_webFrame->client()->runScriptsAtDocumentElementAvailable(m_webFrame); 194 m_webFrame->client()->runScriptsAtDocumentElementAvailable(m_webFrame);
195 // The callback might have deleted the frame, do not use |this|! 195 // The callback might have deleted the frame, do not use |this|!
196 } 196 }
197 197
198 void FrameLoaderClientImpl::runScriptsAtDocumentReady() 198 void FrameLoaderClientImpl::runScriptsAtDocumentReady(bool documentIsEmpty)
199 { 199 {
200 if (m_webFrame->client()) 200 if (m_webFrame->client())
201 m_webFrame->client()->runScriptsAtDocumentReady(m_webFrame); 201 m_webFrame->client()->runScriptsAtDocumentReady(m_webFrame, documentIsEm pty);
202 // The callback might have deleted the frame, do not use |this|! 202 // The callback might have deleted the frame, do not use |this|!
203 } 203 }
204 204
205 void FrameLoaderClientImpl::didCreateScriptContext(v8::Local<v8::Context> contex t, int extensionGroup, int worldId) 205 void FrameLoaderClientImpl::didCreateScriptContext(v8::Local<v8::Context> contex t, int extensionGroup, int worldId)
206 { 206 {
207 if (m_webFrame->client()) 207 if (m_webFrame->client())
208 m_webFrame->client()->didCreateScriptContext(m_webFrame, context, extens ionGroup, worldId); 208 m_webFrame->client()->didCreateScriptContext(m_webFrame, context, extens ionGroup, worldId);
209 } 209 }
210 210
211 void FrameLoaderClientImpl::willReleaseScriptContext(v8::Local<v8::Context> cont ext, int worldId) 211 void FrameLoaderClientImpl::willReleaseScriptContext(v8::Local<v8::Context> cont ext, int worldId)
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 } 431 }
432 432
433 // Called when a particular resource load completes 433 // Called when a particular resource load completes
434 void FrameLoaderClientImpl::dispatchDidFinishLoading(DocumentLoader* loader, 434 void FrameLoaderClientImpl::dispatchDidFinishLoading(DocumentLoader* loader,
435 unsigned long identifier) 435 unsigned long identifier)
436 { 436 {
437 if (m_webFrame->client()) 437 if (m_webFrame->client())
438 m_webFrame->client()->didFinishResourceLoad(m_webFrame, identifier); 438 m_webFrame->client()->didFinishResourceLoad(m_webFrame, identifier);
439 } 439 }
440 440
441 void FrameLoaderClientImpl::dispatchDidFinishDocumentLoad(bool documentIsEmpty) 441 void FrameLoaderClientImpl::dispatchDidFinishDocumentLoad()
442 { 442 {
443 if (!m_webFrame->parent()) { 443 if (!m_webFrame->parent()) {
444 if (WebViewImpl* webview = m_webFrame->viewImpl()) 444 if (WebViewImpl* webview = m_webFrame->viewImpl())
445 webview->didFinishMainFrameDocumentLoad(); 445 webview->didFinishMainFrameDocumentLoad();
446 } 446 }
447 447
448 // TODO(dglazkov): Sadly, workers are WebFrameClients, and they can totally 448 // TODO(dglazkov): Sadly, workers are WebFrameClients, and they can totally
449 // destroy themselves when didFinishDocumentLoad is invoked, and in turn des troy 449 // destroy themselves when didFinishDocumentLoad is invoked, and in turn des troy
450 // the fake WebLocalFrame that they create, which means that you should not 450 // the fake WebLocalFrame that they create, which means that you should not
451 // put any code touching `this` after the two lines below. 451 // put any code touching `this` after the two lines below.
452 if (m_webFrame->client()) 452 if (m_webFrame->client())
453 m_webFrame->client()->didFinishDocumentLoad(m_webFrame, documentIsEmpty) ; 453 m_webFrame->client()->didFinishDocumentLoad(m_webFrame);
454 } 454 }
455 455
456 void FrameLoaderClientImpl::dispatchDidLoadResourceFromMemoryCache(const Resourc eRequest& request, const ResourceResponse& response) 456 void FrameLoaderClientImpl::dispatchDidLoadResourceFromMemoryCache(const Resourc eRequest& request, const ResourceResponse& response)
457 { 457 {
458 if (m_webFrame->client()) 458 if (m_webFrame->client())
459 m_webFrame->client()->didLoadResourceFromMemoryCache(WrappedResourceRequ est(request), WrappedResourceResponse(response)); 459 m_webFrame->client()->didLoadResourceFromMemoryCache(WrappedResourceRequ est(request), WrappedResourceResponse(response));
460 } 460 }
461 461
462 void FrameLoaderClientImpl::dispatchDidHandleOnloadEvents() 462 void FrameLoaderClientImpl::dispatchDidHandleOnloadEvents()
463 { 463 {
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>( type)); 1051 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>( type));
1052 } 1052 }
1053 } 1053 }
1054 1054
1055 PassOwnPtrWillBeRawPtr<LinkResource> FrameLoaderClientImpl::createServiceWorkerL inkResource(HTMLLinkElement* owner) 1055 PassOwnPtrWillBeRawPtr<LinkResource> FrameLoaderClientImpl::createServiceWorkerL inkResource(HTMLLinkElement* owner)
1056 { 1056 {
1057 return ServiceWorkerLinkResource::create(owner); 1057 return ServiceWorkerLinkResource::create(owner);
1058 } 1058 }
1059 1059
1060 } // namespace blink 1060 } // 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