Chromium Code Reviews| Index: chrome/browser/tab_contents/origins_seen_service.h |
| diff --git a/chrome/browser/tab_contents/origins_seen_service.h b/chrome/browser/tab_contents/origins_seen_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1756fe78808799f641af6c43ac5867aac3d579dc |
| --- /dev/null |
| +++ b/chrome/browser/tab_contents/origins_seen_service.h |
| @@ -0,0 +1,30 @@ |
| +// 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_TAB_CONTENTS_ORIGINS_SEEN_SERVICE_H_ |
| +#define CHROME_BROWSER_TAB_CONTENTS_ORIGINS_SEEN_SERVICE_H_ |
| + |
| +#include "base/containers/mru_cache.h" |
| +#include "components/keyed_service/core/keyed_service.h" |
| +#include "url/origin.h" |
| + |
| +class Profile; |
|
Avi (use Gerrit)
2016/04/14 02:43:26
You don't need this forward declaration; remove it
palmer
2016/04/14 18:47:33
Done.
|
| + |
| +class OriginsSeenService : public KeyedService { |
| + public: |
| + OriginsSeenService(); |
| + ~OriginsSeenService() override; |
| + |
| + // Used when deciding whether or not to record |
| + // Navigation.SchemePerUniqueOrigin[OTR]. Inserts a copy of |origin| into the |
| + // set |origins_seen_|, and returns whether or not |origin| was already in the |
| + // set. |
| + bool HaveAlreadySeenOrigin(const url::Origin& origin); |
| + |
| + private: |
| + // Used by |HaveAlreadySeenOrigin|. |
| + base::MRUCache<url::Origin, bool> origins_seen_; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_TAB_CONTENTS_ORIGINS_SEEN_SERVICE_H_ |