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

Side by Side Diff: webkit/plugins/npapi/plugin_list_win.cc

Issue 10684003: Make SplitString() and variants clear their outparam vector. (Note that SplitStringIntoKeyValues()… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_vms.cc ('k') | no next file » | 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 "webkit/plugins/npapi/plugin_list.h" 5 #include "webkit/plugins/npapi/plugin_list.h"
6 6
7 #include <tchar.h> 7 #include <tchar.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 return false; 310 return false;
311 } 311 }
312 312
313 // Compares Windows style version strings (i.e. 1,2,3,4). Returns true if b's 313 // Compares Windows style version strings (i.e. 1,2,3,4). Returns true if b's
314 // version is newer than a's, or false if it's equal or older. 314 // version is newer than a's, or false if it's equal or older.
315 bool IsNewerVersion(const std::wstring& a, const std::wstring& b) { 315 bool IsNewerVersion(const std::wstring& a, const std::wstring& b) {
316 std::vector<std::wstring> a_ver, b_ver; 316 std::vector<std::wstring> a_ver, b_ver;
317 base::SplitString(a, ',', &a_ver); 317 base::SplitString(a, ',', &a_ver);
318 base::SplitString(b, ',', &b_ver); 318 base::SplitString(b, ',', &b_ver);
319 if (a_ver.size() == 1 && b_ver.size() == 1) { 319 if (a_ver.size() == 1 && b_ver.size() == 1) {
320 a_ver.clear();
321 b_ver.clear();
322 base::SplitString(a, '.', &a_ver); 320 base::SplitString(a, '.', &a_ver);
323 base::SplitString(b, '.', &b_ver); 321 base::SplitString(b, '.', &b_ver);
324 } 322 }
325 if (a_ver.size() != b_ver.size()) 323 if (a_ver.size() != b_ver.size())
326 return false; 324 return false;
327 for (size_t i = 0; i < a_ver.size(); i++) { 325 for (size_t i = 0; i < a_ver.size(); i++) {
328 int cur_a, cur_b; 326 int cur_a, cur_b;
329 base::StringToInt(a_ver[i], &cur_a); 327 base::StringToInt(a_ver[i], &cur_a);
330 base::StringToInt(b_ver[i], &cur_b); 328 base::StringToInt(b_ver[i], &cur_b);
331 329
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 437
440 if (file_util::PathExists(info.path) && (!IsValid32BitImage(info.path))) 438 if (file_util::PathExists(info.path) && (!IsValid32BitImage(info.path)))
441 load_plugin = false; 439 load_plugin = false;
442 break; 440 break;
443 } 441 }
444 return load_plugin; 442 return load_plugin;
445 } 443 }
446 444
447 } // namespace npapi 445 } // namespace npapi
448 } // namespace webkit 446 } // namespace webkit
OLDNEW
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_vms.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698