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

Unified Diff: chrome/browser/browsing_data/origin_filter_builder.h

Issue 2647683002: Consolidate Origin- and RegistrableDomain- FilterBuilder into one class (Closed)
Patch Set: Fix memory leak. Created 3 years, 11 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: chrome/browser/browsing_data/origin_filter_builder.h
diff --git a/chrome/browser/browsing_data/origin_filter_builder.h b/chrome/browser/browsing_data/origin_filter_builder.h
deleted file mode 100644
index 7e0a4f8b9df1334ec16f27ea79f4310cf34a6155..0000000000000000000000000000000000000000
--- a/chrome/browser/browsing_data/origin_filter_builder.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// 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 CHROME_BROWSER_BROWSING_DATA_ORIGIN_FILTER_BUILDER_H_
-#define CHROME_BROWSER_BROWSING_DATA_ORIGIN_FILTER_BUILDER_H_
-
-#include <ostream>
-#include <set>
-#include <string>
-#include <vector>
-
-#include "base/callback.h"
-#include "chrome/browser/browsing_data/browsing_data_filter_builder.h"
-#include "url/gurl.h"
-#include "url/origin.h"
-
-// A class that constructs URL deletion filters (represented as GURL->bool
-// predicates) that match certain origins.
-//
-// IMPORTANT NOTE: While this class does define cookie, channel ID, and plugin
-// filtering methods, as required by the BrowsingDataFilterBuilder interface,
-// it is not suitable for deletion of those data types, as they are scoped
-// to eTLD+1. Instead, use RegistrableDomainFilterBuilder and see its
-// documenation for more details.
-class OriginFilterBuilder : public BrowsingDataFilterBuilder {
- public:
- // Constructs a filter with the given |mode| - whitelist or blacklist.
- explicit OriginFilterBuilder(Mode mode);
-
- ~OriginFilterBuilder() override;
-
- // Adds the |origin| to the (white- or black-) list.
- void AddOrigin(const url::Origin& origin);
-
- // Builds a filter that matches URLs whose origins are in the whitelist,
- // or aren't in the blacklist.
- base::Callback<bool(const GURL&)> BuildGeneralFilter() const override;
-
- // Cookie filter is not implemented in this subclass. Please use
- // a BrowsingDataFilterBuilder with different scoping,
- // such as RegistrableDomainFilterBuilder.
- base::Callback<bool(const net::CanonicalCookie& cookie)>
- BuildCookieFilter() const override;
-
- // Channel ID filter is not implemented in this subclasss. Please use
- // a BrowsingDataFilterBuilder with different scoping,
- // such as RegistrableDomainFilterBuilder.
- base::Callback<bool(const std::string& channel_id_server_id)>
- BuildChannelIDFilter() const override;
-
- // Plugin site filter is not implemented in this subclass. Please use
- // a BrowsingDataFilterBuilder with different scoping,
- // such as RegistrableDomainFilterBuilder.
- base::Callback<bool(const std::string& site)>
- BuildPluginFilter() const override;
-
- bool operator==(const OriginFilterBuilder& other) const;
-
- protected:
- bool IsEmpty() const override;
-
- private:
- // True if the origin of |url| is in the whitelist, or isn't in the blacklist.
- // The whitelist or blacklist is represented as |origins| and |mode|.
- static bool MatchesURL(
- std::set<url::Origin>* origins, Mode mode, const GURL& url);
-
- // The list of origins and whether they should be interpreted as a whitelist
- // or blacklist.
- std::set<url::Origin> origin_list_;
-
- DISALLOW_COPY_AND_ASSIGN(OriginFilterBuilder);
-};
-
-#endif // CHROME_BROWSER_BROWSING_DATA_ORIGIN_FILTER_BUILDER_H_

Powered by Google App Engine
This is Rietveld 408576698