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

Unified Diff: net/url_request/url_request_status.cc

Issue 1164823002: Remove URLRequestStatus mutators and introduce FromError. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: net/url_request/url_request_status.cc
diff --git a/net/url_request/url_request_status.cc b/net/url_request/url_request_status.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c4643f260b8605827df9661379cbdc2967261926
--- /dev/null
+++ b/net/url_request/url_request_status.cc
@@ -0,0 +1,23 @@
+// Copyright 2015 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.
+
+#include "net/url_request/url_request_status.h"
+
+#include "net/base/net_errors.h"
+
+namespace net {
+
+URLRequestStatus URLRequestStatus::FromError(int error) {
+ if (error == OK) {
+ return URLRequestStatus(SUCCESS, OK);
+ } else if (error == ERR_IO_PENDING) {
+ return URLRequestStatus(IO_PENDING, ERR_IO_PENDING);
+ } else if (error == ERR_ABORTED) {
+ return URLRequestStatus(CANCELED, ERR_ABORTED);
+ } else {
+ return URLRequestStatus(FAILED, error);
+ }
+}
+
+} // namespace net
« net/url_request/url_request_status.h ('K') | « net/url_request/url_request_status.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698