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

Side by Side Diff: chrome/renderer/safe_browsing/threat_dom_details.h

Issue 2713233002: Update ThreatDOMDetails to be able to collect non-resource HTML Elements based on their attributes. (Closed)
Patch Set: Address comments Created 3 years, 9 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
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 // ThreatDOMDetails iterates over a document's frames and gathers 5 // ThreatDOMDetails 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 ThreatDetails that requested them. 7 // them to the ThreatDetails that requested them.
8 8
9 #ifndef CHROME_RENDERER_SAFE_BROWSING_THREAT_DOM_DETAILS_H_ 9 #ifndef CHROME_RENDERER_SAFE_BROWSING_THREAT_DOM_DETAILS_H_
10 #define CHROME_RENDERER_SAFE_BROWSING_THREAT_DOM_DETAILS_H_ 10 #define CHROME_RENDERER_SAFE_BROWSING_THREAT_DOM_DETAILS_H_
11 11
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/feature_list.h"
15 #include "content/public/renderer/render_frame_observer.h" 16 #include "content/public/renderer/render_frame_observer.h"
16 17
17 struct SafeBrowsingHostMsg_ThreatDOMDetails_Node; 18 struct SafeBrowsingHostMsg_ThreatDOMDetails_Node;
18 19
19 namespace safe_browsing { 20 namespace safe_browsing {
20 21
22 extern const base::Feature kThreatDomDetailsTagAndAttributeFeature;
23 extern const char kTagAndAttributeParamName[];
24
21 // There is one ThreatDOMDetails per RenderFrame. 25 // There is one ThreatDOMDetails per RenderFrame.
22 class ThreatDOMDetails : public content::RenderFrameObserver { 26 class ThreatDOMDetails : public content::RenderFrameObserver {
23 public: 27 public:
24 // An upper limit on the number of nodes we collect. Not const for the test. 28 // An upper limit on the number of nodes we collect. Not const for the test.
25 static uint32_t kMaxNodes; 29 static uint32_t kMaxNodes;
26 30
27 static ThreatDOMDetails* Create(content::RenderFrame* render_frame); 31 static ThreatDOMDetails* Create(content::RenderFrame* render_frame);
28 ~ThreatDOMDetails() override; 32 ~ThreatDOMDetails() override;
29 33
30 // Begins extracting resource urls for the page currently loaded in 34 // Begins extracting resource urls for the page currently loaded in
(...skipping 13 matching lines...) Expand all
44 void OnDestruct() override; 48 void OnDestruct() override;
45 49
46 void OnGetThreatDOMDetails(); 50 void OnGetThreatDOMDetails();
47 51
48 DISALLOW_COPY_AND_ASSIGN(ThreatDOMDetails); 52 DISALLOW_COPY_AND_ASSIGN(ThreatDOMDetails);
49 }; 53 };
50 54
51 } // namespace safe_browsing 55 } // namespace safe_browsing
52 56
53 #endif // CHROME_RENDERER_SAFE_BROWSING_THREAT_DOM_DETAILS_H_ 57 #endif // CHROME_RENDERER_SAFE_BROWSING_THREAT_DOM_DETAILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698