| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/safe_browsing_service.h" | 5 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 PrefService* local_state = g_browser_process->local_state(); | 662 PrefService* local_state = g_browser_process->local_state(); |
| 663 std::string client_key, wrapped_key; | 663 std::string client_key, wrapped_key; |
| 664 if (local_state) { | 664 if (local_state) { |
| 665 client_key = | 665 client_key = |
| 666 local_state->GetString(prefs::kSafeBrowsingClientKey); | 666 local_state->GetString(prefs::kSafeBrowsingClientKey); |
| 667 wrapped_key = | 667 wrapped_key = |
| 668 local_state->GetString(prefs::kSafeBrowsingWrappedKey); | 668 local_state->GetString(prefs::kSafeBrowsingWrappedKey); |
| 669 } | 669 } |
| 670 | 670 |
| 671 // We will issue network fetches using the default profile's request context. | 671 // We will issue network fetches using the default profile's request context. |
| 672 scoped_refptr<URLRequestContextGetter> request_context_getter = | 672 scoped_refptr<URLRequestContextGetter> request_context_getter( |
| 673 GetDefaultProfile()->GetRequestContext(); | 673 GetDefaultProfile()->GetRequestContext()); |
| 674 | 674 |
| 675 BrowserThread::PostTask( | 675 BrowserThread::PostTask( |
| 676 BrowserThread::IO, FROM_HERE, | 676 BrowserThread::IO, FROM_HERE, |
| 677 NewRunnableMethod( | 677 NewRunnableMethod( |
| 678 this, &SafeBrowsingService::OnIOInitialize, client_key, wrapped_key, | 678 this, &SafeBrowsingService::OnIOInitialize, client_key, wrapped_key, |
| 679 request_context_getter)); | 679 request_context_getter)); |
| 680 } | 680 } |
| 681 | 681 |
| 682 void SafeBrowsingService::OnCloseDatabase() { | 682 void SafeBrowsingService::OnCloseDatabase() { |
| 683 DCHECK_EQ(MessageLoop::current(), safe_browsing_thread_->message_loop()); | 683 DCHECK_EQ(MessageLoop::current(), safe_browsing_thread_->message_loop()); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 if (!enabled_) | 825 if (!enabled_) |
| 826 return; | 826 return; |
| 827 | 827 |
| 828 DVLOG(1) << "ReportSafeBrowsingHit: " << malicious_url << " " << page_url | 828 DVLOG(1) << "ReportSafeBrowsingHit: " << malicious_url << " " << page_url |
| 829 << " " << referrer_url << " " << is_subresource << " " | 829 << " " << referrer_url << " " << is_subresource << " " |
| 830 << threat_type; | 830 << threat_type; |
| 831 protocol_manager_->ReportSafeBrowsingHit(malicious_url, page_url, | 831 protocol_manager_->ReportSafeBrowsingHit(malicious_url, page_url, |
| 832 referrer_url, is_subresource, | 832 referrer_url, is_subresource, |
| 833 threat_type); | 833 threat_type); |
| 834 } | 834 } |
| OLD | NEW |