| OLD | NEW |
| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 InitResource(&resource, SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL, | 712 InitResource(&resource, SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL, |
| 713 true /* is_subresource */, GURL(kThreatURL)); | 713 true /* is_subresource */, GURL(kThreatURL)); |
| 714 | 714 |
| 715 scoped_refptr<ThreatDetailsWrap> report = | 715 scoped_refptr<ThreatDetailsWrap> report = |
| 716 new ThreatDetailsWrap(ui_manager_.get(), web_contents(), resource, | 716 new ThreatDetailsWrap(ui_manager_.get(), web_contents(), resource, |
| 717 profile()->GetRequestContext()); | 717 profile()->GetRequestContext()); |
| 718 | 718 |
| 719 BrowserThread::PostTask( | 719 BrowserThread::PostTask( |
| 720 BrowserThread::IO, FROM_HERE, | 720 BrowserThread::IO, FROM_HERE, |
| 721 base::Bind(&FillCache, | 721 base::Bind(&FillCache, |
| 722 make_scoped_refptr(profile()->GetRequestContext()))); | 722 base::RetainedRef(profile()->GetRequestContext()))); |
| 723 | 723 |
| 724 // The cache collection starts after the IPC from the DOM is fired. | 724 // The cache collection starts after the IPC from the DOM is fired. |
| 725 std::vector<SafeBrowsingHostMsg_ThreatDOMDetails_Node> params; | 725 std::vector<SafeBrowsingHostMsg_ThreatDOMDetails_Node> params; |
| 726 report->OnReceivedThreatDOMDetails(params); | 726 report->OnReceivedThreatDOMDetails(params); |
| 727 | 727 |
| 728 // Let the cache callbacks complete. | 728 // Let the cache callbacks complete. |
| 729 base::RunLoop().RunUntilIdle(); | 729 base::RunLoop().RunUntilIdle(); |
| 730 | 730 |
| 731 DVLOG(1) << "Getting serialized report"; | 731 DVLOG(1) << "Getting serialized report"; |
| 732 std::string serialized = WaitForSerializedReport( | 732 std::string serialized = WaitForSerializedReport( |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 pb_resource->set_parent_id(3); | 884 pb_resource->set_parent_id(3); |
| 885 pb_resource->set_url(kSecondRedirectURL); | 885 pb_resource->set_url(kSecondRedirectURL); |
| 886 pb_resource = expected.add_resources(); | 886 pb_resource = expected.add_resources(); |
| 887 pb_resource->set_id(3); | 887 pb_resource->set_id(3); |
| 888 pb_resource->set_url(kFirstRedirectURL); | 888 pb_resource->set_url(kFirstRedirectURL); |
| 889 | 889 |
| 890 VerifyResults(actual, expected); | 890 VerifyResults(actual, expected); |
| 891 } | 891 } |
| 892 | 892 |
| 893 } // namespace safe_browsing | 893 } // namespace safe_browsing |
| OLD | NEW |