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

Side by Side Diff: chrome/browser/safe_browsing/malware_details_cache.h

Issue 10386063: Move URLFetcherDelegate to net/ and split URLFetcher between net/ and content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to head, fix win component build Created 8 years, 7 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
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 #ifndef CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_CACHE_H_ 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_CACHE_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_CACHE_H_ 6 #define CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_CACHE_H_
7 #pragma once 7 #pragma once
8 8
9 // A class that gets malware details from the HTTP Cache. 9 // A class that gets malware details from the HTTP Cache.
10 // An instance of this class is generated by MalwareDetails. 10 // An instance of this class is generated by MalwareDetails.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 safe_browsing::ResourceMap* resources, 47 safe_browsing::ResourceMap* resources,
48 bool* result, 48 bool* result,
49 const base::Closure& callback); 49 const base::Closure& callback);
50 50
51 // Returns whether or not StartCacheCollection has been called. 51 // Returns whether or not StartCacheCollection has been called.
52 bool HasStarted(); 52 bool HasStarted();
53 53
54 protected: 54 protected:
55 // Implementation of URLFetcher::Delegate. Called after the request 55 // Implementation of URLFetcher::Delegate. Called after the request
56 // completes (either successfully or with failure). 56 // completes (either successfully or with failure).
57 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE; 57 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
58 58
59 private: 59 private:
60 friend class base::RefCountedThreadSafe<MalwareDetailsCacheCollector>; 60 friend class base::RefCountedThreadSafe<MalwareDetailsCacheCollector>;
61 61
62 virtual ~MalwareDetailsCacheCollector(); 62 virtual ~MalwareDetailsCacheCollector();
63 63
64 // Points to the url for which we are fetching the HTTP cache entry or 64 // Points to the url for which we are fetching the HTTP cache entry or
65 // redirect chain. 65 // redirect chain.
66 safe_browsing::ResourceMap::iterator resources_it_; 66 safe_browsing::ResourceMap::iterator resources_it_;
67 67
(...skipping 19 matching lines...) Expand all
87 // Returns the resource from resources_ that corresponds to |url| 87 // Returns the resource from resources_ that corresponds to |url|
88 safe_browsing::ClientMalwareReportRequest::Resource* GetResource( 88 safe_browsing::ClientMalwareReportRequest::Resource* GetResource(
89 const GURL& url); 89 const GURL& url);
90 90
91 // Creates a new URLFetcher and starts it. 91 // Creates a new URLFetcher and starts it.
92 void OpenEntry(); 92 void OpenEntry();
93 93
94 // Read the HTTP response from |source| and add it to |pb_resource|. 94 // Read the HTTP response from |source| and add it to |pb_resource|.
95 void ReadResponse( 95 void ReadResponse(
96 safe_browsing::ClientMalwareReportRequest::Resource* pb_resource, 96 safe_browsing::ClientMalwareReportRequest::Resource* pb_resource,
97 const content::URLFetcher* source); 97 const net::URLFetcher* source);
98 98
99 // Read the body |data| and add it to |pb_resource|. 99 // Read the body |data| and add it to |pb_resource|.
100 void ReadData( 100 void ReadData(
101 safe_browsing::ClientMalwareReportRequest::Resource* pb_resource, 101 safe_browsing::ClientMalwareReportRequest::Resource* pb_resource,
102 const std::string& data); 102 const std::string& data);
103 103
104 // Called when we are done. 104 // Called when we are done.
105 void AllDone(bool success); 105 void AllDone(bool success);
106 106
107 // Advances to the next entry in resources_it_. 107 // Advances to the next entry in resources_it_.
108 void AdvanceEntry(); 108 void AdvanceEntry();
109 }; 109 };
110 110
111 #endif // CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_CACHE_H_ 111 #endif // CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_CACHE_H_
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/download_protection_service.cc ('k') | chrome/browser/safe_browsing/malware_details_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698