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

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

Issue 2691423006: Introduce the ThrottleManager (Closed)
Patch Set: rebase 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/async_document_subresource_filter.h
diff --git a/components/subresource_filter/content/browser/async_document_subresource_filter.h b/components/subresource_filter/content/browser/async_document_subresource_filter.h
index 3d4c9dd3f33ed745269e7be226707cc94ea2b57a..ae7a2b55d10b149cee1d1071825e4b7c608a69d5 100644
--- a/components/subresource_filter/content/browser/async_document_subresource_filter.h
+++ b/components/subresource_filter/content/browser/async_document_subresource_filter.h
@@ -104,14 +104,27 @@ class AsyncDocumentSubresourceFilter {
// |task_runner|.
void ReportDisallowedLoad();
+ // Must be called after activation state computation is finished.
+ const ActivationState& activation_state() const {
+ return activation_state_.value();
+ }
+
private:
+ void OnActivateStateCalculated(
+ base::Callback<void(ActivationState)> activation_state_callback,
+ ActivationState activation_state);
+
// Note: Raw pointer, |core_| already holds a reference to |task_runner_|.
base::SequencedTaskRunner* task_runner_;
std::unique_ptr<Core, base::OnTaskRunnerDeleter> core_;
base::OnceClosure first_disallowed_load_callback_;
+ base::Optional<ActivationState> activation_state_;
+
base::ThreadChecker thread_checker_;
+ base::WeakPtrFactory<AsyncDocumentSubresourceFilter> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(AsyncDocumentSubresourceFilter);
};

Powered by Google App Engine
This is Rietveld 408576698