| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/protocol/tracing_handler.h" | 5 #include "content/browser/devtools/protocol/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/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 void TracingHandler::OnCategoriesReceived( | 146 void TracingHandler::OnCategoriesReceived( |
| 147 DevToolsCommandId command_id, | 147 DevToolsCommandId command_id, |
| 148 const std::set<std::string>& category_set) { | 148 const std::set<std::string>& category_set) { |
| 149 std::vector<std::string> categories; | 149 std::vector<std::string> categories; |
| 150 for (const std::string& category : category_set) | 150 for (const std::string& category : category_set) |
| 151 categories.push_back(category); | 151 categories.push_back(category); |
| 152 client_->SendGetCategoriesResponse(command_id, | 152 client_->SendGetCategoriesResponse(command_id, |
| 153 GetCategoriesResponse::Create()->set_categories(categories)); | 153 GetCategoriesResponse::Create()->set_categories(categories)); |
| 154 } | 154 } |
| 155 | 155 |
| 156 Response TracingHandler::RequestMemoryDump(DevToolsCommandId command_id) { |
| 157 return Response::InternalError("Not implemented"); |
| 158 } |
| 159 |
| 156 void TracingHandler::SetupTimer(double usage_reporting_interval) { | 160 void TracingHandler::SetupTimer(double usage_reporting_interval) { |
| 157 if (usage_reporting_interval == 0) return; | 161 if (usage_reporting_interval == 0) return; |
| 158 | 162 |
| 159 if (usage_reporting_interval < kMinimumReportingInterval) | 163 if (usage_reporting_interval < kMinimumReportingInterval) |
| 160 usage_reporting_interval = kMinimumReportingInterval; | 164 usage_reporting_interval = kMinimumReportingInterval; |
| 161 | 165 |
| 162 base::TimeDelta interval = base::TimeDelta::FromMilliseconds( | 166 base::TimeDelta interval = base::TimeDelta::FromMilliseconds( |
| 163 std::ceil(usage_reporting_interval)); | 167 std::ceil(usage_reporting_interval)); |
| 164 buffer_usage_poll_timer_.reset(new base::Timer( | 168 buffer_usage_poll_timer_.reset(new base::Timer( |
| 165 FROM_HERE, interval, | 169 FROM_HERE, interval, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 178 did_initiate_recording_ = false; | 182 did_initiate_recording_ = false; |
| 179 } | 183 } |
| 180 | 184 |
| 181 bool TracingHandler::IsRecording() const { | 185 bool TracingHandler::IsRecording() const { |
| 182 return TracingController::GetInstance()->IsRecording(); | 186 return TracingController::GetInstance()->IsRecording(); |
| 183 } | 187 } |
| 184 | 188 |
| 185 } // namespace tracing | 189 } // namespace tracing |
| 186 } // namespace devtools | 190 } // namespace devtools |
| 187 } // namespace content | 191 } // namespace content |
| OLD | NEW |