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

Unified Diff: third_party/WebKit/Source/modules/sensor/Sensor.cpp

Issue 2537863003: Remove [ConstructorCallWith=ScriptState] from Sensor (Closed)
Patch Set: Created 4 years 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 | « third_party/WebKit/Source/modules/sensor/Sensor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/sensor/Sensor.cpp
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.cpp b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
index f5da38b02f57686fb41ee8875758cc859c39f1a8..57faf7541adba4fe11261d42f7eace3eb949678f 100644
--- a/third_party/WebKit/Source/modules/sensor/Sensor.cpp
+++ b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
@@ -18,25 +18,25 @@ using namespace device::mojom::blink;
namespace blink {
-Sensor::Sensor(ScriptState* scriptState,
+Sensor::Sensor(ExecutionContext* executionContext,
const SensorOptions& sensorOptions,
ExceptionState& exceptionState,
SensorType type)
: ActiveScriptWrappable(this),
- ContextLifecycleObserver(scriptState->getExecutionContext()),
+ ContextLifecycleObserver(executionContext),
m_sensorOptions(sensorOptions),
m_type(type),
m_state(Sensor::SensorState::Idle) {
// Check secure context.
String errorMessage;
- if (!scriptState->getExecutionContext()->isSecureContext(errorMessage)) {
+ if (!executionContext->isSecureContext(errorMessage)) {
exceptionState.throwDOMException(SecurityError, errorMessage);
return;
}
// Check top-level browsing context.
- if (!scriptState->domWindow() || !scriptState->domWindow()->frame() ||
- !scriptState->domWindow()->frame()->isMainFrame()) {
+ if (!toDocument(executionContext)->domWindow()->frame() ||
+ !toDocument(executionContext)->frame()->isMainFrame()) {
exceptionState.throwSecurityError(
"Must be in a top-level browsing context");
return;
@@ -54,7 +54,7 @@ Sensor::Sensor(ScriptState* scriptState,
m_sensorOptions.setFrequency(SensorConfiguration::kMaxAllowedFrequency);
ConsoleMessage* consoleMessage = ConsoleMessage::create(
JSMessageSource, InfoMessageLevel, "Frequency is limited to 60 Hz.");
- scriptState->getExecutionContext()->addConsoleMessage(consoleMessage);
+ executionContext->addConsoleMessage(consoleMessage);
}
}
}
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/Sensor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698