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> |
| 9 |
8 #include <map> | 10 #include <map> |
9 #include <string> | 11 #include <string> |
10 | 12 |
| 13 #include "base/macros.h" |
11 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
12 #include "content/public/browser/trace_uploader.h" | 15 #include "content/public/browser/trace_uploader.h" |
13 #include "content/public/browser/web_ui_controller.h" | 16 #include "content/public/browser/web_ui_controller.h" |
14 | 17 |
15 namespace content { | 18 namespace content { |
16 | 19 |
17 class TracingDelegate; | 20 class TracingDelegate; |
18 | 21 |
19 // The C++ back-end for the chrome://tracing webui page. | 22 // The C++ back-end for the chrome://tracing webui page. |
20 class CONTENT_EXPORT TracingUI : public WebUIController { | 23 class CONTENT_EXPORT TracingUI : public WebUIController { |
21 public: | 24 public: |
22 explicit TracingUI(WebUI* web_ui); | 25 explicit TracingUI(WebUI* web_ui); |
23 ~TracingUI() override; | 26 ~TracingUI() override; |
24 void OnMonitoringStateChanged(bool is_monitoring); | 27 void OnMonitoringStateChanged(bool is_monitoring); |
25 void OnTraceUploadProgress(int64 current, int64 total); | 28 void OnTraceUploadProgress(int64_t current, int64_t total); |
26 void OnTraceUploadComplete(bool success, const std::string& feedback); | 29 void OnTraceUploadComplete(bool success, const std::string& feedback); |
27 | 30 |
28 private: | 31 private: |
29 void DoUploadInternal(const std::string& file_contents, | 32 void DoUploadInternal(const std::string& file_contents, |
30 TraceUploader::UploadMode upload_mode); | 33 TraceUploader::UploadMode upload_mode); |
31 void DoUpload(const base::ListValue* args); | 34 void DoUpload(const base::ListValue* args); |
32 void DoUploadBase64Encoded(const base::ListValue* args); | 35 void DoUploadBase64Encoded(const base::ListValue* args); |
33 | 36 |
34 scoped_ptr<TracingDelegate> delegate_; | 37 scoped_ptr<TracingDelegate> delegate_; |
35 scoped_ptr<TraceUploader> trace_uploader_; | 38 scoped_ptr<TraceUploader> trace_uploader_; |
36 base::WeakPtrFactory<TracingUI> weak_factory_; | 39 base::WeakPtrFactory<TracingUI> weak_factory_; |
37 | 40 |
38 DISALLOW_COPY_AND_ASSIGN(TracingUI); | 41 DISALLOW_COPY_AND_ASSIGN(TracingUI); |
39 }; | 42 }; |
40 | 43 |
41 } // namespace content | 44 } // namespace content |
42 | 45 |
43 #endif // CONTENT_BROWSER_TRACING_TRACING_UI_H_ | 46 #endif // CONTENT_BROWSER_TRACING_TRACING_UI_H_ |
OLD | NEW |