OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_TRACING_TRACING_UI_H_ | 5 #ifndef CONTENT_BROWSER_TRACING_TRACING_UI_H_ |
6 #define CONTENT_BROWSER_TRACING_TRACING_UI_H_ | 6 #define CONTENT_BROWSER_TRACING_TRACING_UI_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "content/public/browser/trace_uploader.h" | 15 #include "content/public/browser/trace_uploader.h" |
16 #include "content/public/browser/web_ui_controller.h" | 16 #include "content/public/browser/web_ui_controller.h" |
17 | 17 |
18 namespace base { | |
19 namespace trace_event { | |
20 class TraceConfig; | |
21 } // namespace trace_event | |
22 } // namespace base | |
23 | |
18 namespace content { | 24 namespace content { |
19 | 25 |
20 class TracingDelegate; | 26 class TracingDelegate; |
21 | 27 |
22 // The C++ back-end for the chrome://tracing webui page. | 28 // The C++ back-end for the chrome://tracing webui page. |
23 class CONTENT_EXPORT TracingUI : public WebUIController { | 29 class CONTENT_EXPORT TracingUI : public WebUIController { |
24 public: | 30 public: |
25 explicit TracingUI(WebUI* web_ui); | 31 explicit TracingUI(WebUI* web_ui); |
26 ~TracingUI() override; | 32 ~TracingUI() override; |
27 void OnTraceUploadProgress(int64_t current, int64_t total); | 33 void OnTraceUploadProgress(int64_t current, int64_t total); |
28 void OnTraceUploadComplete(bool success, const std::string& feedback); | 34 void OnTraceUploadComplete(bool success, const std::string& feedback); |
29 | 35 |
36 // Public for testing. | |
37 static bool GetTracingOptions(const std::string& data64, | |
Primiano Tucci (use gerrit)
2017/06/22 19:04:47
static functions should go on the top. But also if
erikchen
2017/06/22 19:30:45
Done.
| |
38 base::trace_event::TraceConfig* trace_config); | |
39 | |
30 private: | 40 private: |
31 void DoUploadInternal(const std::string& file_contents, | 41 void DoUploadInternal(const std::string& file_contents, |
32 TraceUploader::UploadMode upload_mode); | 42 TraceUploader::UploadMode upload_mode); |
33 void DoUpload(const base::ListValue* args); | 43 void DoUpload(const base::ListValue* args); |
34 void DoUploadBase64Encoded(const base::ListValue* args); | 44 void DoUploadBase64Encoded(const base::ListValue* args); |
35 | 45 |
36 std::unique_ptr<TracingDelegate> delegate_; | 46 std::unique_ptr<TracingDelegate> delegate_; |
37 std::unique_ptr<TraceUploader> trace_uploader_; | 47 std::unique_ptr<TraceUploader> trace_uploader_; |
38 base::WeakPtrFactory<TracingUI> weak_factory_; | 48 base::WeakPtrFactory<TracingUI> weak_factory_; |
39 | 49 |
40 DISALLOW_COPY_AND_ASSIGN(TracingUI); | 50 DISALLOW_COPY_AND_ASSIGN(TracingUI); |
41 }; | 51 }; |
42 | 52 |
43 } // namespace content | 53 } // namespace content |
44 | 54 |
45 #endif // CONTENT_BROWSER_TRACING_TRACING_UI_H_ | 55 #endif // CONTENT_BROWSER_TRACING_TRACING_UI_H_ |
OLD | NEW |