Avi Drissman | 4e1b7bc3 | 2022-09-15 14:03:50 | [diff] [blame] | 1 | // Copyright 2011 The Chromium Authors |
[email protected] | bcb6ee23d | 2013-02-03 04:06:40 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
tfarina | bccc34c7 | 2015-02-27 21:32:15 | [diff] [blame] | 5 | #ifndef CONTENT_BROWSER_TRACING_TRACING_UI_H_ |
6 | #define CONTENT_BROWSER_TRACING_TRACING_UI_H_ | ||||
[email protected] | bcb6ee23d | 2013-02-03 04:06:40 | [diff] [blame] | 7 | |
avi | b734894 | 2015-12-25 20:57:10 | [diff] [blame] | 8 | #include <stdint.h> |
9 | |||||
[email protected] | b12387e6 | 2014-06-27 20:52:06 | [diff] [blame] | 10 | #include <map> |
11 | #include <string> | ||||
12 | |||||
13 | #include "base/memory/weak_ptr.h" | ||||
Lei Zhang | 7ab31375 | 2021-11-17 01:26:00 | [diff] [blame] | 14 | #include "content/common/content_export.h" |
rbpotter | d3126587 | 2025-02-21 21:11:57 | [diff] [blame] | 15 | #include "content/public/browser/internal_webui_config.h" |
[email protected] | bcb6ee23d | 2013-02-03 04:06:40 | [diff] [blame] | 16 | #include "content/public/browser/web_ui_controller.h" |
Giovanni Ortuño Urquidi | f8c1bd9 | 2022-05-25 04:12:05 | [diff] [blame] | 17 | #include "content/public/common/url_constants.h" |
[email protected] | bcb6ee23d | 2013-02-03 04:06:40 | [diff] [blame] | 18 | |
erikchen | 3e164f7 | 2017-06-22 21:15:44 | [diff] [blame] | 19 | namespace base { |
20 | namespace trace_event { | ||||
21 | class TraceConfig; | ||||
22 | } // namespace trace_event | ||||
23 | } // namespace base | ||||
24 | |||||
[email protected] | bcb6ee23d | 2013-02-03 04:06:40 | [diff] [blame] | 25 | namespace content { |
26 | |||||
Giovanni Ortuño Urquidi | f8c1bd9 | 2022-05-25 04:12:05 | [diff] [blame] | 27 | class TracingUI; |
28 | |||||
29 | // WebUIConfig for the chrome://tracing page. | ||||
rbpotter | d3126587 | 2025-02-21 21:11:57 | [diff] [blame] | 30 | class TracingUIConfig : public DefaultInternalWebUIConfig<TracingUI> { |
Giovanni Ortuño Urquidi | f8c1bd9 | 2022-05-25 04:12:05 | [diff] [blame] | 31 | public: |
rbpotter | d3126587 | 2025-02-21 21:11:57 | [diff] [blame] | 32 | TracingUIConfig() : DefaultInternalWebUIConfig(kChromeUITracingHost) {} |
Giovanni Ortuño Urquidi | f8c1bd9 | 2022-05-25 04:12:05 | [diff] [blame] | 33 | }; |
oysteine | c563c58 | 2015-02-13 19:19:52 | [diff] [blame] | 34 | |
[email protected] | bcb6ee23d | 2013-02-03 04:06:40 | [diff] [blame] | 35 | // The C++ back-end for the chrome://tracing webui page. |
[email protected] | 06d5b6e | 2014-01-14 14:55:58 | [diff] [blame] | 36 | class CONTENT_EXPORT TracingUI : public WebUIController { |
[email protected] | bcb6ee23d | 2013-02-03 04:06:40 | [diff] [blame] | 37 | public: |
38 | explicit TracingUI(WebUI* web_ui); | ||||
Peter Boström | 828b902 | 2021-09-21 02:28:43 | [diff] [blame] | 39 | |
40 | TracingUI(const TracingUI&) = delete; | ||||
41 | TracingUI& operator=(const TracingUI&) = delete; | ||||
42 | |||||
dcheng | c2282aa | 2014-10-21 12:07:58 | [diff] [blame] | 43 | ~TracingUI() override; |
erikchen | 3e164f7 | 2017-06-22 21:15:44 | [diff] [blame] | 44 | |
45 | // Public for testing. | ||||
46 | static bool GetTracingOptions(const std::string& data64, | ||||
Sami Kyostila | b3f9041 | 2020-07-09 11:47:54 | [diff] [blame] | 47 | base::trace_event::TraceConfig& trace_config, |
48 | std::string& out_stream_format); | ||||
[email protected] | bcb6ee23d | 2013-02-03 04:06:40 | [diff] [blame] | 49 | |
50 | private: | ||||
Jeremy Roman | 3bca4bf | 2019-07-11 03:41:25 | [diff] [blame] | 51 | base::WeakPtrFactory<TracingUI> weak_factory_{this}; |
[email protected] | bcb6ee23d | 2013-02-03 04:06:40 | [diff] [blame] | 52 | }; |
53 | |||||
54 | } // namespace content | ||||
55 | |||||
tfarina | bccc34c7 | 2015-02-27 21:32:15 | [diff] [blame] | 56 | #endif // CONTENT_BROWSER_TRACING_TRACING_UI_H_ |