| 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/android/tracing_intent_handler.h" | 5 #include "content/browser/android/tracing_intent_handler.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "content/public/browser/trace_controller.h" | 10 #include "content/public/browser/trace_controller.h" |
| 11 #include "jni/TracingIntentHandler_jni.h" | 11 #include "jni/TracingIntentHandler_jni.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 TracingIntentHandler* g_trace_intent_handler = NULL; | 15 TracingIntentHandler* g_trace_intent_handler = NULL; |
| 16 | 16 |
| 17 TracingIntentHandler::TracingIntentHandler(const base::FilePath& path) | 17 TracingIntentHandler::TracingIntentHandler(const base::FilePath& path) |
| 18 : TraceSubscriberStdio(path) { | 18 : TraceSubscriberStdio(path) { |
| 19 TraceController::GetInstance()->BeginTracing(this, std::string("-test*")); | 19 TraceController::GetInstance()->BeginTracing( |
| 20 this, |
| 21 std::string("-test*"), |
| 22 base::debug::TraceLog::RECORD_UNTIL_FULL); |
| 20 } | 23 } |
| 21 | 24 |
| 22 TracingIntentHandler::~TracingIntentHandler() { | 25 TracingIntentHandler::~TracingIntentHandler() { |
| 23 } | 26 } |
| 24 | 27 |
| 25 void TracingIntentHandler::OnEndTracingComplete() { | 28 void TracingIntentHandler::OnEndTracingComplete() { |
| 26 TraceSubscriberStdio::OnEndTracingComplete(); | 29 TraceSubscriberStdio::OnEndTracingComplete(); |
| 27 delete this; | 30 delete this; |
| 28 } | 31 } |
| 29 | 32 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 44 DCHECK(!g_trace_intent_handler); | 47 DCHECK(!g_trace_intent_handler); |
| 45 g_trace_intent_handler->OnEndTracing(); | 48 g_trace_intent_handler->OnEndTracing(); |
| 46 g_trace_intent_handler = NULL; | 49 g_trace_intent_handler = NULL; |
| 47 } | 50 } |
| 48 | 51 |
| 49 bool RegisterTracingIntentHandler(JNIEnv* env) { | 52 bool RegisterTracingIntentHandler(JNIEnv* env) { |
| 50 return RegisterNativesImpl(env); | 53 return RegisterNativesImpl(env); |
| 51 } | 54 } |
| 52 | 55 |
| 53 } // namespace content | 56 } // namespace content |
| OLD | NEW |