| Index: chrome/browser/safe_browsing/malware_details.h
|
| ===================================================================
|
| --- chrome/browser/safe_browsing/malware_details.h (revision 71243)
|
| +++ chrome/browser/safe_browsing/malware_details.h (working copy)
|
| @@ -36,6 +36,7 @@
|
| private:
|
| friend class base::RefCountedThreadSafe<MalwareDetails>;
|
|
|
| + // Maps a URL to its Resource.
|
| typedef base::hash_map<
|
| std::string,
|
| linked_ptr<safe_browsing::ClientMalwareReportRequest::Resource> >
|
| @@ -47,17 +48,24 @@
|
| // Whether the url is "public" so we can add it to the report.
|
| bool IsPublicUrl(const GURL& url) const;
|
|
|
| - // Adds a node to |urls_|. |parent| can be empty.
|
| - void AddNode(const std::string& url, const std::string& parent);
|
| + // Finds an existing Resource for the given url, or creates a new
|
| + // one if not found, and adds it to |resources_|. Returns the
|
| + // found/created resource.
|
| + safe_browsing::ClientMalwareReportRequest::Resource* FindOrCreateResource(
|
| + const std::string& url);
|
|
|
| + // Adds a Resource to resources_ with the given parent
|
| + // relationship. |parent| can be empty.
|
| + void AddUrl(const std::string& url, const std::string& parent);
|
| +
|
| ~MalwareDetails();
|
|
|
| TabContents* tab_contents_;
|
| const SafeBrowsingService::UnsafeResource resource_;
|
|
|
| - // The urls that we collect. We first add them into this map and then
|
| - // generate a protocol buffer from it.
|
| - ResourceMap urls_;
|
| + // For every Url we collect we create a Resource message. We keep
|
| + // them in a map so we can avoid duplicates.
|
| + ResourceMap resources_;
|
|
|
| // The report protocol buffer.
|
| scoped_ptr<safe_browsing::ClientMalwareReportRequest> report_;
|
|
|