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

Side by Side Diff: content/common/android/address_parser.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 | « no previous file | content/common/android/gin_java_bridge_value.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/android/address_parser.h" 5 #include "content/common/android/address_parser.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "content/common/android/address_parser_internal.h" 9 #include "content/common/android/address_parser_internal.h"
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 DCHECK_GT(std::distance(current_word.begin, current_word.end), 0); 118 DCHECK_GT(std::distance(current_word.begin, current_word.end), 0);
119 size_t current_word_length = std::distance( 119 size_t current_word_length = std::distance(
120 current_word.begin, current_word.end); 120 current_word.begin, current_word.end);
121 if (current_word_length > kMaxAddressNameWordLength) { 121 if (current_word_length > kMaxAddressNameWordLength) {
122 continue_on_house_number = false; 122 continue_on_house_number = false;
123 break; 123 break;
124 } 124 }
125 125
126 // Check if the new word is a valid house number. 126 // Check if the new word is a valid house number.
127 if (house_number_parser.Parse(current_word.begin, current_word.end, 127 if (house_number_parser.Parse(current_word.begin, current_word.end,
128 NULL)) { 128 nullptr)) {
129 // Increase the number of consecutive house numbers since the beginning. 129 // Increase the number of consecutive house numbers since the beginning.
130 if (consecutive_house_numbers) { 130 if (consecutive_house_numbers) {
131 // Check if there is a new line between consecutive house numbers. 131 // Check if there is a new line between consecutive house numbers.
132 // This avoids false positives of the form "Cafe 21\n 750 Fifth Ave.." 132 // This avoids false positives of the form "Cafe 21\n 750 Fifth Ave.."
133 if (num_lines > 1) { 133 if (num_lines > 1) {
134 next_house_number_word = next_word; 134 next_house_number_word = next_word;
135 break; 135 break;
136 } 136 }
137 } 137 }
138 138
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 it = words[next_word].end; 211 it = words[next_word].end;
212 } 212 }
213 } 213 }
214 214
215 return false; 215 return false;
216 } 216 }
217 217
218 } // namespace address_parser 218 } // namespace address_parser
219 219
220 } // namespace content 220 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/android/gin_java_bridge_value.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698