OLD | NEW |
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_UTILS_H_ | 5 #ifndef COMPONENTS_UPDATE_CLIENT_UTILS_H_ |
6 #define COMPONENTS_UPDATE_CLIENT_UTILS_H_ | 6 #define COMPONENTS_UPDATE_CLIENT_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
| 9 #include <base/memory/scoped_ptr.h> |
9 | 10 |
10 class GURL; | 11 class GURL; |
11 | 12 |
12 namespace base { | 13 namespace base { |
13 class FilePath; | 14 class FilePath; |
14 } | 15 } |
15 | 16 |
16 namespace net { | 17 namespace net { |
17 class URLFetcher; | 18 class URLFetcher; |
18 class URLFetcherDelegate; | 19 class URLFetcherDelegate; |
(...skipping 29 matching lines...) Expand all Loading... |
48 std::string BuildProtocolRequest(const std::string& browser_version, | 49 std::string BuildProtocolRequest(const std::string& browser_version, |
49 const std::string& channel, | 50 const std::string& channel, |
50 const std::string& lang, | 51 const std::string& lang, |
51 const std::string& os_long_name, | 52 const std::string& os_long_name, |
52 const std::string& request_body, | 53 const std::string& request_body, |
53 const std::string& additional_attributes); | 54 const std::string& additional_attributes); |
54 | 55 |
55 // Sends a protocol request to the the service endpoint specified by |url|. | 56 // Sends a protocol request to the the service endpoint specified by |url|. |
56 // The body of the request is provided by |protocol_request| and it is | 57 // The body of the request is provided by |protocol_request| and it is |
57 // expected to contain XML data. The caller owns the returned object. | 58 // expected to contain XML data. The caller owns the returned object. |
58 net::URLFetcher* SendProtocolRequest( | 59 scoped_ptr<net::URLFetcher> SendProtocolRequest( |
59 const GURL& url, | 60 const GURL& url, |
60 const std::string& protocol_request, | 61 const std::string& protocol_request, |
61 net::URLFetcherDelegate* url_fetcher_delegate, | 62 net::URLFetcherDelegate* url_fetcher_delegate, |
62 net::URLRequestContextGetter* url_request_context_getter); | 63 net::URLRequestContextGetter* url_request_context_getter); |
63 | 64 |
64 // Returns true if the url request of |fetcher| was succesful. | 65 // Returns true if the url request of |fetcher| was succesful. |
65 bool FetchSuccess(const net::URLFetcher& fetcher); | 66 bool FetchSuccess(const net::URLFetcher& fetcher); |
66 | 67 |
67 // Returns the error code which occured during the fetch. The function returns 0 | 68 // Returns the error code which occured during the fetch. The function returns 0 |
68 // if the fetch was successful. If errors happen, the function could return a | 69 // if the fetch was successful. If errors happen, the function could return a |
(...skipping 12 matching lines...) Expand all Loading... |
81 // Returns true if the file and the empty directory are deleted. | 82 // Returns true if the file and the empty directory are deleted. |
82 bool DeleteFileAndEmptyParentDirectory(const base::FilePath& filepath); | 83 bool DeleteFileAndEmptyParentDirectory(const base::FilePath& filepath); |
83 | 84 |
84 // Returns the component id of the |component|. The component id is in a | 85 // Returns the component id of the |component|. The component id is in a |
85 // format similar with the format of an extension id. | 86 // format similar with the format of an extension id. |
86 std::string GetCrxComponentID(const CrxComponent& component); | 87 std::string GetCrxComponentID(const CrxComponent& component); |
87 | 88 |
88 } // namespace update_client | 89 } // namespace update_client |
89 | 90 |
90 #endif // COMPONENTS_UPDATE_CLIENT_UTILS_H_ | 91 #endif // COMPONENTS_UPDATE_CLIENT_UTILS_H_ |
OLD | NEW |