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

Side by Side Diff: third_party/WebKit/Source/core/inspector/DevToolsHost.cpp

Issue 2401123002: UserGestureIndicator is a mess. Clean it up. (Closed)
Patch Set: Callback cleanup, comments 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
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 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 void DevToolsHost::evaluateScript(const String& expression) { 126 void DevToolsHost::evaluateScript(const String& expression) {
127 if (ScriptForbiddenScope::isScriptForbidden()) 127 if (ScriptForbiddenScope::isScriptForbidden())
128 return; 128 return;
129 if (!m_frontendFrame) 129 if (!m_frontendFrame)
130 return; 130 return;
131 ScriptState* scriptState = ScriptState::forMainWorld(m_frontendFrame); 131 ScriptState* scriptState = ScriptState::forMainWorld(m_frontendFrame);
132 if (!scriptState) 132 if (!scriptState)
133 return; 133 return;
134 ScriptState::Scope scope(scriptState); 134 ScriptState::Scope scope(scriptState);
135 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); 135 UserGestureIndicator gestureIndicator(UserGestureToken::create());
136 v8::MicrotasksScope microtasks(scriptState->isolate(), 136 v8::MicrotasksScope microtasks(scriptState->isolate(),
137 v8::MicrotasksScope::kRunMicrotasks); 137 v8::MicrotasksScope::kRunMicrotasks);
138 v8::Local<v8::String> source = 138 v8::Local<v8::String> source =
139 v8AtomicString(scriptState->isolate(), expression.utf8().data()); 139 v8AtomicString(scriptState->isolate(), expression.utf8().data());
140 V8ScriptRunner::compileAndRunInternalScript(source, scriptState->isolate(), 140 V8ScriptRunner::compileAndRunInternalScript(source, scriptState->isolate(),
141 String(), TextPosition()); 141 String(), TextPosition());
142 } 142 }
143 143
144 void DevToolsHost::disconnectClient() { 144 void DevToolsHost::disconnectClient() {
145 m_client = 0; 145 m_client = 0;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 224
225 bool DevToolsHost::isUnderTest() { 225 bool DevToolsHost::isUnderTest() {
226 return m_client && m_client->isUnderTest(); 226 return m_client && m_client->isUnderTest();
227 } 227 }
228 228
229 bool DevToolsHost::isHostedMode() { 229 bool DevToolsHost::isHostedMode() {
230 return false; 230 return false;
231 } 231 }
232 232
233 } // namespace blink 233 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698