[Android WebView] Fix webview perf bot switchover to use org.chromium.webview_shell...
[chromium-blink-merge.git] / content / public / browser / trace_uploader.h
blob3f12d343df5f404bb536a97de10368c3c06a0bcb
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_BROWSER_TRACE_UPLOADER_H_
6 #define CONTENT_PUBLIC_BROWSER_TRACE_UPLOADER_H_
8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/values.h"
12 namespace content {
14 // Used to implement a trace upload service for use in about://tracing,
15 // which gets requested through the TracingDelegate.
16 class TraceUploader {
17 public:
18 // This should be called when the tracing is complete.
19 // The bool denotes success or failure, the string is feedback
20 // to show in the Tracing UI.
21 typedef base::Callback<void(bool, const std::string&)> UploadDoneCallback;
22 // Call this to update the progress UI with the current bytes uploaded,
23 // as well as the total.
24 typedef base::Callback<void(int64, int64)> UploadProgressCallback;
26 virtual ~TraceUploader() {}
28 // Compresses and uploads the given file contents.
29 virtual void DoUpload(const std::string& file_contents,
30 scoped_ptr<base::DictionaryValue> metadata,
31 const UploadProgressCallback& progress_callback,
32 const UploadDoneCallback& done_callback) = 0;
35 } // namespace content
37 #endif // CONTENT_PUBLIC_BROWSER_TRACE_UPLOADER_H_