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

Side by Side Diff: components/update_client/update_checker.h

Issue 1685323002: Implement CUP signing in UpdateClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and remove duplicated code comment. Created 4 years, 10 months 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_ 5 #ifndef COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_
6 #define COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_ 6 #define COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "components/update_client/update_response.h" 15 #include "components/update_client/update_response.h"
16 #include "url/gurl.h" 16 #include "url/gurl.h"
17 17
18 class GURL; 18 class GURL;
19 19
20 namespace net {
21 class URLRequestContextGetter;
22 }
23
24 namespace update_client { 20 namespace update_client {
25 21
26 class Configurator; 22 class Configurator;
27 struct CrxUpdateItem; 23 struct CrxUpdateItem;
28 24
29 class UpdateChecker { 25 class UpdateChecker {
30 public: 26 public:
31 using UpdateCheckCallback = 27 using UpdateCheckCallback =
32 base::Callback<void(const GURL& original_url, 28 base::Callback<void(int error, const UpdateResponse::Results& results)>;
33 int error,
34 const std::string& error_message,
35 const UpdateResponse::Results& results)>;
36 29
37 using Factory = 30 using Factory =
38 scoped_ptr<UpdateChecker> (*)(const scoped_refptr<Configurator>& config); 31 scoped_ptr<UpdateChecker> (*)(const scoped_refptr<Configurator>& config);
39 32
40 virtual ~UpdateChecker() {} 33 virtual ~UpdateChecker() {}
41 34
42 // Initiates an update check for the |items_to_check|. |additional_attributes| 35 // Initiates an update check for the |items_to_check|. |additional_attributes|
43 // provides a way to customize the <request> element. This value is inserted 36 // provides a way to customize the <request> element. This value is inserted
44 // as-is, therefore it must be well-formed as an XML attribute string. 37 // as-is, therefore it must be well-formed as an XML attribute string.
45 virtual bool CheckForUpdates( 38 virtual bool CheckForUpdates(
46 const std::vector<CrxUpdateItem*>& items_to_check, 39 const std::vector<CrxUpdateItem*>& items_to_check,
47 const std::string& additional_attributes, 40 const std::string& additional_attributes,
48 const UpdateCheckCallback& update_check_callback) = 0; 41 const UpdateCheckCallback& update_check_callback) = 0;
49 42
50 static scoped_ptr<UpdateChecker> Create( 43 static scoped_ptr<UpdateChecker> Create(
51 const scoped_refptr<Configurator>& config); 44 const scoped_refptr<Configurator>& config);
52 45
53 protected: 46 protected:
54 UpdateChecker() {} 47 UpdateChecker() {}
55 48
56 private: 49 private:
57 DISALLOW_COPY_AND_ASSIGN(UpdateChecker); 50 DISALLOW_COPY_AND_ASSIGN(UpdateChecker);
58 }; 51 };
59 52
60 } // namespace update_client 53 } // namespace update_client
61 54
62 #endif // COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_ 55 #endif // COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_
OLDNEW
« no previous file with comments | « components/update_client/test_configurator.cc ('k') | components/update_client/update_checker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698