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

Unified Diff: components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.h

Issue 2691423006: Introduce the ThrottleManager (Closed)
Patch Set: update NavigationSimulator description 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
Index: components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.h
diff --git a/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.h b/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.h
index 2fc7917078c317e52381175990f1d4f19a0c59f1..ab45a6183cddea1682313743c13f6e8aeac1370d 100644
--- a/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.h
+++ b/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.h
@@ -63,22 +63,23 @@ class ActivationStateComputingNavigationThrottle
// frame.
std::unique_ptr<AsyncDocumentSubresourceFilter> ReleaseFilter();
- // Gets the activation state calculated for this navigation. Must be called
- // after the navigation is resumed from getting paused in WillProcessResponse,
- // which, for example, will have happened at ReadyToCommitNavigation.
- const ActivationState& GetActivationState() const;
+ AsyncDocumentSubresourceFilter* filter() { return async_filter_.get(); }
+
+ void WillSendActivationToRenderer();
private:
- void SetActivationStateAndResume(ActivationState state);
+ void OnActivationStateComputed(ActivationState state);
+ void set_async_filter(
engedy 2017/03/20 18:58:14 nit: set_filter for consistency with methods above
Charlie Harrison 2017/03/20 20:02:56 Done.
+ std::unique_ptr<AsyncDocumentSubresourceFilter> async_filter) {
+ async_filter_ = std::move(async_filter);
+ }
ActivationStateComputingNavigationThrottle(
content::NavigationHandle* navigation_handle,
const base::Optional<ActivationState> parent_activation_state,
VerifiedRuleset::Handle* ruleset_handle);
- // These members are optional to allow DCHECKing their existence at certain
- // points in the navigation flow.
- base::Optional<ActivationState> activation_state_;
+ // Optional to allow for DCHECKing.
base::Optional<ActivationState> parent_activation_state_;
std::unique_ptr<AsyncDocumentSubresourceFilter> async_filter_;
@@ -87,6 +88,12 @@ class ActivationStateComputingNavigationThrottle
// nullptr until NotifyPageActivationWithRuleset is called.
VerifiedRuleset::Handle* ruleset_handle_;
+ // Becomes set to true when the throttle manager reaches
engedy 2017/03/20 18:58:14 nit: s/set to//
Charlie Harrison 2017/03/20 20:02:56 Done.
+ // ReadyToCommitNavigation and sends an activation IPC to the render process.
+ // Makes sure a caller cannot take ownership of the subresource filter unless
+ // an activation IPC is sent to the renderer.
+ bool will_send_activation_to_renderer_ = false;
+
base::WeakPtrFactory<ActivationStateComputingNavigationThrottle>
weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698