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

Side by Side Diff: chrome/browser/component_updater/component_updater_utils.h

Issue 375973003: Componentize component_updater: Use Configurator to build query parameters. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_ 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_
6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_ 6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 struct CrxComponent; 10 struct CrxComponent;
11 class GURL; 11 class GURL;
12 12
13 namespace base { 13 namespace base {
14 class FilePath; 14 class FilePath;
15 } 15 }
16 16
17 namespace net { 17 namespace net {
18 class URLFetcher; 18 class URLFetcher;
19 class URLFetcherDelegate; 19 class URLFetcherDelegate;
20 class URLRequestContextGetter; 20 class URLRequestContextGetter;
21 } 21 }
22 22
23 namespace component_updater { 23 namespace component_updater {
24 24
25 class Configurator;
25 struct CrxUpdateItem; 26 struct CrxUpdateItem;
26 27
27 // An update protocol request starts with a common preamble which includes 28 // An update protocol request starts with a common preamble which includes
28 // version and platform information for Chrome and the operating system, 29 // version and platform information for Chrome and the operating system,
29 // followed by a request body, which is the actual payload of the request. 30 // followed by a request body, which is the actual payload of the request.
30 // For example: 31 // For example:
31 // 32 //
32 // <?xml version="1.0" encoding="UTF-8"?> 33 // <?xml version="1.0" encoding="UTF-8"?>
33 // <request protocol="3.0" version="chrome-32.0.1.0" prodversion="32.0.1.0" 34 // <request protocol="3.0" version="chrome-32.0.1.0" prodversion="32.0.1.0"
34 // requestid="{7383396D-B4DD-46E1-9104-AAC6B918E792}" 35 // requestid="{7383396D-B4DD-46E1-9104-AAC6B918E792}"
35 // updaterchannel="canary" arch="x86" nacl_arch="x86-64" 36 // updaterchannel="canary" arch="x86" nacl_arch="x86-64"
36 // ADDITIONAL ATTRIBUTES> 37 // ADDITIONAL ATTRIBUTES>
37 // <hw physmemory="16"/> 38 // <hw physmemory="16"/>
38 // <os platform="win" version="6.1" arch="x86"/> 39 // <os platform="win" version="6.1" arch="x86"/>
39 // ... REQUEST BODY ... 40 // ... REQUEST BODY ...
40 // </request> 41 // </request>
41 42
42 // Builds a protocol request string by creating the outer envelope for 43 // Builds a protocol request string by creating the outer envelope for
43 // the request and including the request body specified as a parameter. 44 // the request and including the request body specified as a parameter.
44 // If specified, |additional_attributes| are appended as attributes of the 45 // If specified, |additional_attributes| are appended as attributes of the
45 // request element. The additional attributes have to be well-formed for 46 // request element. The additional attributes have to be well-formed for
46 // insertion in the request element. 47 // insertion in the request element.
47 std::string BuildProtocolRequest(const std::string& request_body, 48 std::string BuildProtocolRequest(const std::string& browser_version,
49 const std::string& channel,
50 const std::string& lang,
51 const std::string& os_long_name,
52 const std::string& request_body,
48 const std::string& additional_attributes); 53 const std::string& additional_attributes);
49 54
50 // Sends a protocol request to the the service endpoint specified by |url|. 55 // Sends a protocol request to the the service endpoint specified by |url|.
51 // The body of the request is provided by |protocol_request| and it is 56 // The body of the request is provided by |protocol_request| and it is
52 // expected to contain XML data. The caller owns the returned object. 57 // expected to contain XML data. The caller owns the returned object.
53 net::URLFetcher* SendProtocolRequest( 58 net::URLFetcher* SendProtocolRequest(
54 const GURL& url, 59 const GURL& url,
55 const std::string& protocol_request, 60 const std::string& protocol_request,
56 net::URLFetcherDelegate* url_fetcher_delegate, 61 net::URLFetcherDelegate* url_fetcher_delegate,
57 net::URLRequestContextGetter* url_request_context_getter); 62 net::URLRequestContextGetter* url_request_context_getter);
(...skipping 18 matching lines...) Expand all
76 // Returns true if the file and the empty directory are deleted. 81 // Returns true if the file and the empty directory are deleted.
77 bool DeleteFileAndEmptyParentDirectory(const base::FilePath& filepath); 82 bool DeleteFileAndEmptyParentDirectory(const base::FilePath& filepath);
78 83
79 // Returns the component id of the |component|. The component id is in a 84 // Returns the component id of the |component|. The component id is in a
80 // format similar with the format of an extension id. 85 // format similar with the format of an extension id.
81 std::string GetCrxComponentID(const CrxComponent& component); 86 std::string GetCrxComponentID(const CrxComponent& component);
82 87
83 } // namespace component_updater 88 } // namespace component_updater
84 89
85 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_ 90 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698