summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profile_resetter/reset_report_uploader.h
blob: 791f0a2fd660f86839f8a46a138be011b7aac9a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// 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 CHROME_BROWSER_PROFILE_RESETTER_RESET_REPORT_UPLOADER_H_
#define CHROME_BROWSER_PROFILE_RESETTER_RESET_REPORT_UPLOADER_H_

#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "components/keyed_service/core/keyed_service.h"
#include "net/url_request/url_fetcher_delegate.h"

namespace content {
class BrowserContext;
}

namespace net {
class URLFetcher;
class URLRequestContextGetter;
}

namespace reset_report {
class ChromeResetReport;
}

// Service whose job is up upload ChromeResetReports.
class ResetReportUploader : public KeyedService,
                            private net::URLFetcherDelegate {
 public:
  explicit ResetReportUploader(content::BrowserContext* context);
  ~ResetReportUploader() override;

  void DispatchReport(const reset_report::ChromeResetReport& report);

 private:
  void OnURLFetchComplete(const net::URLFetcher* source) override;

  scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;

  DISALLOW_COPY_AND_ASSIGN(ResetReportUploader);
};

#endif  // CHROME_BROWSER_PROFILE_RESETTER_RESET_REPORT_UPLOADER_H_