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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page.cc

Issue 8984007: Revert 114929 - Standardize StringToInt{,64} interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Implementation of the SafeBrowsingBlockingPage class. 5 // Implementation of the SafeBrowsingBlockingPage class.
6 6
7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" 7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h"
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/i18n/rtl.h" 12 #include "base/i18n/rtl.h"
13 #include "base/lazy_instance.h" 13 #include "base/lazy_instance.h"
14 #include "base/string_number_conversions.h" 14 #include "base/string_number_conversions.h"
15 #include "base/string_piece.h"
16 #include "base/stringprintf.h" 15 #include "base/stringprintf.h"
17 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
18 #include "base/values.h" 17 #include "base/values.h"
19 #include "chrome/browser/browser_process.h" 18 #include "chrome/browser/browser_process.h"
20 #include "chrome/browser/dom_operation_notification_details.h" 19 #include "chrome/browser/dom_operation_notification_details.h"
21 #include "chrome/browser/google/google_util.h" 20 #include "chrome/browser/google/google_util.h"
22 #include "chrome/browser/prefs/pref_service.h" 21 #include "chrome/browser/prefs/pref_service.h"
23 #include "chrome/browser/profiles/profile.h" 22 #include "chrome/browser/profiles/profile.h"
24 #include "chrome/browser/safe_browsing/malware_details.h" 23 #include "chrome/browser/safe_browsing/malware_details.h"
25 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 24 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 // We are deleted after this. 460 // We are deleted after this.
462 return; 461 return;
463 } 462 }
464 463
465 // The "report error" and "show diagnostic" commands can have a number 464 // The "report error" and "show diagnostic" commands can have a number
466 // appended to them, which is the index of the element they apply to. 465 // appended to them, which is the index of the element they apply to.
467 int element_index = 0; 466 int element_index = 0;
468 size_t colon_index = command.find(':'); 467 size_t colon_index = command.find(':');
469 if (colon_index != std::string::npos) { 468 if (colon_index != std::string::npos) {
470 DCHECK(colon_index < command.size() - 1); 469 DCHECK(colon_index < command.size() - 1);
471 bool result = base::StringToInt(base::StringPiece(command.begin() + 470 bool result = base::StringToInt(command.begin() + colon_index + 1,
472 colon_index + 1, 471 command.end(),
473 command.end()),
474 &element_index); 472 &element_index);
475 command = command.substr(0, colon_index); 473 command = command.substr(0, colon_index);
476 DCHECK(result); 474 DCHECK(result);
477 } 475 }
478 476
479 if (element_index >= static_cast<int>(unsafe_resources_.size())) { 477 if (element_index >= static_cast<int>(unsafe_resources_.size())) {
480 NOTREACHED(); 478 NOTREACHED();
481 return; 479 return;
482 } 480 }
483 481
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 // Client-side phishing detection interstitials never block the main frame 708 // Client-side phishing detection interstitials never block the main frame
711 // load, since they happen after the page is finished loading. 709 // load, since they happen after the page is finished loading.
712 if (unsafe_resources[0].threat_type == 710 if (unsafe_resources[0].threat_type ==
713 SafeBrowsingService::CLIENT_SIDE_PHISHING_URL) { 711 SafeBrowsingService::CLIENT_SIDE_PHISHING_URL) {
714 return false; 712 return false;
715 } 713 }
716 714
717 // Otherwise, check the threat type. 715 // Otherwise, check the threat type.
718 return unsafe_resources.size() == 1 && !unsafe_resources[0].is_subresource; 716 return unsafe_resources.size() == 1 && !unsafe_resources[0].is_subresource;
719 } 717 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/filter_false_positive_perftest.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698