blob: 6ebe72f8147751059ad5d1896b20ab4292150389 [file] [log] [blame]
Avi Drissman4e1b7bc32022-09-15 14:03:501// Copyright 2011 The Chromium Authors
[email protected]bcb6ee23d2013-02-03 04:06:402// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
tfarinabccc34c72015-02-27 21:32:155#ifndef CONTENT_BROWSER_TRACING_TRACING_UI_H_
6#define CONTENT_BROWSER_TRACING_TRACING_UI_H_
[email protected]bcb6ee23d2013-02-03 04:06:407
avib7348942015-12-25 20:57:108#include <stdint.h>
9
[email protected]b12387e62014-06-27 20:52:0610#include <map>
11#include <string>
12
13#include "base/memory/weak_ptr.h"
Lei Zhang7ab313752021-11-17 01:26:0014#include "content/common/content_export.h"
rbpotterd31265872025-02-21 21:11:5715#include "content/public/browser/internal_webui_config.h"
[email protected]bcb6ee23d2013-02-03 04:06:4016#include "content/public/browser/web_ui_controller.h"
Giovanni Ortuño Urquidif8c1bd92022-05-25 04:12:0517#include "content/public/common/url_constants.h"
[email protected]bcb6ee23d2013-02-03 04:06:4018
erikchen3e164f72017-06-22 21:15:4419namespace base {
20namespace trace_event {
21class TraceConfig;
22} // namespace trace_event
23} // namespace base
24
[email protected]bcb6ee23d2013-02-03 04:06:4025namespace content {
26
Giovanni Ortuño Urquidif8c1bd92022-05-25 04:12:0527class TracingUI;
28
29// WebUIConfig for the chrome://tracing page.
rbpotterd31265872025-02-21 21:11:5730class TracingUIConfig : public DefaultInternalWebUIConfig<TracingUI> {
Giovanni Ortuño Urquidif8c1bd92022-05-25 04:12:0531 public:
rbpotterd31265872025-02-21 21:11:5732 TracingUIConfig() : DefaultInternalWebUIConfig(kChromeUITracingHost) {}
Giovanni Ortuño Urquidif8c1bd92022-05-25 04:12:0533};
oysteinec563c582015-02-13 19:19:5234
[email protected]bcb6ee23d2013-02-03 04:06:4035// The C++ back-end for the chrome://tracing webui page.
[email protected]06d5b6e2014-01-14 14:55:5836class CONTENT_EXPORT TracingUI : public WebUIController {
[email protected]bcb6ee23d2013-02-03 04:06:4037 public:
38 explicit TracingUI(WebUI* web_ui);
Peter Boström828b9022021-09-21 02:28:4339
40 TracingUI(const TracingUI&) = delete;
41 TracingUI& operator=(const TracingUI&) = delete;
42
dchengc2282aa2014-10-21 12:07:5843 ~TracingUI() override;
erikchen3e164f72017-06-22 21:15:4444
45 // Public for testing.
46 static bool GetTracingOptions(const std::string& data64,
Sami Kyostilab3f90412020-07-09 11:47:5447 base::trace_event::TraceConfig& trace_config,
48 std::string& out_stream_format);
[email protected]bcb6ee23d2013-02-03 04:06:4049
50 private:
Jeremy Roman3bca4bf2019-07-11 03:41:2551 base::WeakPtrFactory<TracingUI> weak_factory_{this};
[email protected]bcb6ee23d2013-02-03 04:06:4052};
53
54} // namespace content
55
tfarinabccc34c72015-02-27 21:32:1556#endif // CONTENT_BROWSER_TRACING_TRACING_UI_H_