2013-12-17 23:04:35 +01:00
|
|
|
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
|
2012-10-18 00:45:49 +02:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that can
|
|
|
|
// be found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef CEF_LIBCEF_BROWSER_TRACE_SUBSCRIBER_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_TRACE_SUBSCRIBER_H_
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "include/cef_trace.h"
|
|
|
|
|
2013-02-27 18:56:03 +01:00
|
|
|
#include "base/files/file_path.h"
|
2013-12-17 23:04:35 +01:00
|
|
|
#include "base/memory/ref_counted_memory.h"
|
|
|
|
#include "base/memory/weak_ptr.h"
|
2012-10-18 00:45:49 +02:00
|
|
|
|
|
|
|
// May only be accessed on the browser process UI thread.
|
2013-12-17 23:04:35 +01:00
|
|
|
class CefTraceSubscriber {
|
2012-10-18 00:45:49 +02:00
|
|
|
public:
|
|
|
|
CefTraceSubscriber();
|
|
|
|
virtual ~CefTraceSubscriber();
|
|
|
|
|
2014-02-05 21:35:45 +01:00
|
|
|
bool BeginTracing(const std::string& categories,
|
|
|
|
CefRefPtr<CefCompletionCallback> callback);
|
|
|
|
bool EndTracing(const base::FilePath& tracing_file,
|
|
|
|
CefRefPtr<CefEndTracingCallback> callback);
|
2013-04-16 00:16:01 +02:00
|
|
|
|
2012-10-18 00:45:49 +02:00
|
|
|
private:
|
2014-09-27 01:48:19 +02:00
|
|
|
void ContinueEndTracing(CefRefPtr<CefEndTracingCallback> callback,
|
|
|
|
const base::FilePath& tracing_file);
|
2013-12-17 23:04:35 +01:00
|
|
|
void OnTracingFileResult(CefRefPtr<CefEndTracingCallback> callback,
|
|
|
|
const base::FilePath& tracing_file);
|
2012-10-18 00:45:49 +02:00
|
|
|
|
|
|
|
bool collecting_trace_data_;
|
2013-12-17 23:04:35 +01:00
|
|
|
base::WeakPtrFactory<CefTraceSubscriber> weak_factory_;
|
2012-10-18 00:45:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_TRACE_SUBSCRIBER_H_
|