[safe-browsing] Database full hash matches like prefix match.
[chromium-blink-merge.git] / chrome / browser / feedback / feedback_uploader_delegate.h
blob67d23a7b37455403df88ddf6db7a0e984929c2a8
1 // Copyright 2013 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.
5 #ifndef CHROME_BROWSER_FEEDBACK_FEEDBACK_UPLOADER_DELEGATE_H_
6 #define CHROME_BROWSER_FEEDBACK_FEEDBACK_UPLOADER_DELEGATE_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/callback.h"
12 #include "chrome/browser/feedback/feedback_uploader.h"
13 #include "net/url_request/url_fetcher_delegate.h"
15 namespace feedback {
17 // FeedbackUploaderDelegate is a simple http uploader for a feedback report. On
18 // succes or failure, it deletes itself, but on failure it also notifies the
19 // error callback specified when constructing the class instance.
20 class FeedbackUploaderDelegate : public net::URLFetcherDelegate {
21 public:
22 FeedbackUploaderDelegate(const std::string& post_body,
23 const base::Closure& success_callback,
24 const ReportDataCallback& error_callback);
25 virtual ~FeedbackUploaderDelegate();
27 private:
28 // Overridden from net::URLFetcherDelegate.
29 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
31 std::string post_body_;
32 base::Closure success_callback_;
33 ReportDataCallback error_callback_;
35 DISALLOW_COPY_AND_ASSIGN(FeedbackUploaderDelegate);
38 } // namespace feedback
40 #endif // CHROME_BROWSER_FEEDBACK_FEEDBACK_UPLOADER_DELEGATE_H_