forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchild_histogram_fetcher_impl.h
64 lines (47 loc) · 1.88 KB
/
child_histogram_fetcher_impl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright (c) 2012 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 CONTENT_CHILD_CHILD_HISTOGRAM_IMPL_H
#define CONTENT_CHILD_CHILD_HISTOGRAM_IMPL_H
#include <memory>
#include <string>
#include <vector>
#include "base/macros.h"
#include "base/memory/shared_memory.h"
#include "content/common/histogram_fetcher.mojom.h"
#include "ipc/message_filter.h"
namespace base {
class HistogramDeltaSerialization;
} // namespace base
namespace content {
class ChildHistogramFetcherFactoryImpl
: public content::mojom::ChildHistogramFetcherFactory {
public:
ChildHistogramFetcherFactoryImpl();
~ChildHistogramFetcherFactoryImpl() override;
static void Create(content::mojom::ChildHistogramFetcherFactoryRequest);
private:
void CreateFetcher(mojo::ScopedSharedBufferHandle,
content::mojom::ChildHistogramFetcherRequest) override;
};
class ChildHistogramFetcherImpl : public content::mojom::ChildHistogramFetcher {
public:
ChildHistogramFetcherImpl();
~ChildHistogramFetcherImpl() override;
private:
typedef std::vector<std::string> HistogramPickledList;
// content::mojom::ChildHistogram implementation.
using HistogramDataCallback = content::mojom::ChildHistogramFetcher::
GetChildNonPersistentHistogramDataCallback;
void GetChildNonPersistentHistogramData(
HistogramDataCallback callback) override;
// Extract snapshot data and then send it off to the Browser process.
// Send only a delta to what we have already sent.
void UploadAllHistograms(int64_t sequence_number);
// Prepares histogram deltas for transmission.
std::unique_ptr<base::HistogramDeltaSerialization>
histogram_delta_serialization_;
DISALLOW_COPY_AND_ASSIGN(ChildHistogramFetcherImpl);
};
} // namespace content
#endif // CONTENT_CHILD_CHILD_HISTOGRAM_IMPL_H