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

Unified Diff: Source/bindings/core/v8/ScriptController.cpp

Issue 1158973004: If javascript: returns no result, balance load progress notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix component building Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/ScriptController.cpp
diff --git a/Source/bindings/core/v8/ScriptController.cpp b/Source/bindings/core/v8/ScriptController.cpp
index 59a1ed877cd3dbde3c3ccc0278b2f9b515c29283..056628bf20c635802db7fe311373157e96fb2f39 100644
--- a/Source/bindings/core/v8/ScriptController.cpp
+++ b/Source/bindings/core/v8/ScriptController.cpp
@@ -487,7 +487,8 @@ bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url)
|| (!shouldBypassMainWorldContentSecurityPolicy && !frame()->document()->contentSecurityPolicy()->allowJavaScriptURLs(frame()->document()->url(), eventHandlerPosition().m_line)))
return true;
- if (frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument())
+ bool progressNotificationsNeeded = frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument() && !frame()->isLoading();
+ if (progressNotificationsNeeded)
frame()->loader().progress().progressStarted();
// We need to hold onto the LocalFrame here because executing script can
@@ -508,8 +509,11 @@ bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url)
if (!frame()->page())
return true;
- if (result.IsEmpty() || !result->IsString())
+ if (result.IsEmpty() || !result->IsString()) {
+ if (progressNotificationsNeeded)
+ frame()->loader().progress().progressCompleted();
return true;
+ }
String scriptResult = toCoreString(v8::Local<v8::String>::Cast(result));
// We're still in a frame, so there should be a DocumentLoader.
« no previous file with comments | « no previous file | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698