Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: mojo/common/trace_provider_impl.h

Issue 1841863002: Update monet. (Closed) Base URL: https://github.com/domokit/monet.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/common/trace_controller_impl.cc ('k') | mojo/common/trace_provider_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MOJO_COMMON_TRACE_PROVIDER_IMPL_H_
6 #define MOJO_COMMON_TRACE_PROVIDER_IMPL_H_
7
8 #include "base/memory/ref_counted_memory.h"
9 #include "base/memory/weak_ptr.h"
10 #include "mojo/public/cpp/bindings/binding.h"
11 #include "mojo/public/cpp/bindings/interface_request.h"
12 #include "mojo/services/tracing/interfaces/tracing.mojom.h"
13
14 namespace mojo {
15
16 class TraceProviderImpl : public tracing::TraceProvider {
17 public:
18 TraceProviderImpl();
19 ~TraceProviderImpl() override;
20
21 void Bind(InterfaceRequest<tracing::TraceProvider> request);
22
23 // Enable tracing without waiting for an inbound connection. It will stop if
24 // no TraceRecorder is sent within a set time.
25 void ForceEnableTracing();
26
27 private:
28 // tracing::TraceProvider implementation:
29 void StartTracing(
30 const String& categories,
31 mojo::InterfaceHandle<tracing::TraceRecorder> recorder) override;
32 void StopTracing() override;
33
34 void SendChunk(const scoped_refptr<base::RefCountedString>& events_str,
35 bool has_more_events);
36
37 void DelayedStop();
38 // Stop the collection of traces if no external connection asked for them yet.
39 void StopIfForced();
40
41 Binding<tracing::TraceProvider> binding_;
42 bool tracing_forced_;
43 tracing::TraceRecorderPtr recorder_;
44
45 base::WeakPtrFactory<TraceProviderImpl> weak_factory_;
46 DISALLOW_COPY_AND_ASSIGN(TraceProviderImpl);
47 };
48
49 } // namespace mojo
50
51 #endif // MOJO_COMMON_TRACE_PROVIDER_IMPL_H_
OLDNEW
« no previous file with comments | « mojo/common/trace_controller_impl.cc ('k') | mojo/common/trace_provider_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698