| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROME_BROWSER_MEDIA_ROUTER_ROUTE_REQUEST_RESULT_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_ROUTE_REQUEST_RESULT_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_ROUTE_REQUEST_RESULT_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_ROUTE_REQUEST_RESULT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // |route|: nullptr | 27 // |route|: nullptr |
| 28 // |presentation_id|: Empty string. | 28 // |presentation_id|: Empty string. |
| 29 // |error|: Non-empty string describing the error. | 29 // |error|: Non-empty string describing the error. |
| 30 // |result_code|: A value from RouteRequestResult describing the error. | 30 // |result_code|: A value from RouteRequestResult describing the error. |
| 31 class RouteRequestResult { | 31 class RouteRequestResult { |
| 32 public: | 32 public: |
| 33 enum ResultCode { | 33 enum ResultCode { |
| 34 UNKNOWN_ERROR, | 34 UNKNOWN_ERROR, |
| 35 OK, | 35 OK, |
| 36 TIMED_OUT, | 36 TIMED_OUT, |
| 37 ROUTE_NOT_FOUND, |
| 37 INVALID_ORIGIN, | 38 INVALID_ORIGIN, |
| 38 OFF_THE_RECORD_MISMATCH | 39 OFF_THE_RECORD_MISMATCH |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 static std::unique_ptr<RouteRequestResult> FromSuccess( | 42 static std::unique_ptr<RouteRequestResult> FromSuccess( |
| 42 std::unique_ptr<MediaRoute> route, | 43 std::unique_ptr<MediaRoute> route, |
| 43 const std::string& presentation_id); | 44 const std::string& presentation_id); |
| 44 static std::unique_ptr<RouteRequestResult> FromError(const std::string& error, | 45 static std::unique_ptr<RouteRequestResult> FromError(const std::string& error, |
| 45 ResultCode result_code); | 46 ResultCode result_code); |
| 46 | 47 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 63 std::string presentation_id_; | 64 std::string presentation_id_; |
| 64 std::string error_; | 65 std::string error_; |
| 65 ResultCode result_code_; | 66 ResultCode result_code_; |
| 66 | 67 |
| 67 DISALLOW_COPY_AND_ASSIGN(RouteRequestResult); | 68 DISALLOW_COPY_AND_ASSIGN(RouteRequestResult); |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 } // namespace media_router | 71 } // namespace media_router |
| 71 | 72 |
| 72 #endif // CHROME_BROWSER_MEDIA_ROUTER_ROUTE_REQUEST_RESULT_H_ | 73 #endif // CHROME_BROWSER_MEDIA_ROUTER_ROUTE_REQUEST_RESULT_H_ |
| OLD | NEW |