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

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

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