| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BIN_SECURE_SOCKET_H_ | 5 #ifndef BIN_SECURE_SOCKET_H_ |
| 6 #define BIN_SECURE_SOCKET_H_ | 6 #define BIN_SECURE_SOCKET_H_ |
| 7 | 7 |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| 11 #include <sys/types.h> | 11 #include <sys/types.h> |
| 12 | 12 |
| 13 #include <prinit.h> | 13 #include <prinit.h> |
| 14 #include <prerror.h> | 14 #include <prerror.h> |
| 15 #include <prnetdb.h> | 15 #include <prnetdb.h> |
| 16 #include <ssl.h> | 16 #include <ssl.h> |
| 17 | 17 |
| 18 #include "platform/globals.h" | 18 #include "platform/globals.h" |
| 19 #include "platform/thread.h" | 19 #include "platform/thread.h" |
| 20 | 20 |
| 21 #include "bin/builtin.h" | 21 #include "bin/builtin.h" |
| 22 #include "bin/dartutils.h" | 22 #include "bin/dartutils.h" |
| 23 #include "bin/socket.h" |
| 23 #include "bin/utils.h" | 24 #include "bin/utils.h" |
| 24 | 25 |
| 25 namespace dart { | 26 namespace dart { |
| 26 namespace bin { | 27 namespace bin { |
| 27 | 28 |
| 28 static void ThrowException(const char* message) { | 29 static void ThrowException(const char* message) { |
| 29 Dart_Handle socket_exception = | 30 Dart_Handle socket_exception = |
| 30 DartUtils::NewDartSocketException(message, Dart_Null()); | 31 DartUtils::NewDartSocketException(message, Dart_Null()); |
| 31 Dart_ThrowException(socket_exception); | 32 Dart_ThrowException(socket_exception); |
| 32 } | 33 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 : string_start_(NULL), | 67 : string_start_(NULL), |
| 67 string_length_(NULL), | 68 string_length_(NULL), |
| 68 handshake_complete_(NULL), | 69 handshake_complete_(NULL), |
| 69 bad_certificate_callback_(NULL), | 70 bad_certificate_callback_(NULL), |
| 70 in_handshake_(false), | 71 in_handshake_(false), |
| 71 client_certificate_name_(NULL), | 72 client_certificate_name_(NULL), |
| 72 filter_(NULL) { } | 73 filter_(NULL) { } |
| 73 | 74 |
| 74 void Init(Dart_Handle dart_this); | 75 void Init(Dart_Handle dart_this); |
| 75 void Connect(const char* host, | 76 void Connect(const char* host, |
| 77 RawAddr* raw_addr, |
| 76 int port, | 78 int port, |
| 77 bool is_server, | 79 bool is_server, |
| 78 const char* certificate_name, | 80 const char* certificate_name, |
| 79 bool request_client_certificate, | 81 bool request_client_certificate, |
| 80 bool require_client_certificate, | 82 bool require_client_certificate, |
| 81 bool send_client_certificate); | 83 bool send_client_certificate); |
| 82 void Destroy(); | 84 void Destroy(); |
| 83 void Handshake(); | 85 void Handshake(); |
| 84 void RegisterHandshakeCompleteCallback(Dart_Handle handshake_complete); | 86 void RegisterHandshakeCompleteCallback(Dart_Handle handshake_complete); |
| 85 void RegisterBadCertificateCallback(Dart_Handle callback); | 87 void RegisterBadCertificateCallback(Dart_Handle callback); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 void InitializeBuffers(Dart_Handle dart_this); | 120 void InitializeBuffers(Dart_Handle dart_this); |
| 119 void InitializePlatformData(); | 121 void InitializePlatformData(); |
| 120 | 122 |
| 121 DISALLOW_COPY_AND_ASSIGN(SSLFilter); | 123 DISALLOW_COPY_AND_ASSIGN(SSLFilter); |
| 122 }; | 124 }; |
| 123 | 125 |
| 124 } // namespace bin | 126 } // namespace bin |
| 125 } // namespace dart | 127 } // namespace dart |
| 126 | 128 |
| 127 #endif // BIN_SECURE_SOCKET_H_ | 129 #endif // BIN_SECURE_SOCKET_H_ |
| OLD | NEW |