Index: components/reporting/core/browser/reporting_uploader.h |
diff --git a/components/reporting/core/browser/reporting_uploader.h b/components/reporting/core/browser/reporting_uploader.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..73e4ef26d59517ecaf7300772c9e14a53bc2e3f8 |
--- /dev/null |
+++ b/components/reporting/core/browser/reporting_uploader.h |
@@ -0,0 +1,33 @@ |
+// Copyright 2016 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 COMPONENTS_REPORTING_CORE_BROWSER_REPORTING_UPLOADER_H_ |
+#define COMPONENTS_REPORTING_CORE_BROWSER_REPORTING_UPLOADER_H_ |
+ |
+#include "base/callback.h" |
+#include "components/reporting/core/common/reporting_export.h" |
+#include "net/url_request/url_fetcher.h" |
+#include "net/url_request/url_fetcher_delegate.h" |
+#include "net/url_request/url_request_context_getter.h" |
+#include "url/gurl.h" |
+ |
+namespace reporting { |
+ |
+class REPORTING_EXPORT ReportingUploader { |
+ public: |
+ enum Outcome { SUCCESS, REMOVE_ENDPOINT, FAILURE }; |
+ |
+ using Callback = base::Callback<void(Outcome outcome)>; |
+ |
+ virtual void AttemptDelivery(const GURL& url, |
+ const std::string& json, |
+ const Callback& callback) = 0; |
+ |
+ static std::unique_ptr<ReportingUploader> Create( |
+ scoped_refptr<net::URLRequestContextGetter> context); |
+}; |
+ |
+} // namespace reporting |
+ |
+#endif // COMPONENTS_REPORTING_CORE_BROWSER_REPORTING_UPLOADER_H_ |