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 "extensions/browser/api/cast_channel/logger.h" | 5 #include "extensions/browser/api/cast_channel/logger.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/time/tick_clock.h" | 10 #include "base/time/tick_clock.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 case AuthResult::ERROR_NO_PAYLOAD: | 39 case AuthResult::ERROR_NO_PAYLOAD: |
40 return proto::CHALLENGE_REPLY_ERROR_NO_PAYLOAD; | 40 return proto::CHALLENGE_REPLY_ERROR_NO_PAYLOAD; |
41 case AuthResult::ERROR_PAYLOAD_PARSING_FAILED: | 41 case AuthResult::ERROR_PAYLOAD_PARSING_FAILED: |
42 return proto::CHALLENGE_REPLY_ERROR_PAYLOAD_PARSING_FAILED; | 42 return proto::CHALLENGE_REPLY_ERROR_PAYLOAD_PARSING_FAILED; |
43 case AuthResult::ERROR_MESSAGE_ERROR: | 43 case AuthResult::ERROR_MESSAGE_ERROR: |
44 return proto::CHALLENGE_REPLY_ERROR_MESSAGE_ERROR; | 44 return proto::CHALLENGE_REPLY_ERROR_MESSAGE_ERROR; |
45 case AuthResult::ERROR_NO_RESPONSE: | 45 case AuthResult::ERROR_NO_RESPONSE: |
46 return proto::CHALLENGE_REPLY_ERROR_NO_RESPONSE; | 46 return proto::CHALLENGE_REPLY_ERROR_NO_RESPONSE; |
47 case AuthResult::ERROR_FINGERPRINT_NOT_FOUND: | 47 case AuthResult::ERROR_FINGERPRINT_NOT_FOUND: |
48 return proto::CHALLENGE_REPLY_ERROR_FINGERPRINT_NOT_FOUND; | 48 return proto::CHALLENGE_REPLY_ERROR_FINGERPRINT_NOT_FOUND; |
49 case AuthResult::ERROR_NSS_CERT_PARSING_FAILED: | 49 case AuthResult::ERROR_CERT_PARSING_FAILED: |
50 return proto::CHALLENGE_REPLY_ERROR_NSS_CERT_PARSING_FAILED; | 50 return proto::CHALLENGE_REPLY_ERROR_CERT_PARSING_FAILED; |
51 case AuthResult::ERROR_NSS_CERT_NOT_SIGNED_BY_TRUSTED_CA: | 51 case AuthResult::ERROR_CERT_NOT_SIGNED_BY_TRUSTED_CA: |
52 return proto::CHALLENGE_REPLY_ERROR_NSS_CERT_NOT_SIGNED_BY_TRUSTED_CA; | 52 return proto::CHALLENGE_REPLY_ERROR_CERT_NOT_SIGNED_BY_TRUSTED_CA; |
53 case AuthResult::ERROR_NSS_CANNOT_EXTRACT_PUBLIC_KEY: | 53 case AuthResult::ERROR_CANNOT_EXTRACT_PUBLIC_KEY: |
54 return proto::CHALLENGE_REPLY_ERROR_NSS_CANNOT_EXTRACT_PUBLIC_KEY; | 54 return proto::CHALLENGE_REPLY_ERROR_CANNOT_EXTRACT_PUBLIC_KEY; |
55 case AuthResult::ERROR_NSS_SIGNED_BLOBS_MISMATCH: | 55 case AuthResult::ERROR_SIGNED_BLOBS_MISMATCH: |
56 return proto::CHALLENGE_REPLY_ERROR_NSS_SIGNED_BLOBS_MISMATCH; | 56 return proto::CHALLENGE_REPLY_ERROR_SIGNED_BLOBS_MISMATCH; |
57 default: | 57 default: |
58 NOTREACHED(); | 58 NOTREACHED(); |
59 return proto::CHALLENGE_REPLY_ERROR_NONE; | 59 return proto::CHALLENGE_REPLY_ERROR_NONE; |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 scoped_ptr<char[]> Compress(const std::string& input, size_t* length) { | 63 scoped_ptr<char[]> Compress(const std::string& input, size_t* length) { |
64 *length = 0; | 64 *length = 0; |
65 z_stream stream = {0}; | 65 z_stream stream = {0}; |
66 int result = deflateInit2(&stream, | 66 int result = deflateInit2(&stream, |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 if (it != aggregated_socket_events_.end()) { | 362 if (it != aggregated_socket_events_.end()) { |
363 return it->second->last_errors; | 363 return it->second->last_errors; |
364 } else { | 364 } else { |
365 return LastErrors(); | 365 return LastErrors(); |
366 } | 366 } |
367 } | 367 } |
368 | 368 |
369 } // namespace cast_channel | 369 } // namespace cast_channel |
370 } // namespace core_api | 370 } // namespace core_api |
371 } // namespace extensions | 371 } // namespace extensions |
OLD | NEW |