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> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 void Init(Dart_Handle dart_this); | 71 void Init(Dart_Handle dart_this); |
72 void Connect(const char* host, | 72 void Connect(const char* host, |
73 int port, | 73 int port, |
74 bool is_server, | 74 bool is_server, |
75 const char* certificate_name); | 75 const char* certificate_name); |
76 void Destroy(); | 76 void Destroy(); |
77 void Handshake(); | 77 void Handshake(); |
78 void RegisterHandshakeCompleteCallback(Dart_Handle handshake_complete); | 78 void RegisterHandshakeCompleteCallback(Dart_Handle handshake_complete); |
79 static void InitializeLibrary(const char* certificate_database, | 79 static void InitializeLibrary(const char* certificate_database, |
80 const char* password); | 80 const char* password, |
| 81 bool use_builtin_root_certificates); |
81 | 82 |
82 intptr_t ProcessBuffer(int bufferIndex); | 83 intptr_t ProcessBuffer(int bufferIndex); |
83 | 84 |
84 private: | 85 private: |
85 static const int kMemioBufferSize = 20 * KB; | 86 static const int kMemioBufferSize = 20 * KB; |
86 static bool library_initialized_; | 87 static bool library_initialized_; |
87 static const char* password_; | 88 static const char* password_; |
88 static dart::Mutex mutex_; // To protect library initialization. | 89 static dart::Mutex mutex_; // To protect library initialization. |
89 | 90 |
90 uint8_t* buffers_[kNumBuffers]; | 91 uint8_t* buffers_[kNumBuffers]; |
91 int64_t buffer_size_; | 92 int64_t buffer_size_; |
92 Dart_Handle string_start_; | 93 Dart_Handle string_start_; |
93 Dart_Handle string_length_; | 94 Dart_Handle string_length_; |
94 Dart_Handle dart_buffer_objects_[kNumBuffers]; | 95 Dart_Handle dart_buffer_objects_[kNumBuffers]; |
95 Dart_Handle handshake_complete_; | 96 Dart_Handle handshake_complete_; |
96 bool in_handshake_; | 97 bool in_handshake_; |
97 bool is_server_; | 98 bool is_server_; |
98 PRFileDesc* filter_; | 99 PRFileDesc* filter_; |
99 | 100 |
100 void InitializeBuffers(Dart_Handle dart_this); | 101 void InitializeBuffers(Dart_Handle dart_this); |
101 void InitializePlatformData(); | 102 void InitializePlatformData(); |
102 | 103 |
103 DISALLOW_COPY_AND_ASSIGN(SSLFilter); | 104 DISALLOW_COPY_AND_ASSIGN(SSLFilter); |
104 }; | 105 }; |
105 | 106 |
106 #endif // BIN_SECURE_SOCKET_H_ | 107 #endif // BIN_SECURE_SOCKET_H_ |
OLD | NEW |