summaryrefslogtreecommitdiff
path: root/chromium/services/tracing/data_sink.h
blob: dcca896169adbd648d9150a285e011eb7bc71639 (plain)
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
// Copyright 2014 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 SERVICES_TRACING_DATA_SINK_H_
#define SERVICES_TRACING_DATA_SINK_H_

#include <string>

#include "base/macros.h"
#include "mojo/public/cpp/system/data_pipe.h"

namespace tracing {

class DataSink {
 public:
  explicit DataSink(mojo::ScopedDataPipeProducerHandle pipe);
  ~DataSink();

  void AddChunk(const std::string& json);

 private:
  mojo::ScopedDataPipeProducerHandle pipe_;
  bool empty_;

  DISALLOW_COPY_AND_ASSIGN(DataSink);
};

}  // namespace tracing

#endif  // SERVICES_TRACING_DATA_SINK_H_