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 |