| OLD | NEW |
| 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 "chrome/browser/safe_browsing/incident_reporting/incident_reporting_ser
vice.h" | 5 #include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_ser
vice.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 prune_pct = prune_pct * 100.0 / (count + prune_count); | 835 prune_pct = prune_pct * 100.0 / (count + prune_count); |
| 836 prune_pct = round(prune_pct); | 836 prune_pct = round(prune_pct); |
| 837 UMA_HISTOGRAM_PERCENTAGE("SBIRS.PruneRatio", static_cast<int>(prune_pct)); | 837 UMA_HISTOGRAM_PERCENTAGE("SBIRS.PruneRatio", static_cast<int>(prune_pct)); |
| 838 } | 838 } |
| 839 // Abandon the report if all incidents were pruned. | 839 // Abandon the report if all incidents were pruned. |
| 840 if (!count) | 840 if (!count) |
| 841 return; | 841 return; |
| 842 | 842 |
| 843 scoped_ptr<UploadContext> context(new UploadContext(report.Pass())); | 843 scoped_ptr<UploadContext> context(new UploadContext(report.Pass())); |
| 844 context->profiles_to_state.swap(profiles_to_state); | 844 context->profiles_to_state.swap(profiles_to_state); |
| 845 if (!database_manager_) { | 845 if (!database_manager_.get()) { |
| 846 // No database manager during testing. Take ownership of the context and | 846 // No database manager during testing. Take ownership of the context and |
| 847 // continue processing. | 847 // continue processing. |
| 848 UploadContext* temp_context = context.get(); | 848 UploadContext* temp_context = context.get(); |
| 849 uploads_.push_back(context.release()); | 849 uploads_.push_back(context.release()); |
| 850 IncidentReportingService::OnKillSwitchResult(temp_context, false); | 850 IncidentReportingService::OnKillSwitchResult(temp_context, false); |
| 851 } else { | 851 } else { |
| 852 if (content::BrowserThread::PostTaskAndReplyWithResult( | 852 if (content::BrowserThread::PostTaskAndReplyWithResult( |
| 853 content::BrowserThread::IO, | 853 content::BrowserThread::IO, |
| 854 FROM_HERE, | 854 FROM_HERE, |
| 855 base::Bind(&SafeBrowsingDatabaseManager::IsCsdWhitelistKillSwitchOn, | 855 base::Bind(&SafeBrowsingDatabaseManager::IsCsdWhitelistKillSwitchOn, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 if (!profile->IsOffTheRecord()) | 945 if (!profile->IsOffTheRecord()) |
| 946 OnProfileDestroyed(profile); | 946 OnProfileDestroyed(profile); |
| 947 break; | 947 break; |
| 948 } | 948 } |
| 949 default: | 949 default: |
| 950 break; | 950 break; |
| 951 } | 951 } |
| 952 } | 952 } |
| 953 | 953 |
| 954 } // namespace safe_browsing | 954 } // namespace safe_browsing |
| OLD | NEW |