Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1581)

Unified Diff: content/public/browser/trace_uploader.h

Issue 911153002: Moved the TraceUploader to chrome/ and abstracted it for alternative new upload destinations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/browser/content_browser_client.cc ('k') | content/public/browser/tracing_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/trace_uploader.h
diff --git a/content/public/browser/trace_uploader.h b/content/public/browser/trace_uploader.h
new file mode 100644
index 0000000000000000000000000000000000000000..dbf245853b7187305598b7f80af0352b3ffe711b
--- /dev/null
+++ b/content/public/browser/trace_uploader.h
@@ -0,0 +1,34 @@
+// 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.
+
+#ifndef CONTENT_PUBLIC_BROWSER_TRACE_UPLOADER_H_
+#define CONTENT_PUBLIC_BROWSER_TRACE_UPLOADER_H_
+
+#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 {
+ public:
+ // 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
+
+#endif // CONTENT_PUBLIC_BROWSER_TRACE_UPLOADER_H_
« no previous file with comments | « content/public/browser/content_browser_client.cc ('k') | content/public/browser/tracing_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698