| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // MalwareDOMDetails iterates over a document's frames and gathers | 5 // MalwareDOMDetails iterates over a document's frames and gathers |
| 6 // interesting URLs such as those of scripts and frames. When done, it sends | 6 // interesting URLs such as those of scripts and frames. When done, it sends |
| 7 // them to the MalwareDetails that requested them. | 7 // them to the MalwareDetails that requested them. |
| 8 | 8 |
| 9 #ifndef CHROME_RENDERER_SAFE_BROWSING_MALWARE_DOM_DETAILS_H_ | 9 #ifndef CHROME_RENDERER_SAFE_BROWSING_MALWARE_DOM_DETAILS_H_ |
| 10 #define CHROME_RENDERER_SAFE_BROWSING_MALWARE_DOM_DETAILS_H_ | 10 #define CHROME_RENDERER_SAFE_BROWSING_MALWARE_DOM_DETAILS_H_ |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 namespace safe_browsing { | 31 namespace safe_browsing { |
| 32 | 32 |
| 33 // There is one MalwareDOMDetails per RenderView. | 33 // There is one MalwareDOMDetails per RenderView. |
| 34 class MalwareDOMDetails : public RenderViewObserver { | 34 class MalwareDOMDetails : public RenderViewObserver { |
| 35 public: | 35 public: |
| 36 // An upper limit on the number of nodes we collect. Not const for the test. | 36 // An upper limit on the number of nodes we collect. Not const for the test. |
| 37 static uint32 kMaxNodes; | 37 static uint32 kMaxNodes; |
| 38 | 38 |
| 39 static MalwareDOMDetails* Create(RenderView* render_view); | 39 static MalwareDOMDetails* Create(RenderView* render_view); |
| 40 ~MalwareDOMDetails(); | 40 virtual ~MalwareDOMDetails(); |
| 41 | 41 |
| 42 // Begins extracting resource urls for the page currently loaded in | 42 // Begins extracting resource urls for the page currently loaded in |
| 43 // this object's RenderView. | 43 // this object's RenderView. |
| 44 void ExtractResources( | 44 void ExtractResources( |
| 45 std::vector<SafeBrowsingHostMsg_MalwareDOMDetails_Node>* resources); | 45 std::vector<SafeBrowsingHostMsg_MalwareDOMDetails_Node>* resources); |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 // Creates a MalwareDOMDetails for the specified RenderView. | 48 // Creates a MalwareDOMDetails for the specified RenderView. |
| 49 // The MalwareDOMDetails should be destroyed prior to destroying | 49 // The MalwareDOMDetails should be destroyed prior to destroying |
| 50 // the RenderView. | 50 // the RenderView. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 63 | 63 |
| 64 // Non-owned pointer to the view that we will extract features from. | 64 // Non-owned pointer to the view that we will extract features from. |
| 65 RenderView* render_view_; | 65 RenderView* render_view_; |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(MalwareDOMDetails); | 67 DISALLOW_COPY_AND_ASSIGN(MalwareDOMDetails); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace safe_browsing | 70 } // namespace safe_browsing |
| 71 | 71 |
| 72 #endif // CHROME_RENDERER_SAFE_BROWSING_MALWARE_DOM_DETAILS_H_ | 72 #endif // CHROME_RENDERER_SAFE_BROWSING_MALWARE_DOM_DETAILS_H_ |
| OLD | NEW |