Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2491)

Unified Diff: ppapi/thunk/ppb_tcp_socket_private_thunk.cc

Issue 9699100: Add functionality to pppapi TCPSocket to support secure sockets in flash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/thunk/ppb_tcp_socket_private_api.h ('k') | webkit/plugins/ppapi/mock_plugin_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/thunk/ppb_tcp_socket_private_thunk.cc
diff --git a/ppapi/thunk/ppb_tcp_socket_private_thunk.cc b/ppapi/thunk/ppb_tcp_socket_private_thunk.cc
index 3997d080d1053c0d81607f31279618303f062a40..bd9703e779f335678e6756ce2bf5ae9450638cb3 100644
--- a/ppapi/thunk/ppb_tcp_socket_private_thunk.cc
+++ b/ppapi/thunk/ppb_tcp_socket_private_thunk.cc
@@ -75,6 +75,22 @@ int32_t SSLHandshake(PP_Resource tcp_socket,
callback));
}
+PP_Resource GetServerCertificate(PP_Resource tcp_socket) {
+ EnterTCP enter(tcp_socket, true);
+ if (enter.failed())
+ return 0;
+ return enter.object()->GetServerCertificate();
+}
+
+PP_Bool AddChainBuildingCertificate(PP_Resource tcp_socket,
+ PP_Resource certificate,
+ PP_Bool trusted) {
+ EnterTCP enter(tcp_socket, true);
+ if (enter.failed())
+ return PP_FALSE;
+ return enter.object()->AddChainBuildingCertificate(certificate, trusted);
+}
+
int32_t Read(PP_Resource tcp_socket,
char* buffer,
int32_t bytes_to_read,
@@ -102,7 +118,20 @@ void Disconnect(PP_Resource tcp_socket) {
enter.object()->Disconnect();
}
-const PPB_TCPSocket_Private g_ppb_tcp_socket_thunk = {
+const PPB_TCPSocket_Private_0_3 g_ppb_tcp_socket_thunk_0_3 = {
+ &Create,
+ &IsTCPSocket,
+ &Connect,
+ &ConnectWithNetAddress,
+ &GetLocalAddress,
+ &GetRemoteAddress,
+ &SSLHandshake,
+ &Read,
+ &Write,
+ &Disconnect
+};
+
+const PPB_TCPSocket_Private g_ppb_tcp_socket_thunk_0_4 = {
&Create,
&IsTCPSocket,
&Connect,
@@ -110,6 +139,8 @@ const PPB_TCPSocket_Private g_ppb_tcp_socket_thunk = {
&GetLocalAddress,
&GetRemoteAddress,
&SSLHandshake,
+ &GetServerCertificate,
+ &AddChainBuildingCertificate,
&Read,
&Write,
&Disconnect
@@ -118,7 +149,11 @@ const PPB_TCPSocket_Private g_ppb_tcp_socket_thunk = {
} // namespace
const PPB_TCPSocket_Private_0_3* GetPPB_TCPSocket_Private_0_3_Thunk() {
- return &g_ppb_tcp_socket_thunk;
+ return &g_ppb_tcp_socket_thunk_0_3;
+}
+
+const PPB_TCPSocket_Private_0_4* GetPPB_TCPSocket_Private_0_4_Thunk() {
+ return &g_ppb_tcp_socket_thunk_0_4;
}
} // namespace thunk
« no previous file with comments | « ppapi/thunk/ppb_tcp_socket_private_api.h ('k') | webkit/plugins/ppapi/mock_plugin_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698