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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: Switch back to checkign context->isDocument() 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
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index f10589b80ab246a62641b8e0061c1129fe971ee0..5fd81cfd109488acdbaa73c0e98c198ad2c7d86d 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') | third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698