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

Unified Diff: components/subresource_filter/content/renderer/subresource_filter_agent.h

Issue 2022783002: Skeleton of the Safe Browsing Subresource Filter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement RenderFrameObserver::OnDestruct introduced by rebase. Created 4 years, 6 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
Index: components/subresource_filter/content/renderer/subresource_filter_agent.h
diff --git a/components/subresource_filter/content/renderer/subresource_filter_agent.h b/components/subresource_filter/content/renderer/subresource_filter_agent.h
new file mode 100644
index 0000000000000000000000000000000000000000..e887623ba8bb40e06e98047e72ab3e0933c594a0
--- /dev/null
+++ b/components/subresource_filter/content/renderer/subresource_filter_agent.h
@@ -0,0 +1,42 @@
+// Copyright 2016 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.
+
+#ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_RENDERER_SUBRESOURCE_FILTER_AGENT_H_
+#define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_RENDERER_SUBRESOURCE_FILTER_AGENT_H_
+
+#include "base/macros.h"
+#include "components/subresource_filter/core/common/activation_state.h"
+#include "content/public/renderer/render_frame_observer.h"
+
+namespace subresource_filter {
+
+// The renderer-side agent of the ContentSubresourceFilterDriver. There is one
+// instance per RenderFrame, responsible for setting up the subresource filter
+// for the ongoing provisional document load in the frame when instructed to do
+// so by the driver.
+class SubresourceFilterAgent : public content::RenderFrameObserver {
+ public:
+ explicit SubresourceFilterAgent(content::RenderFrame* render_frame);
+ ~SubresourceFilterAgent() override;
+
+ private:
+ // content::RenderFrameObserver:
+ void OnDestruct() override;
+ void DidStartProvisionalLoad() override;
+ void DidCommitProvisionalLoad(bool is_new_navigation,
+ bool is_same_page_navigation) override;
+
+ // content::RenderFrameObserver:
+ bool OnMessageReceived(const IPC::Message& message) override;
+
+ void OnActivateForProvisionalLoad(ActivationState activation_state);
+
+ ActivationState activation_state_for_provisional_load_;
+
+ DISALLOW_COPY_AND_ASSIGN(SubresourceFilterAgent);
+};
+
+} // namespace subresource_filter
+
+#endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_RENDERER_SUBRESOURCE_FILTER_AGENT_H_

Powered by Google App Engine
This is Rietveld 408576698