Commit 357dd5c5 authored by Oscar Johansson's avatar Oscar Johansson Committed by Commit Bot

Move macro to util file (storage/browser)

When building using jumbo, files gets merged
together and macros with the same name may
end up in the same namspace and conflict. This
happens for the macro UMA_HISTOGRAM_MBYTES.

This commit solves the issue by moving
the macro to a shared util file.

Bug: 871163
Change-Id: If3af541913a6add55ce739eb43f5a747cf4afd9a
Reviewed-on: https://chromium-review.googlesource.com/1163602Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#581192}
parent 77d2955c
......@@ -175,6 +175,7 @@ component("browser") {
"quota/quota_client.h",
"quota/quota_database.cc",
"quota/quota_database.h",
"quota/quota_macros.h",
"quota/quota_manager.cc",
"quota/quota_manager.h",
"quota/quota_manager_proxy.cc",
......
// Copyright 2018 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 STORAGE_BROWSER_QUOTA_QUOTA_MACROS_H_
#define STORAGE_BROWSER_QUOTA_QUOTA_MACROS_H_
#include "base/metrics/histogram_macros.h"
#define UMA_HISTOGRAM_MBYTES(name, sample) \
UMA_HISTOGRAM_CUSTOM_COUNTS((name), static_cast<int>((sample) / kMBytes), 1, \
10 * 1024 * 1024 /* 10TB */, 100)
#endif // STORAGE_BROWSER_QUOTA_QUOTA_MACROS_H_
......@@ -19,7 +19,6 @@
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/numerics/safe_conversions.h"
#include "base/sequenced_task_runner.h"
#include "base/single_thread_task_runner.h"
......@@ -33,6 +32,7 @@
#include "base/trace_event/trace_event.h"
#include "net/base/url_util.h"
#include "storage/browser/quota/client_usage_tracker.h"
#include "storage/browser/quota/quota_macros.h"
#include "storage/browser/quota/quota_manager_proxy.h"
#include "storage/browser/quota/quota_temporary_storage_evictor.h"
#include "storage/browser/quota/storage_monitor.h"
......@@ -48,10 +48,6 @@ const int64_t kMBytes = 1024 * 1024;
const int kMinutesInMilliSeconds = 60 * 1000;
const int64_t kReportHistogramInterval = 60 * 60 * 1000; // 1 hour
#define UMA_HISTOGRAM_MBYTES(name, sample) \
UMA_HISTOGRAM_CUSTOM_COUNTS((name), static_cast<int>((sample) / kMBytes), 1, \
10 * 1024 * 1024 /* 10TB */, 100)
} // namespace
const int64_t QuotaManager::kNoLimit = INT64_MAX;
......
......@@ -6,16 +6,12 @@
#include <algorithm>
#include "base/metrics/histogram_macros.h"
#include "base/rand_util.h"
#include "base/sys_info.h"
#include "base/task/post_task.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#define UMA_HISTOGRAM_MBYTES(name, sample) \
UMA_HISTOGRAM_CUSTOM_COUNTS((name), static_cast<int>((sample) / kMBytes), 1, \
10 * 1024 * 1024 /* 10TB */, 100)
#include "storage/browser/quota/quota_macros.h"
namespace storage {
......
......@@ -10,16 +10,11 @@
#include "base/auto_reset.h"
#include "base/bind.h"
#include "base/metrics/histogram_macros.h"
#include "storage/browser/quota/quota_macros.h"
#include "storage/browser/quota/quota_manager.h"
#include "third_party/blink/public/mojom/quota/quota_types.mojom.h"
#include "url/gurl.h"
#define UMA_HISTOGRAM_MBYTES(name, sample) \
UMA_HISTOGRAM_CUSTOM_COUNTS( \
(name), static_cast<int>((sample) / kMBytes), \
1, 10 * 1024 * 1024 /* 10TB */, 100)
#define UMA_HISTOGRAM_MINUTES(name, sample) \
UMA_HISTOGRAM_CUSTOM_TIMES( \
(name), (sample), \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment