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

Unified Diff: chrome/browser/component_updater/component_updater_utils.h

Issue 105853002: Implement a background downloader using BITS in Windows Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed error codes. Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/component_updater/component_updater_utils.h
diff --git a/chrome/browser/component_updater/component_updater_utils.h b/chrome/browser/component_updater/component_updater_utils.h
index 75e180892f74272d49145c372708f895c09358a5..985cb7e1991f9f1667b21cb01f12b02b65ff138b 100644
--- a/chrome/browser/component_updater/component_updater_utils.h
+++ b/chrome/browser/component_updater/component_updater_utils.h
@@ -1,58 +1,61 @@
-// Copyright 2013 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_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_
-#define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_
-
-#include <string>
-
-class GURL;
-
-namespace net {
-class URLFetcher;
-class URLFetcherDelegate;
-class URLRequestContextGetter;
-}
-
-namespace component_updater {
-
-// An update protocol request starts with a common preamble which includes
-// version and platform information for Chrome and the operating system,
-// followed by a request body, which is the actual payload of the request.
-// For example:
-//
-// <?xml version="1.0" encoding="UTF-8"?>
-// <request protocol="3.0" version="chrome-32.0.1.0" prodversion="32.0.1.0"
-// requestid="{7383396D-B4DD-46E1-9104-AAC6B918E792}"
-// updaterchannel="canary" arch="x86" nacl_arch="x86-64">
-// <os platform="win" version="6.1" arch="x86"/>
-// ... REQUEST BODY ...
-// </request>
-
-// Builds a protocol request string by creating the outer envelope for
-// the request and including the request body specified as a parameter.
-std::string BuildProtocolRequest(const std::string& request_body);
-
-// Sends a protocol request to the the service endpoint specified by |url|.
-// The body of the request is provided by |protocol_request| and it is
-// expected to contain XML data. The caller owns the returned object.
-net::URLFetcher* SendProtocolRequest(
- const GURL& url,
- const std::string& protocol_request,
- net::URLFetcherDelegate* url_fetcher_delegate,
- net::URLRequestContextGetter* url_request_context_getter);
-
-// Returns true if the url request of |fetcher| was succesful.
-bool FetchSuccess(const net::URLFetcher& fetcher);
-
-// Returns the error code which occured during the fetch. The function returns 0
-// if the fetch was successful. If errors happen, the function could return a
-// network error, an http response code, or the status of the fetch, if the
-// fetch is pending or canceled.
-int GetFetchError(const net::URLFetcher& fetcher);
-
-} // namespace component_updater
-
-#endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_
-
+// Copyright 2013 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_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_
+#define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_
+
+#include <string>
+
+class GURL;
+
+namespace net {
+class URLFetcher;
+class URLFetcherDelegate;
+class URLRequestContextGetter;
+}
+
+namespace component_updater {
+
+// An update protocol request starts with a common preamble which includes
+// version and platform information for Chrome and the operating system,
+// followed by a request body, which is the actual payload of the request.
+// For example:
+//
+// <?xml version="1.0" encoding="UTF-8"?>
+// <request protocol="3.0" version="chrome-32.0.1.0" prodversion="32.0.1.0"
+// requestid="{7383396D-B4DD-46E1-9104-AAC6B918E792}"
+// updaterchannel="canary" arch="x86" nacl_arch="x86-64">
+// <os platform="win" version="6.1" arch="x86"/>
+// ... REQUEST BODY ...
+// </request>
+
+// Builds a protocol request string by creating the outer envelope for
+// the request and including the request body specified as a parameter.
+std::string BuildProtocolRequest(const std::string& request_body);
+
+// Sends a protocol request to the the service endpoint specified by |url|.
+// The body of the request is provided by |protocol_request| and it is
+// expected to contain XML data. The caller owns the returned object.
+net::URLFetcher* SendProtocolRequest(
+ const GURL& url,
+ const std::string& protocol_request,
+ net::URLFetcherDelegate* url_fetcher_delegate,
+ net::URLRequestContextGetter* url_request_context_getter);
+
+// Returns true if the url request of |fetcher| was succesful.
+bool FetchSuccess(const net::URLFetcher& fetcher);
+
+// Returns the error code which occured during the fetch. The function returns 0
+// if the fetch was successful. If errors happen, the function could return a
+// network error, an http response code, or the status of the fetch, if the
+// fetch is pending or canceled.
+int GetFetchError(const net::URLFetcher& fetcher);
+
+// Returns true if the |status_code| represents a server error 5xx.
+bool IsHttpServerError(int status_code);
+
+} // namespace component_updater
+
+#endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_
+

Powered by Google App Engine
This is Rietveld 408576698