| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/devtools/devtools_tracing_handler.h" | 5 #include "content/browser/devtools/devtools_tracing_handler.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/debug/trace_event_impl.h" | 10 #include "base/debug/trace_event_impl.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 const char kRecordUntilFull[] = "record-until-full"; | 25 const char kRecordUntilFull[] = "record-until-full"; |
| 26 const char kRecordContinuously[] = "record-continuously"; | 26 const char kRecordContinuously[] = "record-continuously"; |
| 27 const char kRecordAsMuchAsPossible[] = "record-as-much-as-possible"; | 27 const char kRecordAsMuchAsPossible[] = "record-as-much-as-possible"; |
| 28 const char kEnableSampling[] = "enable-sampling"; | 28 const char kEnableSampling[] = "enable-sampling"; |
| 29 | 29 |
| 30 class DevToolsTraceSinkProxy : public TracingController::TraceDataSink { | 30 class DevToolsTraceSinkProxy : public TracingController::TraceDataSink { |
| 31 public: | 31 public: |
| 32 explicit DevToolsTraceSinkProxy(base::WeakPtr<DevToolsTracingHandler> handler) | 32 explicit DevToolsTraceSinkProxy(base::WeakPtr<DevToolsTracingHandler> handler) |
| 33 : tracing_handler_(handler) {} | 33 : tracing_handler_(handler) {} |
| 34 | 34 |
| 35 virtual void AddTraceChunk(const std::string& chunk) OVERRIDE { | 35 virtual void AddTraceChunk(const std::string& chunk) override { |
| 36 if (DevToolsTracingHandler* h = tracing_handler_.get()) | 36 if (DevToolsTracingHandler* h = tracing_handler_.get()) |
| 37 h->OnTraceDataCollected(chunk); | 37 h->OnTraceDataCollected(chunk); |
| 38 } | 38 } |
| 39 virtual void Close() OVERRIDE { | 39 virtual void Close() override { |
| 40 if (DevToolsTracingHandler* h = tracing_handler_.get()) | 40 if (DevToolsTracingHandler* h = tracing_handler_.get()) |
| 41 h->OnTraceComplete(); | 41 h->OnTraceComplete(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 virtual ~DevToolsTraceSinkProxy() {} | 45 virtual ~DevToolsTraceSinkProxy() {} |
| 46 | 46 |
| 47 base::WeakPtr<DevToolsTracingHandler> tracing_handler_; | 47 base::WeakPtr<DevToolsTracingHandler> tracing_handler_; |
| 48 }; | 48 }; |
| 49 | 49 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 it != category_set.end(); ++it) { | 232 it != category_set.end(); ++it) { |
| 233 category_list->AppendString(*it); | 233 category_list->AppendString(*it); |
| 234 } | 234 } |
| 235 | 235 |
| 236 response->Set(devtools::Tracing::getCategories::kResponseCategories, | 236 response->Set(devtools::Tracing::getCategories::kResponseCategories, |
| 237 category_list); | 237 category_list); |
| 238 SendAsyncResponse(command->SuccessResponse(response)); | 238 SendAsyncResponse(command->SuccessResponse(response)); |
| 239 } | 239 } |
| 240 | 240 |
| 241 } // namespace content | 241 } // namespace content |
| OLD | NEW |