chromium/services/metrics/public/cpp/ukm_source.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "services/metrics/public/cpp/ukm_source.h"

#include <utility>

#include "base/atomicops.h"
#include "base/check_op.h"
#include "base/hash/hash.h"
#include "base/notreached.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "third_party/metrics_proto/ukm/source.pb.h"

namespace ukm {

namespace {

// The maximum length of a URL we will record.
constexpr int kMaxURLLength =;

// The string sent in place of a URL if the real URL was too long.
constexpr char kMaxUrlLengthMessage[] =;

// Using a simple global assumes that all access to it will be done on the same
// thread, namely the UI thread. If this becomes not the case then it can be
// changed to an Atomic32 (make AndroidActivityTypeState derive from int32_t)
// and accessed with no-barrier loads and stores.
int32_t g_android_activity_type_state =;

// Returns a URL that is under the length limit, by returning a constant
// string when the URL is too long.
std::string GetShortenedURL(const GURL& url) {}

// Translates ukm::SourceIdType to the equivalent Source proto enum value.
SourceType ToProtobufSourceType(SourceIdType source_id_type) {}

AndroidActivityType ToProtobufActivityType(int32_t type) {}

}  // namespace

// static
void UkmSource::SetAndroidActivityTypeState(int32_t activity_type) {}

UkmSource::NavigationData::NavigationData() = default;
UkmSource::NavigationData::~NavigationData() = default;

UkmSource::NavigationData::NavigationData(const NavigationData& other) =
    default;

UkmSource::NavigationData UkmSource::NavigationData::CopyWithSanitizedUrls(
    std::vector<GURL> sanitized_urls) const {}

UkmSource::UkmSource(ukm::SourceId id, const GURL& url)
    :{}

UkmSource::UkmSource(ukm::SourceId id, const NavigationData& navigation_data)
    :{}

UkmSource::~UkmSource() = default;

void UkmSource::UpdateUrl(const GURL& new_url) {}

void UkmSource::PopulateProto(Source* proto_source) const {}

}  // namespace ukm