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

Unified Diff: chrome/renderer/safe_browsing/threat_dom_details.h

Issue 2756933003: Componentize safe_browsing: move renderer/ reporting part for WebView. (Closed)
Patch Set: fix 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/safe_browsing/DEPS ('k') | chrome/renderer/safe_browsing/threat_dom_details.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/safe_browsing/threat_dom_details.h
diff --git a/chrome/renderer/safe_browsing/threat_dom_details.h b/chrome/renderer/safe_browsing/threat_dom_details.h
deleted file mode 100644
index e5b947d04635840eace883a377e91cb1df553b69..0000000000000000000000000000000000000000
--- a/chrome/renderer/safe_browsing/threat_dom_details.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// ThreatDOMDetails iterates over a document's frames and gathers
-// interesting URLs such as those of scripts and frames. When done, it sends
-// them to the ThreatDetails that requested them.
-
-#ifndef CHROME_RENDERER_SAFE_BROWSING_THREAT_DOM_DETAILS_H_
-#define CHROME_RENDERER_SAFE_BROWSING_THREAT_DOM_DETAILS_H_
-
-#include <vector>
-
-#include "base/compiler_specific.h"
-#include "base/feature_list.h"
-#include "content/public/renderer/render_frame_observer.h"
-
-struct SafeBrowsingHostMsg_ThreatDOMDetails_Node;
-
-namespace safe_browsing {
-
-extern const base::Feature kThreatDomDetailsTagAndAttributeFeature;
-extern const char kTagAndAttributeParamName[];
-
-// Represents the tag name of an HTML Element and its associated attributes.
-// Used to determine which elements to collect. Populated from the param value
-// of |kThreatDomDetailsTagAndAttributeFeature|.
-class TagAndAttributesItem {
- public:
- TagAndAttributesItem();
- TagAndAttributesItem(const TagAndAttributesItem& item);
- ~TagAndAttributesItem();
-
- std::string tag_name;
- std::vector<std::string> attributes;
-};
-
-// There is one ThreatDOMDetails per RenderFrame.
-class ThreatDOMDetails : public content::RenderFrameObserver {
- public:
- // An upper limit on the number of nodes we collect. Not const for the test.
- static uint32_t kMaxNodes;
-
- // An upper limit on the number of attributes to collect per node. Not const
- // for the test.
- static uint32_t kMaxAttributes;
-
- // An upper limit on the length of an attribute string.
- static uint32_t kMaxAttributeStringLength;
-
- static ThreatDOMDetails* Create(content::RenderFrame* render_frame);
- ~ThreatDOMDetails() override;
-
- // Begins extracting resource urls for the page currently loaded in
- // this object's RenderFrame.
- // Exposed for testing.
- void ExtractResources(
- std::vector<SafeBrowsingHostMsg_ThreatDOMDetails_Node>* resources);
-
- private:
- // Creates a ThreatDOMDetails for the specified RenderFrame.
- // The ThreatDOMDetails should be destroyed prior to destroying
- // the RenderFrame.
- explicit ThreatDOMDetails(content::RenderFrame* render_frame);
-
- // RenderFrameObserver implementation.
- bool OnMessageReceived(const IPC::Message& message) override;
- void OnDestruct() override;
-
- void OnGetThreatDOMDetails();
-
- // A list of tag names and associates attributes, used to determine which
- // elements need to be collected.
- std::vector<TagAndAttributesItem> tag_and_attributes_list_;
-
- DISALLOW_COPY_AND_ASSIGN(ThreatDOMDetails);
-};
-
-} // namespace safe_browsing
-
-#endif // CHROME_RENDERER_SAFE_BROWSING_THREAT_DOM_DETAILS_H_
« no previous file with comments | « chrome/renderer/safe_browsing/DEPS ('k') | chrome/renderer/safe_browsing/threat_dom_details.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698