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

Side by Side Diff: third_party/WebKit/Source/modules/sensor/Sensor.cpp

Issue 2919273002: Don't move raw pointers in third_party/WebKit (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/sensor/Sensor.h" 5 #include "modules/sensor/Sensor.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/ExceptionCode.h" 8 #include "core/dom/ExceptionCode.h"
9 #include "core/dom/TaskRunnerHelper.h" 9 #include "core/dom/TaskRunnerHelper.h"
10 #include "core/inspector/ConsoleMessage.h" 10 #include "core/inspector/ConsoleMessage.h"
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 void Sensor::UpdateReading() { 303 void Sensor::UpdateReading() {
304 reading_ = sensor_proxy_->reading(); 304 reading_ = sensor_proxy_->reading();
305 DispatchEvent(Event::Create(EventTypeNames::change)); 305 DispatchEvent(Event::Create(EventTypeNames::change));
306 } 306 }
307 307
308 void Sensor::NotifyOnActivate() { 308 void Sensor::NotifyOnActivate() {
309 DispatchEvent(Event::Create(EventTypeNames::activate)); 309 DispatchEvent(Event::Create(EventTypeNames::activate));
310 } 310 }
311 311
312 void Sensor::NotifyError(DOMException* error) { 312 void Sensor::NotifyError(DOMException* error) {
313 DispatchEvent( 313 DispatchEvent(SensorErrorEvent::Create(EventTypeNames::error, error));
314 SensorErrorEvent::Create(EventTypeNames::error, std::move(error)));
315 } 314 }
316 315
317 bool Sensor::CanReturnReadings() const { 316 bool Sensor::CanReturnReadings() const {
318 if (!IsActivated()) 317 if (!IsActivated())
319 return false; 318 return false;
320 DCHECK(sensor_proxy_); 319 DCHECK(sensor_proxy_);
321 return sensor_proxy_->reading().timestamp != 0.0; 320 return sensor_proxy_->reading().timestamp != 0.0;
322 } 321 }
323 322
324 } // namespace blink 323 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698