OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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. |
| 4 |
| 5 #ifndef COMPONENTS_REPORTING_CORE_BROWSER_REPORTING_UPLOADER_H_ |
| 6 #define COMPONENTS_REPORTING_CORE_BROWSER_REPORTING_UPLOADER_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "components/reporting/core/common/reporting_export.h" |
| 10 #include "net/url_request/url_fetcher.h" |
| 11 #include "net/url_request/url_fetcher_delegate.h" |
| 12 #include "net/url_request/url_request_context_getter.h" |
| 13 #include "url/gurl.h" |
| 14 |
| 15 namespace reporting { |
| 16 |
| 17 class REPORTING_EXPORT ReportingUploader { |
| 18 public: |
| 19 enum Outcome { SUCCESS, REMOVE_ENDPOINT, FAILURE }; |
| 20 |
| 21 using Callback = base::Callback<void(Outcome outcome)>; |
| 22 |
| 23 virtual void AttemptDelivery(const GURL& url, |
| 24 const std::string& json, |
| 25 const Callback& callback) = 0; |
| 26 |
| 27 static std::unique_ptr<ReportingUploader> Create( |
| 28 scoped_refptr<net::URLRequestContextGetter> context); |
| 29 }; |
| 30 |
| 31 } // namespace reporting |
| 32 |
| 33 #endif // COMPONENTS_REPORTING_CORE_BROWSER_REPORTING_UPLOADER_H_ |
OLD | NEW |