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

Side by Side Diff: content/common/input/touch_event_stream_validator.cc

Issue 649533003: C++11 declares a type safe null pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Presubmit errors Created 6 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
« no previous file with comments | « content/common/input/input_param_traits.cc ('k') | content/common/media/media_stream_options.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/common/input/touch_event_stream_validator.h" 5 #include "content/common/input/touch_event_stream_validator.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/common/input/web_touch_event_traits.h" 8 #include "content/common/input/web_touch_event_traits.h"
9 9
10 using blink::WebInputEvent; 10 using blink::WebInputEvent;
11 using blink::WebTouchEvent; 11 using blink::WebTouchEvent;
12 using blink::WebTouchPoint; 12 using blink::WebTouchPoint;
13 13
14 namespace content { 14 namespace content {
15 namespace { 15 namespace {
16 16
17 const WebTouchPoint* FindTouchPoint(const WebTouchEvent& event, int id) { 17 const WebTouchPoint* FindTouchPoint(const WebTouchEvent& event, int id) {
18 for (unsigned i = 0; i < event.touchesLength; ++i) { 18 for (unsigned i = 0; i < event.touchesLength; ++i) {
19 if (event.touches[i].id == id) 19 if (event.touches[i].id == id)
20 return &event.touches[i]; 20 return &event.touches[i];
21 } 21 }
22 return NULL; 22 return nullptr;
23 } 23 }
24 24
25 } // namespace 25 } // namespace
26 26
27 TouchEventStreamValidator::TouchEventStreamValidator() { 27 TouchEventStreamValidator::TouchEventStreamValidator() {
28 } 28 }
29 29
30 TouchEventStreamValidator::~TouchEventStreamValidator() { 30 TouchEventStreamValidator::~TouchEventStreamValidator() {
31 } 31 }
32 32
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 } 121 }
122 122
123 if (!found_valid_state_for_type) 123 if (!found_valid_state_for_type)
124 error_msg->append("No valid touch point corresponding to event type."); 124 error_msg->append("No valid touch point corresponding to event type.");
125 125
126 return error_msg->empty(); 126 return error_msg->empty();
127 } 127 }
128 128
129 } // namespace content 129 } // namespace content
OLDNEW
« no previous file with comments | « content/common/input/input_param_traits.cc ('k') | content/common/media/media_stream_options.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698