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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 } // namespace | 50 } // namespace |
51 | 51 |
52 const char* DevToolsTracingHandler::kDefaultCategories = | 52 const char* DevToolsTracingHandler::kDefaultCategories = |
53 "-*,disabled-by-default-devtools.timeline*"; | 53 "-*,disabled-by-default-devtools.timeline*"; |
54 const double DevToolsTracingHandler::kDefaultReportingInterval = 1000.0; | 54 const double DevToolsTracingHandler::kDefaultReportingInterval = 1000.0; |
55 const double DevToolsTracingHandler::kMinimumReportingInterval = 250.0; | 55 const double DevToolsTracingHandler::kMinimumReportingInterval = 250.0; |
56 | 56 |
57 DevToolsTracingHandler::DevToolsTracingHandler( | 57 DevToolsTracingHandler::DevToolsTracingHandler( |
58 DevToolsTracingHandler::Target target) | 58 DevToolsTracingHandler::Target target) |
59 : weak_factory_(this), target_(target), is_recording_(false) { | 59 : target_(target), is_recording_(false), weak_factory_(this) { |
60 RegisterCommandHandler(devtools::Tracing::start::kName, | 60 RegisterCommandHandler(devtools::Tracing::start::kName, |
61 base::Bind(&DevToolsTracingHandler::OnStart, | 61 base::Bind(&DevToolsTracingHandler::OnStart, |
62 base::Unretained(this))); | 62 base::Unretained(this))); |
63 RegisterCommandHandler(devtools::Tracing::end::kName, | 63 RegisterCommandHandler(devtools::Tracing::end::kName, |
64 base::Bind(&DevToolsTracingHandler::OnEnd, | 64 base::Bind(&DevToolsTracingHandler::OnEnd, |
65 base::Unretained(this))); | 65 base::Unretained(this))); |
66 RegisterCommandHandler(devtools::Tracing::getCategories::kName, | 66 RegisterCommandHandler(devtools::Tracing::getCategories::kName, |
67 base::Bind(&DevToolsTracingHandler::OnGetCategories, | 67 base::Bind(&DevToolsTracingHandler::OnGetCategories, |
68 base::Unretained(this))); | 68 base::Unretained(this))); |
69 } | 69 } |
(...skipping 162 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 |