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

Unified Diff: chrome/browser/tab_contents/origins_seen_service.h

Issue 1844753002: Histogram the scheme of an origin on the 1st navigation to it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove commented-out line. Created 4 years, 8 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/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..42f66fdbf34ba6d3b6e195ad67d27103305ea67a
--- /dev/null
+++ b/chrome/browser/tab_contents/origins_seen_service.h
@@ -0,0 +1,28 @@
+// 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 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);
battre 2016/04/18 15:20:51 Nit (up to you): The function name suggests that t
palmer 2016/04/18 20:12:44 Done.
+
+ private:
+ // Used by |HaveAlreadySeenOrigin|.
+ base::MRUCache<url::Origin, bool> origins_seen_;
battre 2016/04/18 15:20:51 Can you add a comment that this is intentionally i
palmer 2016/04/18 20:12:43 Done.
+};
+
+#endif // CHROME_BROWSER_TAB_CONTENTS_ORIGINS_SEEN_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698