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

Side by Side Diff: chrome/common/page_load_metrics/page_load_metrics_util.h

Issue 2901383002: Buffer cross frame paint timing updates. (Closed)
Patch Set: address comment Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « chrome/common/BUILD.gn ('k') | chrome/common/page_load_metrics/page_load_metrics_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_COMMON_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_UTIL_H_
6 #define CHROME_COMMON_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_UTIL_H_
7
8 #include <string>
9
10 #include "base/optional.h"
11 #include "base/time/time.h"
12 #include "url/gurl.h"
13
14 namespace page_load_metrics {
15
16 // Returns the minimum value of the optional TimeDeltas, if both values are
17 // set. Otherwise, if one value is set, returns that value. Otherwise, returns
18 // an unset value.
19 base::Optional<base::TimeDelta> OptionalMin(
20 const base::Optional<base::TimeDelta>& a,
21 const base::Optional<base::TimeDelta>& b);
22
23 // Whether the given url has a google hostname.
24 bool IsGoogleHostname(const GURL& url);
25
26 // If the given hostname is a google hostname, returns the portion of the
27 // hostname before the google hostname. Otherwise, returns an unset optional
28 // value.
29 //
30 // For example:
31 // https://example.com/foo => returns an unset optional value
32 // https://google.com/foo => returns ''
33 // https://www.google.com/foo => returns 'www'
34 // https://news.google.com/foo => returns 'news'
35 // https://a.b.c.google.com/foo => returns 'a.b.c'
36 base::Optional<std::string> GetGoogleHostnamePrefix(const GURL& url);
37
38 } // namespace page_load_metrics
39
40 #endif // CHROME_COMMON_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/common/BUILD.gn ('k') | chrome/common/page_load_metrics/page_load_metrics_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698