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

Side by Side Diff: content/browser/renderer_host/pepper/pepper_tcp_socket.h

Issue 12220050: Provide a way to disable Nagle's algorithm on Pepper TCP sockets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing completion callback implementation. Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TCP_SOCKET_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TCP_SOCKET_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TCP_SOCKET_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TCP_SOCKET_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 void Connect(const std::string& host, uint16_t port); 54 void Connect(const std::string& host, uint16_t port);
55 void ConnectWithNetAddress(const PP_NetAddress_Private& net_addr); 55 void ConnectWithNetAddress(const PP_NetAddress_Private& net_addr);
56 void SSLHandshake( 56 void SSLHandshake(
57 const std::string& server_name, 57 const std::string& server_name,
58 uint16_t server_port, 58 uint16_t server_port,
59 const std::vector<std::vector<char> >& trusted_certs, 59 const std::vector<std::vector<char> >& trusted_certs,
60 const std::vector<std::vector<char> >& untrusted_certs); 60 const std::vector<std::vector<char> >& untrusted_certs);
61 void Read(int32 bytes_to_read); 61 void Read(int32 bytes_to_read);
62 void Write(const std::string& data); 62 void Write(const std::string& data);
63 void SetBoolFeature(uint32_t name, bool value);
yzshen1 2013/02/08 21:51:11 I noticed that in pepper_message_filter, |name| is
Wez 2013/02/10 04:47:02 No; I just followed the style of the UDP SetBoolSo
yzshen1 2013/02/12 17:39:58 I didn't see that you have switched to enum. Have
Wez 2013/02/12 18:45:21 Yes; see PepperPluginDelegateImpl. This SetBoolFe
yzshen1 2013/02/13 08:07:14 You could directly use the enum over IPC, and use
63 64
64 void SendConnectACKError(); 65 void SendConnectACKError();
65 66
66 // Extracts the certificate field data from a |net::X509Certificate| into 67 // Extracts the certificate field data from a |net::X509Certificate| into
67 // |PPB_X509Certificate_Fields|. 68 // |PPB_X509Certificate_Fields|.
68 static bool GetCertificateFields(const net::X509Certificate& cert, 69 static bool GetCertificateFields(const net::X509Certificate& cert,
69 ppapi::PPB_X509Certificate_Fields* fields); 70 ppapi::PPB_X509Certificate_Fields* fields);
70 // Extracts the certificate field data from the DER representation of a 71 // Extracts the certificate field data from the DER representation of a
71 // certificate into |PPB_X509Certificate_Fields|. 72 // certificate into |PPB_X509Certificate_Fields|.
72 static bool GetCertificateFields(const char* der, 73 static bool GetCertificateFields(const char* der,
(...skipping 15 matching lines...) Expand all
88 SSL_CONNECTED, 89 SSL_CONNECTED,
89 // An SSL handshake has failed. 90 // An SSL handshake has failed.
90 SSL_HANDSHAKE_FAILED 91 SSL_HANDSHAKE_FAILED
91 }; 92 };
92 93
93 void StartConnect(const net::AddressList& addresses); 94 void StartConnect(const net::AddressList& addresses);
94 95
95 void SendReadACKError(); 96 void SendReadACKError();
96 void SendWriteACKError(); 97 void SendWriteACKError();
97 void SendSSLHandshakeACK(bool succeeded); 98 void SendSSLHandshakeACK(bool succeeded);
99 void SendSetBoolFeatureACK(bool succeeded);
98 100
99 void OnResolveCompleted(int result); 101 void OnResolveCompleted(int result);
100 void OnConnectCompleted(int result); 102 void OnConnectCompleted(int result);
101 void OnSSLHandshakeCompleted(int result); 103 void OnSSLHandshakeCompleted(int result);
102 void OnReadCompleted(int result); 104 void OnReadCompleted(int result);
103 void OnWriteCompleted(int result); 105 void OnWriteCompleted(int result);
104 106
105 bool IsConnected() const; 107 bool IsConnected() const;
108 bool IsSsl() const;
106 109
107 // Actually does a write from |write_buffer_|; possibly called many times for 110 // Actually does a write from |write_buffer_|; possibly called many times for
108 // each |Write()|. 111 // each |Write()|.
109 void DoWrite(); 112 void DoWrite();
110 113
111 PepperMessageFilter* manager_; 114 PepperMessageFilter* manager_;
112 int32 routing_id_; 115 int32 routing_id_;
113 uint32 plugin_dispatcher_id_; 116 uint32 plugin_dispatcher_id_;
114 uint32 socket_id_; 117 uint32 socket_id_;
115 118
(...skipping 13 matching lines...) Expand all
129 // using a |DrainableIOBuffer|, which requires an underlying base |IOBuffer|. 132 // using a |DrainableIOBuffer|, which requires an underlying base |IOBuffer|.
130 scoped_refptr<net::IOBuffer> write_buffer_base_; 133 scoped_refptr<net::IOBuffer> write_buffer_base_;
131 scoped_refptr<net::DrainableIOBuffer> write_buffer_; 134 scoped_refptr<net::DrainableIOBuffer> write_buffer_;
132 135
133 DISALLOW_COPY_AND_ASSIGN(PepperTCPSocket); 136 DISALLOW_COPY_AND_ASSIGN(PepperTCPSocket);
134 }; 137 };
135 138
136 } // namespace content 139 } // namespace content
137 140
138 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TCP_SOCKET_H_ 141 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TCP_SOCKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698