#ifndef ANDROID_WEBVIEW_BROWSER_TRACING_AW_TRACING_CONTROLLER_H_
#define ANDROID_WEBVIEW_BROWSER_TRACING_AW_TRACING_CONTROLLER_H_
#include "base/android/jni_weak_ref.h"
#include "base/memory/weak_ptr.h"
namespace android_webview {
class AwTracingController {
public:
AwTracingController(JNIEnv* env, const jni_zero::JavaRef<jobject>& obj);
AwTracingController(const AwTracingController&) = delete;
AwTracingController& operator=(const AwTracingController&) = delete;
bool Start(JNIEnv* env,
std::string& jcategories,
jint mode);
bool StopAndFlush(JNIEnv* env);
bool IsTracing(JNIEnv* env);
private:
~AwTracingController();
void OnTraceDataReceived(std::unique_ptr<std::string> chunk);
void OnTraceDataComplete();
JavaObjectWeakGlobalRef weak_java_object_;
base::WeakPtrFactory<AwTracingController> weak_factory_{this};
};
}
#endif