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

Side by Side Diff: net/reporting/reporting_uploader.h

Issue 2249213002: [OBSOLETE] Reporting: Initial implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years 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 unified diff | Download patch
OLDNEW
(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 NET_REPORTING_REPORTING_UPLOADER_H_
6 #define NET_REPORTING_REPORTING_UPLOADER_H_
7
8 #include "base/callback.h"
9 #include "net/base/net_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 net {
16
17 // Uploads reports and converts responses to one of the specified outcomes.
18 class NET_EXPORT ReportingUploader {
19 public:
20 using ContextCallback =
21 base::Callback<scoped_refptr<URLRequestContextGetter>(void)>;
22
23 enum Outcome { SUCCESS, REMOVE_ENDPOINT, FAILURE };
24
25 using Callback = base::Callback<void(Outcome outcome)>;
26
27 virtual ~ReportingUploader();
28
29 virtual void AttemptDelivery(const GURL& url,
30 const std::string& json,
31 const Callback& callback) = 0;
32
33 static std::unique_ptr<ReportingUploader> Create(
34 const URLRequestContext* context);
35 };
36
37 } // namespace net
38
39 #endif // NET_REPORTING_REPORTING_UPLOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698