| Index: chrome/test/automation/browser_proxy.cc
|
| diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc
|
| index a3a1399194c1c8bd66c3324746598f9441943903..9bf31a09026c4d879d81c87b2e51b5f2d201650d 100644
|
| --- a/chrome/test/automation/browser_proxy.cc
|
| +++ b/chrome/test/automation/browser_proxy.cc
|
| @@ -639,3 +639,44 @@ bool BrowserProxy::GetInitialLoadTimes(float* min_start_time,
|
| std::sort(stop_times->begin(), stop_times->end());
|
| return true;
|
| }
|
| +
|
| +bool BrowserProxy::BeginTracing(const std::string& included_categories) {
|
| + std::vector<std::string> included, excluded;
|
| + included.push_back(included_categories);
|
| + return BeginTracing(included, excluded);
|
| +}
|
| +
|
| +bool BrowserProxy::BeginTracing(
|
| + const std::vector<std::string>& included_categories,
|
| + const std::vector<std::string>& excluded_categories) {
|
| + if (!is_valid())
|
| + return false;
|
| +
|
| + bool result = false;
|
| + sender_->Send(new AutomationMsg_BeginTracing(included_categories,
|
| + excluded_categories,
|
| + &result));
|
| + return result;
|
| +}
|
| +
|
| +bool BrowserProxy::EndTracing(std::string* json_trace_output) {
|
| + if (!is_valid())
|
| + return false;
|
| +
|
| + json_trace_output->clear();
|
| + bool success = false;
|
| + int remaining_chunks = 0;
|
| + std::string chunk;
|
| + sender_->Send(new AutomationMsg_EndTracing(&success));
|
| + if (success) {
|
| + // workaround IPC payload size limitation by getting chunks.
|
| + do {
|
| + sender_->Send(new AutomationMsg_GetTracingOutput(&chunk,
|
| + &remaining_chunks));
|
| + *json_trace_output += chunk;
|
| + } while (remaining_chunks > 0);
|
| + success = (remaining_chunks == 0);
|
| + }
|
| + return success;
|
| +}
|
| +
|
|
|