Chromium Code Reviews| 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 #include "mojo/services/network/net_adapters.h" | 5 #include "mojo/services/network/net_adapters.h" |
| 6 | 6 |
| 7 #include "net/base/net_errors.h" | 7 #include "net/base/net_errors.h" |
| 8 | 8 |
| 9 namespace mojo { | 9 namespace mojo { |
| 10 | 10 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 pending_buffer_(pending_buffer) { | 102 pending_buffer_(pending_buffer) { |
| 103 } | 103 } |
| 104 | 104 |
| 105 MojoToNetIOBuffer::~MojoToNetIOBuffer() { | 105 MojoToNetIOBuffer::~MojoToNetIOBuffer() { |
| 106 } | 106 } |
| 107 | 107 |
| 108 // ----------------------------------------------------------------------------- | 108 // ----------------------------------------------------------------------------- |
| 109 | 109 |
| 110 NetworkErrorPtr MakeNetworkError(int error_code) { | 110 NetworkErrorPtr MakeNetworkError(int error_code) { |
| 111 NetworkErrorPtr error = NetworkError::New(); | 111 NetworkErrorPtr error = NetworkError::New(); |
| 112 error->code = error_code; | 112 error->code = static_cast<NetworkCode>(error_code); |
|
jamesr
2015/02/18 18:43:06
can you add a set of static_assert<>s that the enu
ppi
2015/02/19 14:22:18
Neat! Done.
| |
| 113 if (error_code <= 0) | 113 if (error_code <= 0) |
| 114 error->description = net::ErrorToString(error_code); | 114 error->description = net::ErrorToString(error_code); |
| 115 return error.Pass(); | 115 return error.Pass(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace mojo | 118 } // namespace mojo |
| OLD | NEW |