| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 SHELL_TRACER_H_ | 5 #ifndef SHELL_TRACER_H_ |
| 6 #define SHELL_TRACER_H_ | 6 #define SHELL_TRACER_H_ |
| 7 | 7 |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // Emits a comma if needed. | 74 // Emits a comma if needed. |
| 75 void WriteCommaIfNeeded(); | 75 void WriteCommaIfNeeded(); |
| 76 | 76 |
| 77 // Writes trace file footer and closes out the file. | 77 // Writes trace file footer and closes out the file. |
| 78 void WriteFooterAndClose(); | 78 void WriteFooterAndClose(); |
| 79 | 79 |
| 80 // Set when connected to the tracing service. | 80 // Set when connected to the tracing service. |
| 81 tracing::TraceCollectorPtr coordinator_; | 81 tracing::TraceCollectorPtr coordinator_; |
| 82 scoped_ptr<mojo::common::DataPipeDrainer> drainer_; | 82 scoped_ptr<mojo::common::DataPipeDrainer> drainer_; |
| 83 | 83 |
| 84 mojo::TraceProviderImpl trace_provider_impl_; |
| 84 // Whether we're currently tracing. | 85 // Whether we're currently tracing. |
| 85 bool tracing_; | 86 bool tracing_; |
| 86 // How long to trace after message loop creation. | 87 // How long to trace after message loop creation. |
| 87 int trace_duration_secs_; | 88 int trace_duration_secs_; |
| 88 // Categories to trace. | 89 // Categories to trace. |
| 89 std::string categories_; | 90 std::string categories_; |
| 90 | 91 |
| 91 // Whether we've written the first chunk. | 92 // Whether we've written the first chunk. |
| 92 bool first_chunk_written_; | 93 bool first_chunk_written_; |
| 93 std::string trace_service_data_; | 94 std::string trace_service_data_; |
| 94 | 95 |
| 95 // Trace file, if open. | 96 // Trace file, if open. |
| 96 FILE* trace_file_; | 97 FILE* trace_file_; |
| 97 std::string trace_filename_; | 98 std::string trace_filename_; |
| 98 | 99 |
| 99 DISALLOW_COPY_AND_ASSIGN(Tracer); | 100 DISALLOW_COPY_AND_ASSIGN(Tracer); |
| 100 }; | 101 }; |
| 101 | 102 |
| 102 } // namespace shell | 103 } // namespace shell |
| 103 | 104 |
| 104 #endif // SHELL_TRACER_H_ | 105 #endif // SHELL_TRACER_H_ |
| OLD | NEW |