Miscellaneous: change absl::optional to std::optional
This commit is contained in:
@@ -977,7 +977,7 @@ new file mode 100644
|
||||
+ }
|
||||
+
|
||||
+ if (const std::string* pacURL = config.FindString("pac_url")) {
|
||||
+ absl::optional<bool> pacMandatory = config.FindBool("pac_mandatory");
|
||||
+ std::optional<bool> pacMandatory = config.FindBool("pac_mandatory");
|
||||
+ auto proxyConfig = net::ProxyConfig::CreateFromCustomPacURL(
|
||||
+ GURL(*pacURL));
|
||||
+ proxyConfig.set_pac_mandatory(pacMandatory.value_or(false));
|
||||
@@ -1037,7 +1037,7 @@ new file mode 100644
|
||||
+ if (bypass_rules == nullptr)
|
||||
+ return;
|
||||
+
|
||||
+ absl::optional<bool> reverse_bypass = rules->FindBool("reverse_bypass");
|
||||
+ std::optional<bool> reverse_bypass = rules->FindBool("reverse_bypass");
|
||||
+
|
||||
+ proxyConfig.proxy_rules().bypass_rules.ParseFromString(*bypass_rules);
|
||||
+ proxyConfig.proxy_rules().reverse_bypass = reverse_bypass.value_or(false);
|
||||
|
||||
@@ -82,7 +82,7 @@ diff --git a/content/browser/network/cross_origin_embedder_policy_reporter.cc b/
|
||||
kType, context_url_, blink::mojom::ReportBody::New(std::move(list))));
|
||||
}
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
+ const absl::optional<std::string>& endpoint =
|
||||
+ const std::optional<std::string>& endpoint =
|
||||
+ report_only ? report_only_endpoint_ : endpoint_;
|
||||
if (endpoint) {
|
||||
base::Value::Dict body_to_pass;
|
||||
|
||||
@@ -5414,7 +5414,7 @@ new file mode 100755
|
||||
+ MatchesPath(StripTrailingWildcard(other.path()));
|
||||
+}
|
||||
+
|
||||
+absl::optional<URLPattern> URLPattern::CreateIntersection(
|
||||
+std::optional<URLPattern> URLPattern::CreateIntersection(
|
||||
+ const URLPattern& other) const {
|
||||
+ // Easy case: Schemes don't overlap. Return nullopt.
|
||||
+ int intersection_schemes = URLPattern::SCHEME_NONE;
|
||||
@@ -5816,7 +5816,7 @@ new file mode 100755
|
||||
+ // contains another, it will be handled correctly, but this method does not
|
||||
+ // deal with cases like /*a* and /*b* (where technically the intersection
|
||||
+ // is /*a*b*|/*b*a*); the intersection returned for that case will be empty.
|
||||
+ absl::optional<URLPattern> CreateIntersection(const URLPattern& other) const;
|
||||
+ std::optional<URLPattern> CreateIntersection(const URLPattern& other) const;
|
||||
+
|
||||
+ // Converts this URLPattern into an equivalent set of URLPatterns that don't
|
||||
+ // use a wildcard in the scheme component. If this URLPattern doesn't use a
|
||||
@@ -5984,7 +5984,7 @@ new file mode 100755
|
||||
+ // they have with the other patterns.
|
||||
+ for (const auto* pattern : unique_set1) {
|
||||
+ for (const auto* pattern2 : unique_set2) {
|
||||
+ absl::optional<URLPattern> intersection =
|
||||
+ std::optional<URLPattern> intersection =
|
||||
+ pattern->CreateIntersection(*pattern2);
|
||||
+ if (intersection)
|
||||
+ result.patterns_.insert(std::move(*intersection));
|
||||
@@ -8280,7 +8280,7 @@ new file mode 100755
|
||||
+ }
|
||||
+
|
||||
+void ScriptInjection::OnJsInjectionCompleted(
|
||||
+ absl::optional<base::Value> results,
|
||||
+ std::optional<base::Value> results,
|
||||
+ base::TimeTicks start_time) {
|
||||
+ DCHECK(!did_inject_js_);
|
||||
+
|
||||
@@ -8304,13 +8304,13 @@ new file mode 100755
|
||||
+ run_location_, injected_stylesheets, num_injected_stylesheets);
|
||||
+ blink::WebLocalFrame* web_frame = render_frame_->GetWebFrame();
|
||||
+ // Default CSS origin is "author", but can be overridden to "user" by scripts.
|
||||
+ absl::optional<CSSOrigin> css_origin = injector_->GetCssOrigin();
|
||||
+ std::optional<CSSOrigin> css_origin = injector_->GetCssOrigin();
|
||||
+ blink::WebCssOrigin blink_css_origin =
|
||||
+ css_origin && *css_origin == CSS_ORIGIN_USER
|
||||
+ ? blink::WebCssOrigin::kUser
|
||||
+ : blink::WebCssOrigin::kAuthor;
|
||||
+ blink::WebStyleSheetKey style_sheet_key;
|
||||
+ if (const absl::optional<std::string>& injection_key =
|
||||
+ if (const std::optional<std::string>& injection_key =
|
||||
+ injector_->GetInjectionKey())
|
||||
+ style_sheet_key = blink::WebString::FromASCII(*injection_key);
|
||||
+ for (const blink::WebString& css : css_sources)
|
||||
@@ -8414,7 +8414,7 @@ new file mode 100755
|
||||
+
|
||||
+ // Called when JS injection for the given frame has been completed or
|
||||
+ // cancelled.
|
||||
+ void OnJsInjectionCompleted(absl::optional<base::Value> results,
|
||||
+ void OnJsInjectionCompleted(std::optional<base::Value> results,
|
||||
+ base::TimeTicks start_time);
|
||||
+
|
||||
+ private:
|
||||
@@ -8465,7 +8465,7 @@ new file mode 100755
|
||||
+ bool log_activity_;
|
||||
+
|
||||
+ // Results storage.
|
||||
+ absl::optional<base::Value> execution_result_;
|
||||
+ std::optional<base::Value> execution_result_;
|
||||
+
|
||||
+ // The callback to run upon completing asynchronously.
|
||||
+ CompletionCallback async_completion_callback_;
|
||||
@@ -9052,10 +9052,10 @@ new file mode 100755
|
||||
+ virtual bool IsUserGesture() const = 0;
|
||||
+
|
||||
+ // Returns the CSS origin of this injection.
|
||||
+ virtual absl::optional<CSSOrigin> GetCssOrigin() const = 0;
|
||||
+ virtual std::optional<CSSOrigin> GetCssOrigin() const = 0;
|
||||
+
|
||||
+ // Returns the key for this injection, if it's a CSS injection.
|
||||
+ virtual const absl::optional<std::string> GetInjectionKey() const = 0;
|
||||
+ virtual const std::optional<std::string> GetInjectionKey() const = 0;
|
||||
+
|
||||
+ // Returns true if the script expects results.
|
||||
+ virtual bool ExpectsResults() const = 0;
|
||||
@@ -9090,7 +9090,7 @@ new file mode 100755
|
||||
+ // |render_frame| contains the render frame, or null if the frame was
|
||||
+ // invalidated.
|
||||
+ virtual void OnInjectionComplete(
|
||||
+ absl::optional<base::Value> execution_result,
|
||||
+ std::optional<base::Value> execution_result,
|
||||
+ UserScript::RunLocation run_location,
|
||||
+ content::RenderFrame* render_frame) = 0;
|
||||
+
|
||||
@@ -9355,11 +9355,11 @@ new file mode 100755
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+absl::optional<CSSOrigin> UserScriptInjector::GetCssOrigin() const {
|
||||
+std::optional<CSSOrigin> UserScriptInjector::GetCssOrigin() const {
|
||||
+ return absl::nullopt;
|
||||
+}
|
||||
+
|
||||
+const absl::optional<std::string> UserScriptInjector::GetInjectionKey() const {
|
||||
+const std::optional<std::string> UserScriptInjector::GetInjectionKey() const {
|
||||
+ return absl::nullopt;
|
||||
+}
|
||||
+
|
||||
@@ -9437,7 +9437,7 @@ new file mode 100755
|
||||
+}
|
||||
+
|
||||
+void UserScriptInjector::OnInjectionComplete(
|
||||
+ absl::optional<base::Value> execution_result,
|
||||
+ std::optional<base::Value> execution_result,
|
||||
+ UserScript::RunLocation run_location,
|
||||
+ content::RenderFrame* render_frame) {}
|
||||
+
|
||||
@@ -9493,8 +9493,8 @@ new file mode 100755
|
||||
+ // ScriptInjector implementation.
|
||||
+ UserScript::InjectionType script_type() const override;
|
||||
+ bool IsUserGesture() const override;
|
||||
+ absl::optional<CSSOrigin> GetCssOrigin() const override;
|
||||
+ const absl::optional<std::string> GetInjectionKey() const override;
|
||||
+ std::optional<CSSOrigin> GetCssOrigin() const override;
|
||||
+ const std::optional<std::string> GetInjectionKey() const override;
|
||||
+ bool ExpectsResults() const override;
|
||||
+ bool ShouldInjectJs(
|
||||
+ UserScript::RunLocation run_location,
|
||||
@@ -9510,7 +9510,7 @@ new file mode 100755
|
||||
+ UserScript::RunLocation run_location,
|
||||
+ std::set<std::string>* injected_stylesheets,
|
||||
+ size_t* num_injected_stylesheets) const override;
|
||||
+ void OnInjectionComplete(absl::optional<base::Value> execution_result,
|
||||
+ void OnInjectionComplete(std::optional<base::Value> execution_result,
|
||||
+ UserScript::RunLocation run_location,
|
||||
+ content::RenderFrame* render_frame) override;
|
||||
+ void OnWillNotInject(InjectFailureReason reason,
|
||||
|
||||
@@ -350,7 +350,7 @@ diff --git a/chrome/browser/adblock/adblock_content_browser_client.cc b/chrome/b
|
||||
const GURL& url,
|
||||
+ const url::Origin& initiator_origin,
|
||||
const net::SiteForCookies& site_for_cookies,
|
||||
- const absl::optional<std::string>& user_agent,
|
||||
- const std::optional<std::string>& user_agent,
|
||||
+ const std::optional<std::string>& user_agent,
|
||||
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
|
||||
handshake_client) {
|
||||
@@ -378,7 +378,7 @@ diff --git a/chrome/browser/adblock/adblock_content_browser_client.cc b/chrome/b
|
||||
const GURL& url,
|
||||
+ const url::Origin& initiator_origin,
|
||||
const net::SiteForCookies& site_for_cookies,
|
||||
- const absl::optional<std::string>& user_agent,
|
||||
- const std::optional<std::string>& user_agent,
|
||||
+ const std::optional<std::string>& user_agent,
|
||||
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
|
||||
handshake_client) {
|
||||
@@ -413,7 +413,7 @@ diff --git a/chrome/browser/adblock/adblock_content_browser_client.cc b/chrome/b
|
||||
const GURL& url,
|
||||
+ const url::Origin& initiator_origin,
|
||||
const net::SiteForCookies& site_for_cookies,
|
||||
- const absl::optional<std::string>& user_agent,
|
||||
- const std::optional<std::string>& user_agent,
|
||||
+ const std::optional<std::string>& user_agent,
|
||||
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
|
||||
handshake_client,
|
||||
@@ -563,7 +563,7 @@ diff --git a/chrome/browser/adblock/adblock_content_browser_client.cc b/chrome/b
|
||||
int render_process_id,
|
||||
URLLoaderFactoryType type,
|
||||
const url::Origin& request_initiator,
|
||||
- absl::optional<int64_t> navigation_id,
|
||||
- std::optional<int64_t> navigation_id,
|
||||
+ const net::IsolationInfo& isolation_info,
|
||||
+ std::optional<int64_t> navigation_id,
|
||||
ukm::SourceIdObj ukm_source_id,
|
||||
@@ -643,7 +643,7 @@ diff --git a/chrome/browser/adblock/adblock_content_browser_client.h b/chrome/br
|
||||
const GURL& url,
|
||||
+ const url::Origin& initiator_origin,
|
||||
const net::SiteForCookies& site_for_cookies,
|
||||
- const absl::optional<std::string>& user_agent,
|
||||
- const std::optional<std::string>& user_agent,
|
||||
+ const std::optional<std::string>& user_agent,
|
||||
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
|
||||
handshake_client) override;
|
||||
@@ -664,7 +664,7 @@ diff --git a/chrome/browser/adblock/adblock_content_browser_client.h b/chrome/br
|
||||
int render_process_id,
|
||||
URLLoaderFactoryType type,
|
||||
const url::Origin& request_initiator,
|
||||
- absl::optional<int64_t> navigation_id,
|
||||
- std::optional<int64_t> navigation_id,
|
||||
+ const net::IsolationInfo& isolation_info,
|
||||
+ std::optional<int64_t> navigation_id,
|
||||
ukm::SourceIdObj ukm_source_id,
|
||||
@@ -699,7 +699,7 @@ diff --git a/chrome/browser/adblock/adblock_content_browser_client.h b/chrome/br
|
||||
const GURL& url,
|
||||
+ const url::Origin& initiator_origin,
|
||||
const net::SiteForCookies& site_for_cookies,
|
||||
- const absl::optional<std::string>& user_agent,
|
||||
- const std::optional<std::string>& user_agent,
|
||||
+ const std::optional<std::string>& user_agent,
|
||||
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
|
||||
handshake_client);
|
||||
@@ -710,7 +710,7 @@ diff --git a/chrome/browser/adblock/adblock_content_browser_client.h b/chrome/br
|
||||
const GURL& url,
|
||||
+ const url::Origin& initiator_origin,
|
||||
const net::SiteForCookies& site_for_cookies,
|
||||
- const absl::optional<std::string>& user_agent,
|
||||
- const std::optional<std::string>& user_agent,
|
||||
+ const std::optional<std::string>& user_agent,
|
||||
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
|
||||
handshake_client,
|
||||
@@ -854,7 +854,7 @@ diff --git a/chrome/browser/extensions/api/adblock_private/adblock_private_api.c
|
||||
+AdblockPrivateSetPrivilegedFiltersEnabledFunction::~AdblockPrivateSetPrivilegedFiltersEnabledFunction() {}
|
||||
+
|
||||
+ExtensionFunction::ResponseAction AdblockPrivateSetPrivilegedFiltersEnabledFunction::Run() {
|
||||
+ absl::optional<api::adblock_private::SetEnabled::Params> params =
|
||||
+ std::optional<api::adblock_private::SetEnabled::Params> params =
|
||||
+ api::adblock_private::SetEnabled::Params::Create(args());
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
+
|
||||
@@ -4357,7 +4357,7 @@ diff --git a/components/adblock/core/converter/flatbuffer_converter.cc b/compone
|
||||
diff --git a/components/adblock/core/converter/parser/metadata.cc b/components/adblock/core/converter/parser/metadata.cc
|
||||
--- a/components/adblock/core/converter/parser/metadata.cc
|
||||
+++ b/components/adblock/core/converter/parser/metadata.cc
|
||||
@@ -58,13 +58,6 @@ absl::optional<Metadata> Metadata::FromStream(std::istream& filter_stream) {
|
||||
@@ -58,13 +58,6 @@ std::optional<Metadata> Metadata::FromStream(std::istream& filter_stream) {
|
||||
if (key == "homepage") {
|
||||
homepage = value;
|
||||
} else if (key == "redirect") {
|
||||
@@ -4428,7 +4428,7 @@ diff --git a/components/adblock/core/converter/parser/url_filter.cc b/components
|
||||
piece.remove_suffix(1);
|
||||
}
|
||||
if (piece.find('|') == base::StringPiece::npos) {
|
||||
@@ -108,21 +112,21 @@ absl::optional<UrlFilter> UrlFilter::FromString(std::string filter_str) {
|
||||
@@ -108,21 +112,21 @@ std::optional<UrlFilter> UrlFilter::FromString(std::string filter_str) {
|
||||
|
||||
if (options->Csp().has_value() && options->Csp().value().empty() &&
|
||||
!is_allowing) {
|
||||
@@ -4456,7 +4456,7 @@ diff --git a/components/adblock/core/converter/parser/url_filter.cc b/components
|
||||
diff --git a/components/adblock/core/converter/parser/url_filter_options.cc b/components/adblock/core/converter/parser/url_filter_options.cc
|
||||
--- a/components/adblock/core/converter/parser/url_filter_options.cc
|
||||
+++ b/components/adblock/core/converter/parser/url_filter_options.cc
|
||||
@@ -88,20 +88,14 @@ absl::optional<UrlFilterOptions> UrlFilterOptions::FromString(
|
||||
@@ -88,20 +88,14 @@ std::optional<UrlFilterOptions> UrlFilterOptions::FromString(
|
||||
}
|
||||
domains = DomainOption::FromString(value, kDomainOrSitekeySeparator);
|
||||
} else if (key == "sitekey") {
|
||||
@@ -4483,7 +4483,7 @@ diff --git a/components/adblock/core/converter/parser/url_filter_options.cc b/co
|
||||
} else {
|
||||
ContentType content_type = ContentTypeFromString(key);
|
||||
if (content_type != ContentType::Unknown) {
|
||||
@@ -184,6 +178,7 @@ absl::optional<UrlFilterOptions::RewriteOption> UrlFilterOptions::ParseRewrite(
|
||||
@@ -184,6 +178,7 @@ std::optional<UrlFilterOptions::RewriteOption> UrlFilterOptions::ParseRewrite(
|
||||
// static
|
||||
SiteKeys UrlFilterOptions::ParseSitekeys(const std::string& sitekey_value) {
|
||||
SiteKeys sitekeys;
|
||||
@@ -4663,7 +4663,7 @@ diff --git a/components/adblock/core/sitekey_storage_impl.cc b/components/adbloc
|
||||
return;
|
||||
@@ -53,6 +55,7 @@ void SitekeyStorageImpl::ProcessResponseHeaders(
|
||||
|
||||
absl::optional<std::pair<GURL, SiteKey>>
|
||||
std::optional<std::pair<GURL, SiteKey>>
|
||||
SitekeyStorageImpl::FindSiteKeyForAnyUrl(const std::vector<GURL>& urls) const {
|
||||
+ if ((true)) return {};
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
@@ -548,13 +548,13 @@ new file mode 100644
|
||||
+ return it->second.allowed;
|
||||
+}
|
||||
+
|
||||
+absl::optional<builders::EntryDecoder> FirewallService::GetEntry(
|
||||
+std::optional<builders::EntryDecoder> FirewallService::GetEntry(
|
||||
+ int32_t unique_id_hash_code) const {
|
||||
+ const auto it = decode_map_.find(unique_id_hash_code);
|
||||
+ if (it == decode_map_.end())
|
||||
+ return absl::nullopt;
|
||||
+
|
||||
+ return absl::optional<builders::EntryDecoder>(it->second);
|
||||
+ return std::optional<builders::EntryDecoder>(it->second);
|
||||
+}
|
||||
+
|
||||
+}
|
||||
@@ -608,7 +608,7 @@ new file mode 100644
|
||||
+ ~FirewallService();
|
||||
+
|
||||
+ bool IsAllowed(int32_t unique_id_hash_code);
|
||||
+ absl::optional<builders::EntryDecoder> GetEntry(int32_t unique_id_hash_code) const;
|
||||
+ std::optional<builders::EntryDecoder> GetEntry(int32_t unique_id_hash_code) const;
|
||||
+
|
||||
+ private:
|
||||
+ raw_ptr<PrefService> pref_service_;
|
||||
|
||||
@@ -2654,7 +2654,7 @@ new file mode 100644
|
||||
+ const std::vector<std::string>& removed_headers,
|
||||
+ const net::HttpRequestHeaders& modified_headers,
|
||||
+ const net::HttpRequestHeaders& modified_cors_exempt_headers,
|
||||
+ const absl::optional<GURL>& new_url) override;
|
||||
+ const std::optional<GURL>& new_url) override;
|
||||
+ void SetPriority(net::RequestPriority priority,
|
||||
+ int32_t intra_priority_value) override;
|
||||
+ void PauseReadingBodyFromNet() override;
|
||||
@@ -2665,7 +2665,7 @@ new file mode 100644
|
||||
+ void OnReceiveResponse(
|
||||
+ ::network::mojom::URLResponseHeadPtr head,
|
||||
+ ::mojo::ScopedDataPipeConsumerHandle body,
|
||||
+ absl::optional<mojo_base::BigBuffer> cached_metadata) override;
|
||||
+ std::optional<mojo_base::BigBuffer> cached_metadata) override;
|
||||
+ void OnReceiveRedirect(const ::net::RedirectInfo& redirect_info,
|
||||
+ ::network::mojom::URLResponseHeadPtr head) override;
|
||||
+ void OnUploadProgress(int64_t current_position,
|
||||
@@ -2679,7 +2679,7 @@ new file mode 100644
|
||||
+ base::OnceCallback<void(FilterMatchResult,
|
||||
+ network::mojom::ParsedHeadersPtr)>;
|
||||
+ using CheckRewriteFilterMatchCallback =
|
||||
+ base::OnceCallback<void(const absl::optional<GURL>&)>;
|
||||
+ base::OnceCallback<void(const std::optional<GURL>&)>;
|
||||
+
|
||||
+ void OnBindingsClosed();
|
||||
+ void OnClientDisconnected();
|
||||
@@ -2688,7 +2688,7 @@ new file mode 100644
|
||||
+ const net::MutableNetworkTrafficAnnotationTag& traffic_annotation,
|
||||
+ mojo::PendingReceiver<network::mojom::URLLoader> target_loader,
|
||||
+ mojo::PendingRemote<network::mojom::URLLoaderClient> proxy_client,
|
||||
+ const absl::optional<GURL>& rewrite);
|
||||
+ const std::optional<GURL>& rewrite);
|
||||
+ void OnRequestFilterMatchResult(
|
||||
+ ::mojo::PendingReceiver<network::mojom::URLLoader> loader,
|
||||
+ uint32_t options,
|
||||
@@ -2702,7 +2702,7 @@ new file mode 100644
|
||||
+ void OnProcessHeadersResult(
|
||||
+ ::network::mojom::URLResponseHeadPtr head,
|
||||
+ ::mojo::ScopedDataPipeConsumerHandle body,
|
||||
+ absl::optional<mojo_base::BigBuffer> cached_metadata,
|
||||
+ std::optional<mojo_base::BigBuffer> cached_metadata,
|
||||
+ FilterMatchResult result,
|
||||
+ network::mojom::ParsedHeadersPtr parsed_headers);
|
||||
+ void OnRequestError(int error_code);
|
||||
@@ -2724,8 +2724,8 @@ new file mode 100644
|
||||
+ FilterMatchResult result,
|
||||
+ network::mojom::ParsedHeadersPtr parsed_headers);
|
||||
+ void PostRewriteCallbackToUI(
|
||||
+ base::OnceCallback<void(const absl::optional<GURL>&)> callback,
|
||||
+ const absl::optional<GURL>& url);
|
||||
+ base::OnceCallback<void(const std::optional<GURL>&)> callback,
|
||||
+ const std::optional<GURL>& url);
|
||||
+
|
||||
+ GURL request_url_;
|
||||
+ int request_id_;
|
||||
@@ -2780,7 +2780,7 @@ new file mode 100644
|
||||
+ const std::vector<std::string>& removed_headers,
|
||||
+ const net::HttpRequestHeaders& modified_headers,
|
||||
+ const net::HttpRequestHeaders& modified_cors_exempt_headers,
|
||||
+ const absl::optional<GURL>& new_url) {
|
||||
+ const std::optional<GURL>& new_url) {
|
||||
+ if (target_loader_.is_bound()) {
|
||||
+ target_loader_->FollowRedirect(removed_headers, modified_headers,
|
||||
+ modified_cors_exempt_headers, new_url);
|
||||
@@ -2815,7 +2815,7 @@ new file mode 100644
|
||||
+void AdblockURLLoaderFactory::InProgressRequest::OnReceiveResponse(
|
||||
+ network::mojom::URLResponseHeadPtr head,
|
||||
+ mojo::ScopedDataPipeConsumerHandle body,
|
||||
+ absl::optional<mojo_base::BigBuffer> cached_metadata) {
|
||||
+ std::optional<mojo_base::BigBuffer> cached_metadata) {
|
||||
+ if (net::IsLocalhost(request_url_) || (!request_url_.SchemeIsHTTPOrHTTPS() &&
|
||||
+ !request_url_.SchemeIsWSOrWSS())) {
|
||||
+ VLOG(1)
|
||||
@@ -2838,7 +2838,7 @@ new file mode 100644
|
||||
+void AdblockURLLoaderFactory::InProgressRequest::OnProcessHeadersResult(
|
||||
+ ::network::mojom::URLResponseHeadPtr head,
|
||||
+ ::mojo::ScopedDataPipeConsumerHandle body,
|
||||
+ absl::optional<mojo_base::BigBuffer> cached_metadata,
|
||||
+ std::optional<mojo_base::BigBuffer> cached_metadata,
|
||||
+ FilterMatchResult result,
|
||||
+ network::mojom::ParsedHeadersPtr parsed_headers) {
|
||||
+ if (result == FilterMatchResult::kBlockRule) {
|
||||
@@ -2945,7 +2945,7 @@ new file mode 100644
|
||||
+void AdblockURLLoaderFactory::InProgressRequest::CheckRewriteFilterMatch(
|
||||
+ CheckRewriteFilterMatchCallback callback) {
|
||||
+ if (!factory_->CheckHostValid()) {
|
||||
+ PostRewriteCallbackToUI(std::move(callback), absl::optional<GURL>{});
|
||||
+ PostRewriteCallbackToUI(std::move(callback), std::optional<GURL>{});
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
@@ -3032,8 +3032,8 @@ new file mode 100644
|
||||
+}
|
||||
+
|
||||
+void AdblockURLLoaderFactory::InProgressRequest::PostRewriteCallbackToUI(
|
||||
+ base::OnceCallback<void(const absl::optional<GURL>&)> callback,
|
||||
+ const absl::optional<GURL>& url) {
|
||||
+ base::OnceCallback<void(const std::optional<GURL>&)> callback,
|
||||
+ const std::optional<GURL>& url) {
|
||||
+ content::GetUIThreadTaskRunner({kTaskResponsePriority})
|
||||
+ ->PostTask(FROM_HERE, base::BindOnce(std::move(callback), url));
|
||||
+}
|
||||
@@ -3115,7 +3115,7 @@ new file mode 100644
|
||||
+ const net::MutableNetworkTrafficAnnotationTag& traffic_annotation,
|
||||
+ mojo::PendingReceiver<network::mojom::URLLoader> target_loader,
|
||||
+ mojo::PendingRemote<network::mojom::URLLoaderClient> proxy_client,
|
||||
+ const absl::optional<GURL>& rewrite) {
|
||||
+ const std::optional<GURL>& rewrite) {
|
||||
+ if (rewrite) {
|
||||
+ constexpr int kInternalRedirectStatusCode = net::HTTP_TEMPORARY_REDIRECT;
|
||||
+ net::RedirectInfo redirect_info = net::RedirectInfo::ComputeRedirectInfo(
|
||||
@@ -3794,7 +3794,7 @@ new file mode 100644
|
||||
+ response += enabled ? "enabled" : "disabled";
|
||||
+ return response;
|
||||
+ }
|
||||
+ absl::optional<bool> value = absl::nullopt;
|
||||
+ std::optional<bool> value = absl::nullopt;
|
||||
+ if (action == kActionEnable) {
|
||||
+ value = true;
|
||||
+ } else if (action == kActionDisable) {
|
||||
@@ -5388,7 +5388,7 @@ new file mode 100644
|
||||
+ SubscriptionService::Snapshot subscription_collections,
|
||||
+ const GURL& request_url,
|
||||
+ content::GlobalRenderFrameHostId render_frame_host_id,
|
||||
+ base::OnceCallback<void(const absl::optional<GURL>&)> result) = 0;
|
||||
+ base::OnceCallback<void(const std::optional<GURL>&)> result) = 0;
|
||||
+};
|
||||
+
|
||||
+} // namespace adblock
|
||||
@@ -5460,7 +5460,7 @@ new file mode 100644
|
||||
+ const GURL& popup_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy,
|
||||
+ content::GlobalRenderFrameHostId render_frame_host_id,
|
||||
+ absl::optional<CheckFilterMatchCallback> callback,
|
||||
+ std::optional<CheckFilterMatchCallback> callback,
|
||||
+ const ResourceClassifier::ClassificationResult& classification_result) {
|
||||
+ if (classification_result.decision != ClassificationDecision::Ignored) {
|
||||
+ FilterMatchResult result =
|
||||
@@ -5828,14 +5828,14 @@ new file mode 100644
|
||||
+ SubscriptionService::Snapshot subscription_collections,
|
||||
+ const GURL& request_url,
|
||||
+ content::GlobalRenderFrameHostId render_frame_host_id,
|
||||
+ base::OnceCallback<void(const absl::optional<GURL>&)> callback) {
|
||||
+ base::OnceCallback<void(const std::optional<GURL>&)> callback) {
|
||||
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
+ DVLOG(1) << "[eyeo] CheckRewriteFilterMatch for " << request_url.spec();
|
||||
+
|
||||
+ content::RenderFrameHost* host =
|
||||
+ frame_hierarchy_builder_->FindRenderFrameHost(render_frame_host_id);
|
||||
+ if (!host) {
|
||||
+ std::move(callback).Run(absl::optional<GURL>{});
|
||||
+ std::move(callback).Run(std::optional<GURL>{});
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
@@ -5936,7 +5936,7 @@ new file mode 100644
|
||||
+ SubscriptionService::Snapshot subscription_collections,
|
||||
+ const GURL& request_url,
|
||||
+ content::GlobalRenderFrameHostId render_frame_host_id,
|
||||
+ base::OnceCallback<void(const absl::optional<GURL>&)> result) final;
|
||||
+ base::OnceCallback<void(const std::optional<GURL>&)> result) final;
|
||||
+
|
||||
+ private:
|
||||
+ struct CheckResourceFilterMatchResult {
|
||||
@@ -5965,7 +5965,7 @@ new file mode 100644
|
||||
+ const GURL& popup_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy,
|
||||
+ content::GlobalRenderFrameHostId render_frame_host_id,
|
||||
+ absl::optional<CheckFilterMatchCallback> callback,
|
||||
+ std::optional<CheckFilterMatchCallback> callback,
|
||||
+ const ResourceClassifier::ClassificationResult& result);
|
||||
+
|
||||
+ static CheckResourceFilterMatchResult CheckResponseFilterMatchInternal(
|
||||
@@ -5988,8 +5988,8 @@ new file mode 100644
|
||||
+ FilterMatchResult result);
|
||||
+
|
||||
+ void PostRewriteCallbackToUI(
|
||||
+ base::OnceCallback<void(const absl::optional<GURL>&)> callback,
|
||||
+ absl::optional<GURL> url);
|
||||
+ base::OnceCallback<void(const std::optional<GURL>&)> callback,
|
||||
+ std::optional<GURL> url);
|
||||
+
|
||||
+ static CheckResourceFilterMatchResult CheckDocumentAllowlistedInternal(
|
||||
+ const SubscriptionService::Snapshot subscription_collections,
|
||||
@@ -7173,7 +7173,7 @@ new file mode 100644
|
||||
+ return results;
|
||||
+}
|
||||
+
|
||||
+absl::optional<bool> MigrateBoolFromPrefs(PrefService* pref_service,
|
||||
+std::optional<bool> MigrateBoolFromPrefs(PrefService* pref_service,
|
||||
+ const std::string& pref_name) {
|
||||
+ if (pref_service->FindPreference(pref_name)->HasUserSetting()) {
|
||||
+ bool value = pref_service->GetBoolean(pref_name);
|
||||
@@ -8124,7 +8124,7 @@ new file mode 100644
|
||||
+ const scoped_refptr<net::HttpResponseHeaders>& response_headers)
|
||||
+ const = 0;
|
||||
+
|
||||
+ virtual absl::optional<GURL> CheckRewrite(
|
||||
+ virtual std::optional<GURL> CheckRewrite(
|
||||
+ const SubscriptionService::Snapshot subscription_collections,
|
||||
+ const GURL& request_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy) const = 0;
|
||||
@@ -8170,7 +8170,7 @@ new file mode 100644
|
||||
+
|
||||
+using ClassificationResult = ResourceClassifier::ClassificationResult;
|
||||
+
|
||||
+absl::optional<HeaderFilterData> IsHeaderFilterOverruled(
|
||||
+std::optional<HeaderFilterData> IsHeaderFilterOverruled(
|
||||
+ base::StringPiece blocking_header_filter,
|
||||
+ std::set<HeaderFilterData>& allowing_filters) {
|
||||
+ for (auto filter : allowing_filters) {
|
||||
@@ -8401,7 +8401,7 @@ new file mode 100644
|
||||
+ std::move(blocking_filters), std::move(allowing_filters));
|
||||
+}
|
||||
+
|
||||
+absl::optional<GURL> CheckRewriteWithSingleCollection(
|
||||
+std::optional<GURL> CheckRewriteWithSingleCollection(
|
||||
+ const SubscriptionCollection& subscription_collection,
|
||||
+ const GURL& request_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy) {
|
||||
@@ -8438,7 +8438,7 @@ new file mode 100644
|
||||
+ request_url, frame_hierarchy, FilterCategory::Allowing);
|
||||
+ if (allowing_rewrites.empty()) {
|
||||
+ // Any filter will do, take the 1st one.
|
||||
+ return absl::optional<GURL>(GURL{*blocking_rewrites.begin()});
|
||||
+ return std::optional<GURL>(GURL{*blocking_rewrites.begin()});
|
||||
+ }
|
||||
+
|
||||
+ // Change set to vector to call algorithm
|
||||
@@ -8461,7 +8461,7 @@ new file mode 100644
|
||||
+ }
|
||||
+
|
||||
+ // Any filter will do, take the 1st one.
|
||||
+ return absl::optional<GURL>(GURL{*blocking_rewrites_v.begin()});
|
||||
+ return std::optional<GURL>(GURL{*blocking_rewrites_v.begin()});
|
||||
+}
|
||||
+
|
||||
+} // namespace
|
||||
@@ -8531,7 +8531,7 @@ new file mode 100644
|
||||
+ return classification;
|
||||
+}
|
||||
+
|
||||
+absl::optional<GURL> ResourceClassifierImpl::CheckRewrite(
|
||||
+std::optional<GURL> ResourceClassifierImpl::CheckRewrite(
|
||||
+ const SubscriptionService::Snapshot subscription_collections,
|
||||
+ const GURL& request_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy) const {
|
||||
@@ -8602,7 +8602,7 @@ new file mode 100644
|
||||
+ const scoped_refptr<net::HttpResponseHeaders>& response_headers)
|
||||
+ const final;
|
||||
+
|
||||
+ absl::optional<GURL> CheckRewrite(
|
||||
+ std::optional<GURL> CheckRewrite(
|
||||
+ const SubscriptionService::Snapshot subscription_collections,
|
||||
+ const GURL& request_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy) const final;
|
||||
@@ -9578,7 +9578,7 @@ new file mode 100644
|
||||
+// Destroys memory mapped to a file on disk, and optionally removes the file
|
||||
+// itself. Performs blocking operations, must run on a MayBlock() task runner.
|
||||
+void DestroyMemoryMappedFile(std::unique_ptr<base::MemoryMappedFile> memory,
|
||||
+ absl::optional<base::FilePath> path_to_remove) {
|
||||
+ std::optional<base::FilePath> path_to_remove) {
|
||||
+ memory.reset();
|
||||
+ // Deleting the file should happen *after* removing the memory mapping.
|
||||
+ if (path_to_remove) {
|
||||
@@ -9612,7 +9612,7 @@ new file mode 100644
|
||||
+MemoryMappedFlatbufferData::~MemoryMappedFlatbufferData() {
|
||||
+ const auto path_to_remove =
|
||||
+ permanently_remove_path_.load()
|
||||
+ ? absl::optional<base::FilePath>(std::move(path_))
|
||||
+ ? std::optional<base::FilePath>(std::move(path_))
|
||||
+ : absl::nullopt;
|
||||
+ base::ThreadPool::PostTask(
|
||||
+ FROM_HERE, {base::MayBlock()},
|
||||
@@ -9872,7 +9872,7 @@ new file mode 100644
|
||||
+
|
||||
+namespace adblock {
|
||||
+
|
||||
+absl::optional<base::StringPiece> ExtractRegexFilterFromPattern(
|
||||
+std::optional<base::StringPiece> ExtractRegexFilterFromPattern(
|
||||
+ base::StringPiece filter_pattern) {
|
||||
+ if (!(filter_pattern.size() > 2 && filter_pattern.front() == '/' &&
|
||||
+ filter_pattern.back() == '/')) {
|
||||
@@ -9915,7 +9915,7 @@ new file mode 100644
|
||||
+// For a regex filter "/{expression}/" returns "{expression}".
|
||||
+// For non-regex filters, returns nullopt.
|
||||
+// Cheap, may be used to identify regex filter patterns.
|
||||
+absl::optional<base::StringPiece> ExtractRegexFilterFromPattern(
|
||||
+std::optional<base::StringPiece> ExtractRegexFilterFromPattern(
|
||||
+ base::StringPiece filter_pattern);
|
||||
+} // namespace adblock
|
||||
+
|
||||
@@ -11064,7 +11064,7 @@ new file mode 100644
|
||||
+static constexpr char kDomainSeparator[] = ",";
|
||||
+
|
||||
+// static
|
||||
+absl::optional<ContentFilter> ContentFilter::FromString(
|
||||
+std::optional<ContentFilter> ContentFilter::FromString(
|
||||
+ base::StringPiece domain_list,
|
||||
+ FilterType filter_type,
|
||||
+ base::StringPiece selector) {
|
||||
@@ -11142,7 +11142,7 @@ new file mode 100644
|
||||
+
|
||||
+class ContentFilter {
|
||||
+ public:
|
||||
+ static absl::optional<ContentFilter> FromString(base::StringPiece domain_list,
|
||||
+ static std::optional<ContentFilter> FromString(base::StringPiece domain_list,
|
||||
+ FilterType type,
|
||||
+ base::StringPiece selector);
|
||||
+
|
||||
@@ -11474,13 +11474,13 @@ new file mode 100644
|
||||
+// Parses the stream line by line until it finds comments. After the first non
|
||||
+// comment line any upcoming comments will be skipped.
|
||||
+// static
|
||||
+absl::optional<Metadata> Metadata::FromStream(std::istream& filter_stream) {
|
||||
+std::optional<Metadata> Metadata::FromStream(std::istream& filter_stream) {
|
||||
+ static re2::RE2 comment_re("^!\\s*(.*?)\\s*:\\s*(.*)");
|
||||
+
|
||||
+ std::string homepage;
|
||||
+ std::string title;
|
||||
+ std::string version;
|
||||
+ absl::optional<GURL> redirect_url;
|
||||
+ std::optional<GURL> redirect_url;
|
||||
+ base::TimeDelta expires = kDefaultExpirationInterval;
|
||||
+
|
||||
+ std::string line;
|
||||
@@ -11538,7 +11538,7 @@ new file mode 100644
|
||||
+Metadata::Metadata(std::string homepage,
|
||||
+ std::string title,
|
||||
+ std::string version,
|
||||
+ absl::optional<GURL> redirect_url,
|
||||
+ std::optional<GURL> redirect_url,
|
||||
+ base::TimeDelta expires)
|
||||
+ : homepage(std::move(homepage)),
|
||||
+ title(std::move(title)),
|
||||
@@ -11625,7 +11625,7 @@ new file mode 100644
|
||||
+
|
||||
+class Metadata {
|
||||
+ public:
|
||||
+ static absl::optional<Metadata> FromStream(std::istream& filter_stream);
|
||||
+ static std::optional<Metadata> FromStream(std::istream& filter_stream);
|
||||
+ static Metadata Default();
|
||||
+
|
||||
+ Metadata(const Metadata& other);
|
||||
@@ -11635,7 +11635,7 @@ new file mode 100644
|
||||
+ const std::string homepage;
|
||||
+ const std::string title;
|
||||
+ const std::string version;
|
||||
+ const absl::optional<GURL> redirect_url;
|
||||
+ const std::optional<GURL> redirect_url;
|
||||
+ const base::TimeDelta expires;
|
||||
+
|
||||
+ static constexpr base::TimeDelta kDefaultExpirationInterval = base::Days(5);
|
||||
@@ -11646,7 +11646,7 @@ new file mode 100644
|
||||
+ Metadata(std::string homepage,
|
||||
+ std::string title,
|
||||
+ std::string version,
|
||||
+ absl::optional<GURL> redirect_url,
|
||||
+ std::optional<GURL> redirect_url,
|
||||
+ base::TimeDelta expires);
|
||||
+ Metadata();
|
||||
+
|
||||
@@ -11689,7 +11689,7 @@ new file mode 100644
|
||||
+static constexpr char kDomainSeparator[] = ",";
|
||||
+
|
||||
+// static
|
||||
+absl::optional<SnippetFilter> SnippetFilter::FromString(
|
||||
+std::optional<SnippetFilter> SnippetFilter::FromString(
|
||||
+ base::StringPiece domain_list,
|
||||
+ base::StringPiece snippet) {
|
||||
+ if (snippet.empty()) {
|
||||
@@ -11758,7 +11758,7 @@ new file mode 100644
|
||||
+
|
||||
+class SnippetFilter {
|
||||
+ public:
|
||||
+ static absl::optional<SnippetFilter> FromString(base::StringPiece domain_list,
|
||||
+ static std::optional<SnippetFilter> FromString(base::StringPiece domain_list,
|
||||
+ base::StringPiece snippet);
|
||||
+
|
||||
+ SnippetFilter(const SnippetFilter& other);
|
||||
@@ -12017,7 +12017,7 @@ new file mode 100644
|
||||
+
|
||||
+bool IsGenericFilterIsNotSpecificEnough(
|
||||
+ base::StringPiece filter_str,
|
||||
+ const absl::optional<UrlFilterOptions>& options) {
|
||||
+ const std::optional<UrlFilterOptions>& options) {
|
||||
+ if (options.has_value() && (!options->Domains().GetExcludeDomains().empty() ||
|
||||
+ !options->Domains().GetIncludeDomains().empty() ||
|
||||
+ !options->Sitekeys().empty())) {
|
||||
@@ -12031,8 +12031,8 @@ new file mode 100644
|
||||
+}
|
||||
+
|
||||
+// static
|
||||
+absl::optional<UrlFilter> UrlFilter::FromString(std::string filter_str) {
|
||||
+ absl::optional<UrlFilterOptions> options;
|
||||
+std::optional<UrlFilter> UrlFilter::FromString(std::string filter_str) {
|
||||
+ std::optional<UrlFilterOptions> options;
|
||||
+ bool is_allowing = base::StartsWith(filter_str, kAllowingSymbol);
|
||||
+ if (is_allowing) {
|
||||
+ filter_str.erase(0, 2);
|
||||
@@ -12193,7 +12193,7 @@ new file mode 100644
|
||||
+
|
||||
+class UrlFilter {
|
||||
+ public:
|
||||
+ static absl::optional<UrlFilter> FromString(std::string filter_str);
|
||||
+ static std::optional<UrlFilter> FromString(std::string filter_str);
|
||||
+
|
||||
+ UrlFilter(const UrlFilter& other);
|
||||
+ UrlFilter(UrlFilter&& other);
|
||||
@@ -12249,17 +12249,17 @@ new file mode 100644
|
||||
+static constexpr char kInverseSymbol = '~';
|
||||
+
|
||||
+// static
|
||||
+absl::optional<UrlFilterOptions> UrlFilterOptions::FromString(
|
||||
+std::optional<UrlFilterOptions> UrlFilterOptions::FromString(
|
||||
+ const std::string& option_list) {
|
||||
+ bool is_match_case = false;
|
||||
+ bool is_popup_filter = false;
|
||||
+ bool is_subresource = false;
|
||||
+ ThirdPartyOption third_party = ThirdPartyOption::Ignore;
|
||||
+ absl::optional<RewriteOption> rewrite;
|
||||
+ std::optional<RewriteOption> rewrite;
|
||||
+ DomainOption domains;
|
||||
+ SiteKeys sitekeys;
|
||||
+ absl::optional<std::string> csp;
|
||||
+ absl::optional<std::string> headers;
|
||||
+ std::optional<std::string> csp;
|
||||
+ std::optional<std::string> headers;
|
||||
+ uint32_t content_types = 0;
|
||||
+ std::set<ExceptionType> exception_types;
|
||||
+
|
||||
@@ -12373,7 +12373,7 @@ new file mode 100644
|
||||
+ content_types_(ContentType::Default) {}
|
||||
+
|
||||
+// static
|
||||
+absl::optional<UrlFilterOptions::RewriteOption> UrlFilterOptions::ParseRewrite(
|
||||
+std::optional<UrlFilterOptions::RewriteOption> UrlFilterOptions::ParseRewrite(
|
||||
+ const std::string& rewrite_value) {
|
||||
+ if (rewrite_value == "abp-resource:blank-text") {
|
||||
+ return RewriteOption::AbpResource_BlankText;
|
||||
@@ -12434,7 +12434,7 @@ new file mode 100644
|
||||
+}
|
||||
+
|
||||
+// static
|
||||
+absl::optional<UrlFilterOptions::ExceptionType>
|
||||
+std::optional<UrlFilterOptions::ExceptionType>
|
||||
+UrlFilterOptions::ExceptionTypeFromString(const std::string& exception_type) {
|
||||
+ if (exception_type == "document") {
|
||||
+ return ExceptionType::Document;
|
||||
@@ -12454,11 +12454,11 @@ new file mode 100644
|
||||
+ const bool is_subresource,
|
||||
+ const ThirdPartyOption third_party,
|
||||
+ const uint32_t content_types,
|
||||
+ const absl::optional<RewriteOption> rewrite,
|
||||
+ const std::optional<RewriteOption> rewrite,
|
||||
+ const DomainOption domains,
|
||||
+ const SiteKeys sitekeys,
|
||||
+ const absl::optional<std::string> csp,
|
||||
+ const absl::optional<std::string> headers,
|
||||
+ const std::optional<std::string> csp,
|
||||
+ const std::optional<std::string> headers,
|
||||
+ const std::set<ExceptionType> exception_types)
|
||||
+ : is_match_case_(is_match_case),
|
||||
+ is_popup_filter_(is_popup_filter),
|
||||
@@ -12544,7 +12544,7 @@ new file mode 100644
|
||||
+ Genericblock,
|
||||
+ };
|
||||
+
|
||||
+ static absl::optional<UrlFilterOptions> FromString(
|
||||
+ static std::optional<UrlFilterOptions> FromString(
|
||||
+ const std::string& option_list);
|
||||
+
|
||||
+ UrlFilterOptions();
|
||||
@@ -12558,13 +12558,13 @@ new file mode 100644
|
||||
+ inline bool IsPopup() const { return is_popup_filter_; }
|
||||
+ inline bool IsSubresource() const { return is_subresource_; }
|
||||
+ inline ThirdPartyOption ThirdParty() const { return third_party_; }
|
||||
+ inline const absl::optional<RewriteOption>& Rewrite() const {
|
||||
+ inline const std::optional<RewriteOption>& Rewrite() const {
|
||||
+ return rewrite_;
|
||||
+ }
|
||||
+ inline const DomainOption& Domains() const { return domains_; }
|
||||
+ inline const std::vector<SiteKey>& Sitekeys() const { return sitekeys_; }
|
||||
+ inline const absl::optional<std::string>& Csp() const { return csp_; }
|
||||
+ inline const absl::optional<std::string>& Headers() const { return headers_; }
|
||||
+ inline const std::optional<std::string>& Csp() const { return csp_; }
|
||||
+ inline const std::optional<std::string>& Headers() const { return headers_; }
|
||||
+ inline uint32_t ContentTypes() const { return content_types_; }
|
||||
+ inline const std::set<ExceptionType>& ExceptionTypes() const {
|
||||
+ return exception_types_;
|
||||
@@ -12576,19 +12576,19 @@ new file mode 100644
|
||||
+ bool is_subresource,
|
||||
+ ThirdPartyOption third_party,
|
||||
+ uint32_t content_types,
|
||||
+ absl::optional<RewriteOption> rewrite,
|
||||
+ std::optional<RewriteOption> rewrite,
|
||||
+ DomainOption domains,
|
||||
+ std::vector<SiteKey> sitekeys,
|
||||
+ absl::optional<std::string> csp,
|
||||
+ absl::optional<std::string> headers,
|
||||
+ std::optional<std::string> csp,
|
||||
+ std::optional<std::string> headers,
|
||||
+ std::set<ExceptionType> exception_types);
|
||||
+
|
||||
+ static absl::optional<RewriteOption> ParseRewrite(
|
||||
+ static std::optional<RewriteOption> ParseRewrite(
|
||||
+ const std::string& rewrite_value);
|
||||
+ static std::vector<SiteKey> ParseSitekeys(const std::string& sitekey_value);
|
||||
+ static bool IsValidCsp(const std::string& csp_value);
|
||||
+ static void ParseHeaders(std::string& headers_value);
|
||||
+ static absl::optional<ExceptionType> ExceptionTypeFromString(
|
||||
+ static std::optional<ExceptionType> ExceptionTypeFromString(
|
||||
+ const std::string& exception_type);
|
||||
+
|
||||
+ bool is_match_case_;
|
||||
@@ -12596,11 +12596,11 @@ new file mode 100644
|
||||
+ bool is_subresource_;
|
||||
+ ThirdPartyOption third_party_;
|
||||
+ uint32_t content_types_;
|
||||
+ absl::optional<RewriteOption> rewrite_;
|
||||
+ std::optional<RewriteOption> rewrite_;
|
||||
+ DomainOption domains_;
|
||||
+ std::vector<SiteKey> sitekeys_;
|
||||
+ absl::optional<std::string> csp_;
|
||||
+ absl::optional<std::string> headers_;
|
||||
+ std::optional<std::string> csp_;
|
||||
+ std::optional<std::string> headers_;
|
||||
+ std::set<ExceptionType> exception_types_;
|
||||
+};
|
||||
+
|
||||
@@ -12695,7 +12695,7 @@ new file mode 100644
|
||||
+
|
||||
+namespace adblock {
|
||||
+
|
||||
+absl::optional<std::string> FilterKeywordExtractor::GetNextKeyword() {
|
||||
+std::optional<std::string> FilterKeywordExtractor::GetNextKeyword() {
|
||||
+ std::string current_keyword;
|
||||
+ do {
|
||||
+ // In case that we are extracting keyword to store a filter
|
||||
@@ -12784,7 +12784,7 @@ new file mode 100644
|
||||
+ public:
|
||||
+ explicit FilterKeywordExtractor(base::StringPiece url);
|
||||
+ ~FilterKeywordExtractor();
|
||||
+ absl::optional<std::string> GetNextKeyword();
|
||||
+ std::optional<std::string> GetNextKeyword();
|
||||
+
|
||||
+ private:
|
||||
+ re2::StringPiece input_;
|
||||
@@ -12964,9 +12964,9 @@ new file mode 100644
|
||||
+ ? builder_.CreateSharedString(options.Headers().value())
|
||||
+ : flatbuffers::Offset<flatbuffers::String>());
|
||||
+
|
||||
+ const absl::optional<base::StringPiece> keyword_pattern =
|
||||
+ const std::optional<base::StringPiece> keyword_pattern =
|
||||
+ ExtractRegexFilterFromPattern(url_filter.pattern).has_value()
|
||||
+ ? absl::optional<base::StringPiece>()
|
||||
+ ? std::optional<base::StringPiece>()
|
||||
+ : url_filter.pattern;
|
||||
+
|
||||
+ if (options.Headers().has_value()) {
|
||||
@@ -13022,7 +13022,7 @@ new file mode 100644
|
||||
+
|
||||
+void FlatbufferSerializer::AddUrlFilterToIndex(
|
||||
+ UrlFilterIndex& index,
|
||||
+ absl::optional<base::StringPiece> pattern_text,
|
||||
+ std::optional<base::StringPiece> pattern_text,
|
||||
+ flatbuffers::Offset<flat::UrlFilter> filter) {
|
||||
+ const auto keyword =
|
||||
+ pattern_text ? FindCandidateKeyword(index, *pattern_text) : "";
|
||||
@@ -13259,7 +13259,7 @@ new file mode 100644
|
||||
+ std::vector<flatbuffers::Offset<flat::SnippetFilter>>>;
|
||||
+
|
||||
+ void AddUrlFilterToIndex(UrlFilterIndex& index,
|
||||
+ absl::optional<base::StringPiece> pattern_text,
|
||||
+ std::optional<base::StringPiece> pattern_text,
|
||||
+ flatbuffers::Offset<flat::UrlFilter> filter);
|
||||
+ void AddElemhideFilterForDomains(
|
||||
+ ElemhideIndex& index,
|
||||
@@ -13707,7 +13707,7 @@ new file mode 100644
|
||||
+ const scoped_refptr<net::HttpResponseHeaders>& headers,
|
||||
+ const std::string& user_agent) = 0;
|
||||
+
|
||||
+ virtual absl::optional<std::pair<GURL, SiteKey>> FindSiteKeyForAnyUrl(
|
||||
+ virtual std::optional<std::pair<GURL, SiteKey>> FindSiteKeyForAnyUrl(
|
||||
+ const std::vector<GURL>& urls) const = 0;
|
||||
+};
|
||||
+
|
||||
@@ -13772,7 +13772,7 @@ new file mode 100644
|
||||
+ ProcessSiteKey(request_url, site_key, user_agent);
|
||||
+}
|
||||
+
|
||||
+absl::optional<std::pair<GURL, SiteKey>>
|
||||
+std::optional<std::pair<GURL, SiteKey>>
|
||||
+SitekeyStorageImpl::FindSiteKeyForAnyUrl(const std::vector<GURL>& urls) const {
|
||||
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
+ for (const auto& url : urls) {
|
||||
@@ -13909,7 +13909,7 @@ new file mode 100644
|
||||
+ const scoped_refptr<net::HttpResponseHeaders>& headers,
|
||||
+ const std::string& user_agent) final;
|
||||
+
|
||||
+ absl::optional<std::pair<GURL, SiteKey>> FindSiteKeyForAnyUrl(
|
||||
+ std::optional<std::pair<GURL, SiteKey>> FindSiteKeyForAnyUrl(
|
||||
+ const std::vector<GURL>& urls) const final;
|
||||
+
|
||||
+ private:
|
||||
@@ -14199,7 +14199,7 @@ new file mode 100644
|
||||
+DomainSplitter::DomainSplitter(base::StringPiece domain)
|
||||
+ : domain_(base::TrimString(domain, ".", base::TRIM_ALL)) {}
|
||||
+
|
||||
+absl::optional<base::StringPiece> DomainSplitter::FindNextSubdomain() {
|
||||
+std::optional<base::StringPiece> DomainSplitter::FindNextSubdomain() {
|
||||
+ const auto old_dot_pos = dot_pos_;
|
||||
+ if (dot_pos_ < domain_.size()) {
|
||||
+ // Find next dot in domain, for future iteration to consume.
|
||||
@@ -14258,7 +14258,7 @@ new file mode 100644
|
||||
+ // |domain| must outlive this, no copy made.
|
||||
+ explicit DomainSplitter(base::StringPiece domain);
|
||||
+ // Returns reference to part of |domain|.
|
||||
+ absl::optional<base::StringPiece> FindNextSubdomain();
|
||||
+ std::optional<base::StringPiece> FindNextSubdomain();
|
||||
+
|
||||
+ private:
|
||||
+ const base::StringPiece domain_;
|
||||
@@ -15446,7 +15446,7 @@ new file mode 100644
|
||||
+std::vector<const flat::UrlFilter*> InstalledSubscriptionImpl::FindInternal(
|
||||
+ const UrlFilterIndex* index,
|
||||
+ const GURL& url,
|
||||
+ absl::optional<ContentType> content_type,
|
||||
+ std::optional<ContentType> content_type,
|
||||
+ const std::string& document_domain,
|
||||
+ const std::string& sitekey,
|
||||
+ FilterCategory category,
|
||||
@@ -15485,7 +15485,7 @@ new file mode 100644
|
||||
+ base::StringPiece keyword,
|
||||
+ const GURL& url,
|
||||
+ const GURL& lowercase_url,
|
||||
+ absl::optional<ContentType> content_type,
|
||||
+ std::optional<ContentType> content_type,
|
||||
+ const std::string& document_domain,
|
||||
+ const std::string& sitekey,
|
||||
+ FilterCategory category,
|
||||
@@ -15538,7 +15538,7 @@ new file mode 100644
|
||||
+
|
||||
+bool InstalledSubscriptionImpl::CandidateFilterViable(
|
||||
+ const flat::UrlFilter* candidate,
|
||||
+ absl::optional<ContentType> content_type,
|
||||
+ std::optional<ContentType> content_type,
|
||||
+ const std::string& document_domain,
|
||||
+ const std::string& sitekey,
|
||||
+ FilterCategory category,
|
||||
@@ -15797,7 +15797,7 @@ new file mode 100644
|
||||
+ std::vector<const flat::UrlFilter*> FindInternal(
|
||||
+ const UrlFilterIndex* index,
|
||||
+ const GURL& url,
|
||||
+ absl::optional<ContentType> content_type,
|
||||
+ std::optional<ContentType> content_type,
|
||||
+ const std::string& document_domain,
|
||||
+ const std::string& sitekey,
|
||||
+ FilterCategory category,
|
||||
@@ -15807,7 +15807,7 @@ new file mode 100644
|
||||
+ base::StringPiece keyword,
|
||||
+ const GURL& url,
|
||||
+ const GURL& lowercase_url,
|
||||
+ absl::optional<ContentType> content_type,
|
||||
+ std::optional<ContentType> content_type,
|
||||
+ const std::string& document_domain,
|
||||
+ const std::string& sitekey,
|
||||
+ FilterCategory category,
|
||||
@@ -15815,7 +15815,7 @@ new file mode 100644
|
||||
+ FindStrategy strategy,
|
||||
+ std::vector<const flat::UrlFilter*>& out_results) const;
|
||||
+ bool CandidateFilterViable(const flat::UrlFilter* candidate,
|
||||
+ absl::optional<ContentType> content_type,
|
||||
+ std::optional<ContentType> content_type,
|
||||
+ const std::string& document_domain,
|
||||
+ const std::string& sitekey,
|
||||
+ FilterCategory category,
|
||||
@@ -16290,7 +16290,7 @@ new file mode 100644
|
||||
+ base::StringPiece consumed_filter_pattern_;
|
||||
+};
|
||||
+
|
||||
+absl::optional<base::StringPiece> FindNextTokenInInput(
|
||||
+std::optional<base::StringPiece> FindNextTokenInInput(
|
||||
+ base::StringPiece consumed_input,
|
||||
+ PatternTokenizer tokenizer,
|
||||
+ int recursion_depth);
|
||||
@@ -16344,7 +16344,7 @@ new file mode 100644
|
||||
+
|
||||
+// Returns characters skipped in order to reach next token from |tokenizer|, or
|
||||
+// nullopt if not found.
|
||||
+absl::optional<base::StringPiece> FindNextTokenInInput(
|
||||
+std::optional<base::StringPiece> FindNextTokenInInput(
|
||||
+ base::StringPiece consumed_input,
|
||||
+ PatternTokenizer tokenizer,
|
||||
+ int recursion_depth) {
|
||||
@@ -16377,7 +16377,7 @@ new file mode 100644
|
||||
+ // It is OK as long as there are no further tokens that require matching
|
||||
+ // input. The "^" symbol matches EOF too.
|
||||
+ return NextTokenBeginsInput(base::StringPiece(), tokenizer, recursion_depth)
|
||||
+ ? absl::optional<base::StringPiece>{consumed_input}
|
||||
+ ? std::optional<base::StringPiece>{consumed_input}
|
||||
+ : absl::nullopt;
|
||||
+ } else if (token == "|") {
|
||||
+ // If we're skipping characters, we can always skip enough to reach the end
|
||||
@@ -17132,23 +17132,23 @@ new file mode 100644
|
||||
+ // Name of the FilteringConfiguration this collection represents
|
||||
+ virtual const std::string& GetFilteringConfigurationName() const = 0;
|
||||
+
|
||||
+ virtual absl::optional<GURL> FindBySubresourceFilter(
|
||||
+ virtual std::optional<GURL> FindBySubresourceFilter(
|
||||
+ const GURL& request_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy,
|
||||
+ ContentType content_type,
|
||||
+ const SiteKey& sitekey,
|
||||
+ FilterCategory category) const = 0;
|
||||
+ virtual absl::optional<GURL> FindByPopupFilter(
|
||||
+ virtual std::optional<GURL> FindByPopupFilter(
|
||||
+ const GURL& popup_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy,
|
||||
+ const SiteKey& sitekey,
|
||||
+ FilterCategory category) const = 0;
|
||||
+ virtual absl::optional<GURL> FindByAllowFilter(
|
||||
+ virtual std::optional<GURL> FindByAllowFilter(
|
||||
+ const GURL& request_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy,
|
||||
+ ContentType content_type,
|
||||
+ const SiteKey& sitekey) const = 0;
|
||||
+ virtual absl::optional<GURL> FindBySpecialFilter(
|
||||
+ virtual std::optional<GURL> FindBySpecialFilter(
|
||||
+ SpecialFilterType filter_type,
|
||||
+ const GURL& request_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy,
|
||||
@@ -17319,7 +17319,7 @@ new file mode 100644
|
||||
+ return configuration_name_;
|
||||
+}
|
||||
+
|
||||
+absl::optional<GURL> SubscriptionCollectionImpl::FindBySubresourceFilter(
|
||||
+std::optional<GURL> SubscriptionCollectionImpl::FindBySubresourceFilter(
|
||||
+ const GURL& request_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy,
|
||||
+ ContentType content_type,
|
||||
@@ -17338,7 +17338,7 @@ new file mode 100644
|
||||
+ return absl::nullopt;
|
||||
+}
|
||||
+
|
||||
+absl::optional<GURL> SubscriptionCollectionImpl::FindByPopupFilter(
|
||||
+std::optional<GURL> SubscriptionCollectionImpl::FindByPopupFilter(
|
||||
+ const GURL& popup_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy,
|
||||
+ const SiteKey& sitekey,
|
||||
@@ -17356,7 +17356,7 @@ new file mode 100644
|
||||
+ return absl::nullopt;
|
||||
+}
|
||||
+
|
||||
+absl::optional<GURL> SubscriptionCollectionImpl::FindByAllowFilter(
|
||||
+std::optional<GURL> SubscriptionCollectionImpl::FindByAllowFilter(
|
||||
+ const GURL& request_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy,
|
||||
+ ContentType content_type,
|
||||
@@ -17370,7 +17370,7 @@ new file mode 100644
|
||||
+ return absl::nullopt;
|
||||
+}
|
||||
+
|
||||
+absl::optional<GURL> SubscriptionCollectionImpl::FindBySpecialFilter(
|
||||
+std::optional<GURL> SubscriptionCollectionImpl::FindBySpecialFilter(
|
||||
+ SpecialFilterType filter_type,
|
||||
+ const GURL& request_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy,
|
||||
@@ -17588,26 +17588,26 @@ new file mode 100644
|
||||
+
|
||||
+ const std::string& GetFilteringConfigurationName() const final;
|
||||
+
|
||||
+ absl::optional<GURL> FindBySubresourceFilter(
|
||||
+ std::optional<GURL> FindBySubresourceFilter(
|
||||
+ const GURL& request_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy,
|
||||
+ ContentType content_type,
|
||||
+ const SiteKey& sitekey,
|
||||
+ FilterCategory category) const final;
|
||||
+
|
||||
+ absl::optional<GURL> FindByPopupFilter(
|
||||
+ std::optional<GURL> FindByPopupFilter(
|
||||
+ const GURL& popup_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy,
|
||||
+ const SiteKey& sitekey,
|
||||
+ FilterCategory category) const final;
|
||||
+
|
||||
+ absl::optional<GURL> FindByAllowFilter(
|
||||
+ std::optional<GURL> FindByAllowFilter(
|
||||
+ const GURL& request_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy,
|
||||
+ ContentType content_type,
|
||||
+ const SiteKey& sitekey) const final;
|
||||
+
|
||||
+ absl::optional<GURL> FindBySpecialFilter(
|
||||
+ std::optional<GURL> FindBySpecialFilter(
|
||||
+ SpecialFilterType filter_type,
|
||||
+ const GURL& request_url,
|
||||
+ const std::vector<GURL>& frame_hierarchy,
|
||||
@@ -18577,7 +18577,7 @@ new file mode 100644
|
||||
+ raw_ptr<ConversionExecutors> conversion_executor_;
|
||||
+ raw_ptr<SubscriptionPersistentMetadata> persistent_metadata_;
|
||||
+ OngoingDownloads ongoing_downloads_;
|
||||
+ absl::optional<HeadRequest> ongoing_ping_;
|
||||
+ std::optional<HeadRequest> ongoing_ping_;
|
||||
+ base::WeakPtrFactory<SubscriptionDownloaderImpl> weak_ptr_factory_{this};
|
||||
+};
|
||||
+
|
||||
@@ -20190,7 +20190,7 @@ new file mode 100644
|
||||
+
|
||||
+} // namespace
|
||||
+
|
||||
+absl::optional<base::StringPiece> UrlKeywordExtractor::GetNextKeyword() {
|
||||
+std::optional<base::StringPiece> UrlKeywordExtractor::GetNextKeyword() {
|
||||
+ base::StringPiece current_keyword;
|
||||
+ do {
|
||||
+ const auto start_of_next_keyword = input_.find_first_not_of('\0');
|
||||
@@ -20277,7 +20277,7 @@ new file mode 100644
|
||||
+ public:
|
||||
+ explicit UrlKeywordExtractor(base::StringPiece url);
|
||||
+ ~UrlKeywordExtractor();
|
||||
+ absl::optional<base::StringPiece> GetNextKeyword();
|
||||
+ std::optional<base::StringPiece> GetNextKeyword();
|
||||
+
|
||||
+ private:
|
||||
+ std::string url_with_nulls_;
|
||||
|
||||
@@ -384,7 +384,7 @@ new file mode 100644
|
||||
+ WebSocketFactory factory,
|
||||
+ const GURL& url,
|
||||
+ const net::SiteForCookies& site_for_cookies,
|
||||
+ const absl::optional<std::string>& user_agent,
|
||||
+ const std::optional<std::string>& user_agent,
|
||||
+ mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
|
||||
+ handshake_client) {
|
||||
+ if (IsFilteringNeeded(frame)) {
|
||||
@@ -404,7 +404,7 @@ new file mode 100644
|
||||
+ WebSocketFactory factory,
|
||||
+ const GURL& url,
|
||||
+ const net::SiteForCookies& site_for_cookies,
|
||||
+ const absl::optional<std::string>& user_agent,
|
||||
+ const std::optional<std::string>& user_agent,
|
||||
+ mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
|
||||
+ handshake_client) {
|
||||
+ auto* frame = content::RenderFrameHost::FromID(render_frame_host_id);
|
||||
@@ -431,7 +431,7 @@ new file mode 100644
|
||||
+ ChromeContentBrowserClient::WebSocketFactory factory,
|
||||
+ const GURL& url,
|
||||
+ const net::SiteForCookies& site_for_cookies,
|
||||
+ const absl::optional<std::string>& user_agent,
|
||||
+ const std::optional<std::string>& user_agent,
|
||||
+ mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
|
||||
+ handshake_client,
|
||||
+ adblock::FilterMatchResult result) {
|
||||
@@ -468,7 +468,7 @@ new file mode 100644
|
||||
+ int render_process_id,
|
||||
+ URLLoaderFactoryType type,
|
||||
+ const url::Origin& request_initiator,
|
||||
+ absl::optional<int64_t> navigation_id,
|
||||
+ std::optional<int64_t> navigation_id,
|
||||
+ ukm::SourceIdObj ukm_source_id,
|
||||
+ mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
|
||||
+ mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
|
||||
@@ -583,7 +583,7 @@ new file mode 100644
|
||||
+ WebSocketFactory factory,
|
||||
+ const GURL& url,
|
||||
+ const net::SiteForCookies& site_for_cookies,
|
||||
+ const absl::optional<std::string>& user_agent,
|
||||
+ const std::optional<std::string>& user_agent,
|
||||
+ mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
|
||||
+ handshake_client) override;
|
||||
+
|
||||
@@ -593,7 +593,7 @@ new file mode 100644
|
||||
+ int render_process_id,
|
||||
+ URLLoaderFactoryType type,
|
||||
+ const url::Origin& request_initiator,
|
||||
+ absl::optional<int64_t> navigation_id,
|
||||
+ std::optional<int64_t> navigation_id,
|
||||
+ ukm::SourceIdObj ukm_source_id,
|
||||
+ mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
|
||||
+ mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
|
||||
@@ -610,7 +610,7 @@ new file mode 100644
|
||||
+ WebSocketFactory factory,
|
||||
+ const GURL& url,
|
||||
+ const net::SiteForCookies& site_for_cookies,
|
||||
+ const absl::optional<std::string>& user_agent,
|
||||
+ const std::optional<std::string>& user_agent,
|
||||
+ mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
|
||||
+ handshake_client);
|
||||
+ void OnWebSocketFilterCheckCompleted(
|
||||
@@ -618,7 +618,7 @@ new file mode 100644
|
||||
+ ChromeContentBrowserClient::WebSocketFactory factory,
|
||||
+ const GURL& url,
|
||||
+ const net::SiteForCookies& site_for_cookies,
|
||||
+ const absl::optional<std::string>& user_agent,
|
||||
+ const std::optional<std::string>& user_agent,
|
||||
+ mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
|
||||
+ handshake_client,
|
||||
+ adblock::FilterMatchResult result);
|
||||
|
||||
@@ -463,7 +463,7 @@ new file mode 100644
|
||||
+AdblockPrivateSetEnabledFunction::~AdblockPrivateSetEnabledFunction() {}
|
||||
+
|
||||
+ExtensionFunction::ResponseAction AdblockPrivateSetEnabledFunction::Run() {
|
||||
+ absl::optional<api::adblock_private::SetEnabled::Params> params =
|
||||
+ std::optional<api::adblock_private::SetEnabled::Params> params =
|
||||
+ api::adblock_private::SetEnabled::Params::Create(args());
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
+
|
||||
@@ -501,7 +501,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+AdblockPrivateSetAcceptableAdsEnabledFunction::Run() {
|
||||
+ absl::optional<api::adblock_private::SetAcceptableAdsEnabled::Params> params =
|
||||
+ std::optional<api::adblock_private::SetAcceptableAdsEnabled::Params> params =
|
||||
+ api::adblock_private::SetAcceptableAdsEnabled::Params::Create(args());
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
+
|
||||
@@ -574,7 +574,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+AdblockPrivateInstallSubscriptionFunction::Run() {
|
||||
+ absl::optional<api::adblock_private::InstallSubscription::Params> params =
|
||||
+ std::optional<api::adblock_private::InstallSubscription::Params> params =
|
||||
+ api::adblock_private::InstallSubscription::Params::Create(args());
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
+ auto url = GURL{params->url};
|
||||
@@ -595,7 +595,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+AdblockPrivateUninstallSubscriptionFunction::Run() {
|
||||
+ absl::optional<api::adblock_private::UninstallSubscription::Params> params =
|
||||
+ std::optional<api::adblock_private::UninstallSubscription::Params> params =
|
||||
+ api::adblock_private::UninstallSubscription::Params::Create(args());
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
+ auto url = GURL{params->url};
|
||||
@@ -637,7 +637,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+AdblockPrivateAddAllowedDomainFunction::Run() {
|
||||
+ absl::optional<api::adblock_private::AddAllowedDomain::Params> params =
|
||||
+ std::optional<api::adblock_private::AddAllowedDomain::Params> params =
|
||||
+ api::adblock_private::AddAllowedDomain::Params::Create(args());
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
+ auto* adblock_configuration =
|
||||
@@ -658,7 +658,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+AdblockPrivateRemoveAllowedDomainFunction::Run() {
|
||||
+ absl::optional<api::adblock_private::RemoveAllowedDomain::Params> params =
|
||||
+ std::optional<api::adblock_private::RemoveAllowedDomain::Params> params =
|
||||
+ api::adblock_private::RemoveAllowedDomain::Params::Create(args());
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
+ auto* adblock_configuration =
|
||||
@@ -698,7 +698,7 @@ new file mode 100644
|
||||
+ ~AdblockPrivateAddCustomFilterFunction() {}
|
||||
+
|
||||
+ExtensionFunction::ResponseAction AdblockPrivateAddCustomFilterFunction::Run() {
|
||||
+ absl::optional<api::adblock_private::AddCustomFilter::Params> params =
|
||||
+ std::optional<api::adblock_private::AddCustomFilter::Params> params =
|
||||
+ api::adblock_private::AddCustomFilter::Params::Create(args());
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
+ auto* adblock_configuration =
|
||||
@@ -738,7 +738,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+AdblockPrivateRemoveCustomFilterFunction::Run() {
|
||||
+ absl::optional<api::adblock_private::RemoveCustomFilter::Params> params =
|
||||
+ std::optional<api::adblock_private::RemoveCustomFilter::Params> params =
|
||||
+ api::adblock_private::RemoveCustomFilter::Params::Create(args());
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
+ auto* adblock_configuration =
|
||||
@@ -2551,7 +2551,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+EyeoFilteringPrivateCreateConfigurationFunction::Run() {
|
||||
+ absl::optional<api::eyeo_filtering_private::CreateConfiguration::Params>
|
||||
+ std::optional<api::eyeo_filtering_private::CreateConfiguration::Params>
|
||||
+ params(api::eyeo_filtering_private::CreateConfiguration::Params::Create(
|
||||
+ args()));
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
@@ -2584,7 +2584,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+EyeoFilteringPrivateRemoveConfigurationFunction::Run() {
|
||||
+ absl::optional<api::eyeo_filtering_private::RemoveConfiguration::Params>
|
||||
+ std::optional<api::eyeo_filtering_private::RemoveConfiguration::Params>
|
||||
+ params(api::eyeo_filtering_private::RemoveConfiguration::Params::Create(
|
||||
+ args()));
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
@@ -2635,7 +2635,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+EyeoFilteringPrivateSetEnabledFunction::Run() {
|
||||
+ absl::optional<api::eyeo_filtering_private::SetEnabled::Params> params(
|
||||
+ std::optional<api::eyeo_filtering_private::SetEnabled::Params> params(
|
||||
+ api::eyeo_filtering_private::SetEnabled::Params::Create(args()));
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
+ auto* configuration =
|
||||
@@ -2655,7 +2655,7 @@ new file mode 100644
|
||||
+ ~EyeoFilteringPrivateIsEnabledFunction() = default;
|
||||
+
|
||||
+ExtensionFunction::ResponseAction EyeoFilteringPrivateIsEnabledFunction::Run() {
|
||||
+ absl::optional<api::eyeo_filtering_private::IsEnabled::Params> params(
|
||||
+ std::optional<api::eyeo_filtering_private::IsEnabled::Params> params(
|
||||
+ api::eyeo_filtering_private::IsEnabled::Params::Create(args()));
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
+ auto* configuration =
|
||||
@@ -2690,7 +2690,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+EyeoFilteringPrivateSubscribeToFilterListFunction::Run() {
|
||||
+ absl::optional<api::eyeo_filtering_private::SubscribeToFilterList::Params>
|
||||
+ std::optional<api::eyeo_filtering_private::SubscribeToFilterList::Params>
|
||||
+ params(api::eyeo_filtering_private::SubscribeToFilterList::Params::Create(
|
||||
+ args()));
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
@@ -2718,7 +2718,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+EyeoFilteringPrivateUnsubscribeFromFilterListFunction::Run() {
|
||||
+ absl::optional<api::eyeo_filtering_private::UnsubscribeFromFilterList::Params>
|
||||
+ std::optional<api::eyeo_filtering_private::UnsubscribeFromFilterList::Params>
|
||||
+ params(api::eyeo_filtering_private::UnsubscribeFromFilterList::Params::
|
||||
+ Create(args()));
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
@@ -2746,7 +2746,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+EyeoFilteringPrivateGetFilterListsFunction::Run() {
|
||||
+ absl::optional<api::eyeo_filtering_private::GetFilterLists::Params> params(
|
||||
+ std::optional<api::eyeo_filtering_private::GetFilterLists::Params> params(
|
||||
+ api::eyeo_filtering_private::GetFilterLists::Params::Create(args()));
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
+ auto* configuration =
|
||||
@@ -2772,7 +2772,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+EyeoFilteringPrivateAddAllowedDomainFunction::Run() {
|
||||
+ absl::optional<api::eyeo_filtering_private::AddAllowedDomain::Params> params(
|
||||
+ std::optional<api::eyeo_filtering_private::AddAllowedDomain::Params> params(
|
||||
+ api::eyeo_filtering_private::AddAllowedDomain::Params::Create(args()));
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
+ auto* configuration =
|
||||
@@ -2793,7 +2793,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+EyeoFilteringPrivateRemoveAllowedDomainFunction::Run() {
|
||||
+ absl::optional<api::eyeo_filtering_private::RemoveAllowedDomain::Params>
|
||||
+ std::optional<api::eyeo_filtering_private::RemoveAllowedDomain::Params>
|
||||
+ params(api::eyeo_filtering_private::RemoveAllowedDomain::Params::Create(
|
||||
+ args()));
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
@@ -2815,7 +2815,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+EyeoFilteringPrivateGetAllowedDomainsFunction::Run() {
|
||||
+ absl::optional<api::eyeo_filtering_private::GetAllowedDomains::Params> params(
|
||||
+ std::optional<api::eyeo_filtering_private::GetAllowedDomains::Params> params(
|
||||
+ api::eyeo_filtering_private::GetAllowedDomains::Params::Create(args()));
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
+ auto* configuration =
|
||||
@@ -2837,7 +2837,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+EyeoFilteringPrivateAddCustomFilterFunction::Run() {
|
||||
+ absl::optional<api::eyeo_filtering_private::AddCustomFilter::Params> params(
|
||||
+ std::optional<api::eyeo_filtering_private::AddCustomFilter::Params> params(
|
||||
+ api::eyeo_filtering_private::AddCustomFilter::Params::Create(args()));
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
+ auto* configuration =
|
||||
@@ -2858,7 +2858,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+EyeoFilteringPrivateRemoveCustomFilterFunction::Run() {
|
||||
+ absl::optional<api::eyeo_filtering_private::RemoveCustomFilter::Params>
|
||||
+ std::optional<api::eyeo_filtering_private::RemoveCustomFilter::Params>
|
||||
+ params(api::eyeo_filtering_private::RemoveCustomFilter::Params::Create(
|
||||
+ args()));
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
@@ -2874,7 +2874,7 @@ new file mode 100644
|
||||
+
|
||||
+ExtensionFunction::ResponseAction
|
||||
+EyeoFilteringPrivateGetCustomFiltersFunction::Run() {
|
||||
+ absl::optional<api::eyeo_filtering_private::GetCustomFilters::Params> params(
|
||||
+ std::optional<api::eyeo_filtering_private::GetCustomFilters::Params> params(
|
||||
+ api::eyeo_filtering_private::GetCustomFilters::Params::Create(args()));
|
||||
+ EXTENSION_FUNCTION_VALIDATE(params);
|
||||
+ auto* configuration =
|
||||
|
||||
Reference in New Issue
Block a user