summaryrefslogtreecommitdiffstats
path: root/components/page_load_metrics/browser/page_load_metrics_util.cc
blob: dbfa35ebad04390d702be6642f8a546ce3715e76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright 2015 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.

#include "components/page_load_metrics/browser/page_load_metrics_util.h"

#include <algorithm>

#include "components/page_load_metrics/browser/page_load_metrics_observer.h"
#include "components/page_load_metrics/common/page_load_timing.h"

namespace page_load_metrics {

bool WasStartedInForegroundEventInForeground(base::TimeDelta event,
                                             const PageLoadExtraInfo& info) {
  return info.started_in_foreground && !event.is_zero() &&
         (info.first_background_time.is_zero() ||
          event < info.first_background_time);
}

}  // namespace page_load_metrics