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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: Re-add dropped null check Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 35b472ad167ac9eeff39a1eae3a9638b2fdd528b..ec6f5bdc218d0fab7408e047e9ec97b965651289 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -1976,7 +1976,7 @@ void RenderFrameImpl::OnJavaScriptExecuteRequestForTests(
// A bunch of tests expect to run code in the context of a user gesture, which
// can grant additional privileges (e.g. the ability to create popups).
std::unique_ptr<blink::WebScopedUserGesture> gesture(
- has_user_gesture ? new blink::WebScopedUserGesture : nullptr);
+ has_user_gesture ? new blink::WebScopedUserGesture(frame_) : nullptr);
v8::HandleScope handle_scope(blink::mainThreadIsolate());
v8::Local<v8::Value> result =
frame_->executeScriptAndReturnValue(WebScriptSource(jscript));
@@ -2310,7 +2310,7 @@ bool RenderFrameImpl::RunJavaScriptMessage(JavaScriptMessageType type,
return false;
int32_t message_length = static_cast<int32_t>(message.length());
- if (WebUserGestureIndicator::processedUserGestureSinceLoad()) {
+ if (WebUserGestureIndicator::processedUserGestureSinceLoad(frame_)) {
UMA_HISTOGRAM_COUNTS("JSDialogs.CharacterCount.UserGestureSinceLoad",
message_length);
} else {
@@ -5011,8 +5011,8 @@ void RenderFrameImpl::OnCommitNavigation(
// If the request was initiated in the context of a user gesture then make
// sure that the navigation also executes in the context of a user gesture.
std::unique_ptr<blink::WebScopedUserGesture> gesture(
- request_params.has_user_gesture ? new blink::WebScopedUserGesture
- : nullptr);
+ request_params.has_user_gesture ? new blink::WebScopedUserGesture(frame_)
+ : nullptr);
NavigateInternal(common_params, StartNavigationParams(), request_params,
std::move(stream_override));
« no previous file with comments | « no previous file | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698