blob: dbf245853b7187305598b7f80af0352b3ffe711b [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/callback.h"
namespace content {
// Used to implement a trace upload service for use in about://tracing,
// which gets requested through the TracingDelegate.
class TraceUploader {
// This should be called when the tracing is complete.
// The bool denotes success or failure, the string is feedback
// to show in the Tracing UI.
typedef base::Callback<void(bool, const std::string&)> UploadDoneCallback;
// Call this to update the progress UI with the current bytes uploaded,
// as well as the total.
typedef base::Callback<void(int64, int64)> UploadProgressCallback;
virtual ~TraceUploader() {}
// Compresses and uploads the given file contents.
virtual void DoUpload(const std::string& file_contents,
const UploadProgressCallback& progress_callback,
const UploadDoneCallback& done_callback) = 0;
} // namespace content