| 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 12 matching lines...) Expand all Loading... |
| 23 // be unique. | 23 // be unique. |
| 24 // |error|: Empty string. | 24 // |error|: Empty string. |
| 25 // |result_code|: RouteRequestResult::OK | 25 // |result_code|: RouteRequestResult::OK |
| 26 // On failure: | 26 // On failure: |
| 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 // Keep in sync with MediaRouteProviderResult in histograms.xml |
| 33 enum ResultCode { | 34 enum ResultCode { |
| 34 UNKNOWN_ERROR, | 35 UNKNOWN_ERROR = 0, |
| 35 OK, | 36 OK = 1, |
| 36 TIMED_OUT, | 37 TIMED_OUT = 2, |
| 37 ROUTE_NOT_FOUND, | 38 ROUTE_NOT_FOUND = 3, |
| 38 INVALID_ORIGIN, | 39 INVALID_ORIGIN = 4, |
| 39 OFF_THE_RECORD_MISMATCH | 40 OFF_THE_RECORD_MISMATCH = 5, |
| 41 TOTAL_COUNT = 6 |
| 40 }; | 42 }; |
| 41 | 43 |
| 42 static std::unique_ptr<RouteRequestResult> FromSuccess( | 44 static std::unique_ptr<RouteRequestResult> FromSuccess( |
| 43 std::unique_ptr<MediaRoute> route, | 45 std::unique_ptr<MediaRoute> route, |
| 44 const std::string& presentation_id); | 46 const std::string& presentation_id); |
| 45 static std::unique_ptr<RouteRequestResult> FromError(const std::string& error, | 47 static std::unique_ptr<RouteRequestResult> FromError(const std::string& error, |
| 46 ResultCode result_code); | 48 ResultCode result_code); |
| 47 | 49 |
| 48 ~RouteRequestResult(); | 50 ~RouteRequestResult(); |
| 49 | 51 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 64 std::string presentation_id_; | 66 std::string presentation_id_; |
| 65 std::string error_; | 67 std::string error_; |
| 66 ResultCode result_code_; | 68 ResultCode result_code_; |
| 67 | 69 |
| 68 DISALLOW_COPY_AND_ASSIGN(RouteRequestResult); | 70 DISALLOW_COPY_AND_ASSIGN(RouteRequestResult); |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 } // namespace media_router | 73 } // namespace media_router |
| 72 | 74 |
| 73 #endif // CHROME_BROWSER_MEDIA_ROUTER_ROUTE_REQUEST_RESULT_H_ | 75 #endif // CHROME_BROWSER_MEDIA_ROUTER_ROUTE_REQUEST_RESULT_H_ |
| OLD | NEW |