diff options
author | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-22 21:44:19 +0000 |
---|---|---|
committer | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-22 21:44:19 +0000 |
commit | ff98d7f0e27e6ce053a9359adabf2da6ceb942e5 (patch) | |
tree | 0cd6a67b82225d481763919422f0f7d8cbcda5bf /net | |
parent | 31029cc67439f0e23a4a43f450fa21e6818f0c20 (diff) | |
download | chromium_src-ff98d7f0e27e6ce053a9359adabf2da6ceb942e5.zip chromium_src-ff98d7f0e27e6ce053a9359adabf2da6ceb942e5.tar.gz chromium_src-ff98d7f0e27e6ce053a9359adabf2da6ceb942e5.tar.bz2 |
Move all objects from the spdy:: namespace to net::
Review URL: http://codereview.chromium.org/9815028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128310 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
71 files changed, 2932 insertions, 3016 deletions
diff --git a/net/http/http_network_layer.cc b/net/http/http_network_layer.cc index 57dff62..f8da78d 100644 --- a/net/http/http_network_layer.cc +++ b/net/http/http_network_layer.cc @@ -96,7 +96,7 @@ void HttpNetworkLayer::EnableSpdy(const std::string& mode) { } else if (option == kExclude) { HttpStreamFactory::add_forced_spdy_exclusion(value); } else if (option == kDisableCompression) { - spdy::SpdyFramer::set_enable_compression_default(false); + SpdyFramer::set_enable_compression_default(false); } else if (option == kEnableNPN) { HttpStreamFactory::set_use_alternate_protocols(use_alt_protocols); std::vector<std::string> next_protos; diff --git a/net/http/http_network_transaction_spdy21_unittest.cc b/net/http/http_network_transaction_spdy21_unittest.cc index 78ffa15..a777fa5 100644 --- a/net/http/http_network_transaction_spdy21_unittest.cc +++ b/net/http/http_network_transaction_spdy21_unittest.cc @@ -2150,12 +2150,12 @@ TEST_F(HttpNetworkTransactionSpdy21Test, HttpsProxySpdyGet) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); // fetch http://www.google.com/ via SPDY - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST, + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST, false)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp), CreateMockRead(*data), @@ -2209,13 +2209,13 @@ TEST_F(HttpNetworkTransactionSpdy21Test, HttpsProxySpdyGetWithProxyAuth) { // The first request will be a bare GET, the second request will be a // GET with a Proxy-Authorization header. - scoped_ptr<spdy::SpdyFrame> req_get( + scoped_ptr<SpdyFrame> req_get( ConstructSpdyGet(NULL, 0, false, 1, LOWEST, false)); const char* const kExtraAuthorizationHeaders[] = { "proxy-authorization", "Basic Zm9vOmJhcg==", }; - scoped_ptr<spdy::SpdyFrame> req_get_authorization( + scoped_ptr<SpdyFrame> req_get_authorization( ConstructSpdyGet( kExtraAuthorizationHeaders, arraysize(kExtraAuthorizationHeaders)/2, false, 3, LOWEST, false)); @@ -2231,15 +2231,15 @@ TEST_F(HttpNetworkTransactionSpdy21Test, HttpsProxySpdyGetWithProxyAuth) { "proxy-authenticate", "Basic realm=\"MyRealm1\"" }; - scoped_ptr<spdy::SpdyFrame> resp_authentication( + scoped_ptr<SpdyFrame> resp_authentication( ConstructSpdySynReplyError( "407 Proxy Authentication Required", kExtraAuthenticationHeaders, arraysize(kExtraAuthenticationHeaders)/2, 1)); - scoped_ptr<spdy::SpdyFrame> body_authentication( + scoped_ptr<SpdyFrame> body_authentication( ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> resp_data(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body_data(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> resp_data(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body_data(ConstructSpdyBodyFrame(3, true)); MockRead spdy_reads[] = { CreateMockRead(*resp_authentication, 2), CreateMockRead(*body_authentication, 3), @@ -2310,22 +2310,22 @@ TEST_F(HttpNetworkTransactionSpdy21Test, HttpsProxySpdyConnectHttps) { scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); // CONNECT to www.google.com:443 via SPDY - scoped_ptr<spdy::SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); // fetch https://www.google.com/ via HTTP const char get[] = "GET / HTTP/1.1\r\n" "Host: www.google.com\r\n" "Connection: keep-alive\r\n\r\n"; - scoped_ptr<spdy::SpdyFrame> wrapped_get( + scoped_ptr<SpdyFrame> wrapped_get( ConstructSpdyBodyFrame(1, get, strlen(get), false)); - scoped_ptr<spdy::SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); const char resp[] = "HTTP/1.1 200 OK\r\n" "Content-Length: 10\r\n\r\n"; - scoped_ptr<spdy::SpdyFrame> wrapped_get_resp( + scoped_ptr<SpdyFrame> wrapped_get_resp( ConstructSpdyBodyFrame(1, resp, strlen(resp), false)); - scoped_ptr<spdy::SpdyFrame> wrapped_body( + scoped_ptr<SpdyFrame> wrapped_body( ConstructSpdyBodyFrame(1, "1234567890", 10, false)); - scoped_ptr<spdy::SpdyFrame> window_update( + scoped_ptr<SpdyFrame> window_update( ConstructSpdyWindowUpdate(1, wrapped_get_resp->length())); MockWrite spdy_writes[] = { @@ -2391,20 +2391,20 @@ TEST_F(HttpNetworkTransactionSpdy21Test, HttpsProxySpdyConnectSpdy) { scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); // CONNECT to www.google.com:443 via SPDY - scoped_ptr<spdy::SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); // fetch https://www.google.com/ via SPDY const char* const kMyUrl = "https://www.google.com/"; - scoped_ptr<spdy::SpdyFrame> get(ConstructSpdyGet(kMyUrl, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> wrapped_get(ConstructWrappedSpdyFrame(get, 1)); - scoped_ptr<spdy::SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> get_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> wrapped_get_resp( + scoped_ptr<SpdyFrame> get(ConstructSpdyGet(kMyUrl, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> wrapped_get(ConstructWrappedSpdyFrame(get, 1)); + scoped_ptr<SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> get_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> wrapped_get_resp( ConstructWrappedSpdyFrame(get_resp, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> wrapped_body(ConstructWrappedSpdyFrame(body, 1)); - scoped_ptr<spdy::SpdyFrame> window_update_get_resp( + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> wrapped_body(ConstructWrappedSpdyFrame(body, 1)); + scoped_ptr<SpdyFrame> window_update_get_resp( ConstructSpdyWindowUpdate(1, wrapped_get_resp->length())); - scoped_ptr<spdy::SpdyFrame> window_update_body( + scoped_ptr<SpdyFrame> window_update_body( ConstructSpdyWindowUpdate(1, wrapped_body->length())); MockWrite spdy_writes[] = { @@ -2470,16 +2470,16 @@ TEST_F(HttpNetworkTransactionSpdy21Test, HttpsProxySpdyConnectFailure) { scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); // CONNECT to www.google.com:443 via SPDY - scoped_ptr<spdy::SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> get(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> get(ConstructSpdyRstStream(1, CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*connect, 1), CreateMockWrite(*get, 3), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdySynReplyError(1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdySynReplyError(1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp, 2, ASYNC), MockRead(ASYNC, 0, 4), @@ -4573,8 +4573,8 @@ TEST_F(HttpNetworkTransactionSpdy21Test, RedirectOfHttpsConnectViaSpdyProxy) { request.url = GURL("https://www.google.com/"); request.load_flags = 0; - scoped_ptr<spdy::SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> goaway(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> goaway(ConstructSpdyRstStream(1, CANCEL)); MockWrite data_writes[] = { CreateMockWrite(*conn.get(), 0, SYNCHRONOUS), }; @@ -4583,7 +4583,7 @@ TEST_F(HttpNetworkTransactionSpdy21Test, RedirectOfHttpsConnectViaSpdyProxy) { "location", "http://login.example.com/", }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdySynReplyError("302 Redirect", kExtraHeaders, arraysize(kExtraHeaders)/2, 1)); MockRead data_reads[] = { @@ -4689,8 +4689,8 @@ TEST_F(HttpNetworkTransactionSpdy21Test, request.url = GURL("https://www.google.com/"); request.load_flags = 0; - scoped_ptr<spdy::SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> goaway(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> goaway(ConstructSpdyRstStream(1, CANCEL)); MockWrite data_writes[] = { CreateMockWrite(*conn.get(), 0, SYNCHRONOUS), }; @@ -4699,10 +4699,10 @@ TEST_F(HttpNetworkTransactionSpdy21Test, "location", "http://login.example.com/", }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdySynReplyError("404 Not Found", kExtraHeaders, arraysize(kExtraHeaders)/2, 1)); - scoped_ptr<spdy::SpdyFrame> body( + scoped_ptr<SpdyFrame> body( ConstructSpdyBodyFrame(1, "The host does not exist", 23, true)); MockRead data_reads[] = { CreateMockRead(*resp.get(), 1, SYNCHRONOUS), @@ -4760,21 +4760,21 @@ TEST_F(HttpNetworkTransactionSpdy21Test, BasicAuthSpdyProxy) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); // Since we have proxy, should try to establish tunnel. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> rst(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); // After calling trans->RestartWithAuth(), this is the request we should // be issuing -- the final header line contains the credentials. const char* const kAuthCredentials[] = { "proxy-authorization", "Basic Zm9vOmJhcg==", }; - scoped_ptr<spdy::SpdyFrame> connect2( + scoped_ptr<SpdyFrame> connect2( ConstructSpdyConnect(kAuthCredentials, arraysize(kAuthCredentials)/2, 3)); // fetch https://www.google.com/ via HTTP const char get[] = "GET / HTTP/1.1\r\n" "Host: www.google.com\r\n" "Connection: keep-alive\r\n\r\n"; - scoped_ptr<spdy::SpdyFrame> wrapped_get( + scoped_ptr<SpdyFrame> wrapped_get( ConstructSpdyBodyFrame(3, get, strlen(get), false)); MockWrite spdy_writes[] = { @@ -4792,24 +4792,24 @@ TEST_F(HttpNetworkTransactionSpdy21Test, BasicAuthSpdyProxy) { "proxy-authenticate", "Basic realm=\"MyRealm1\"", }; - scoped_ptr<spdy::SpdyFrame> conn_auth_resp( + scoped_ptr<SpdyFrame> conn_auth_resp( ConstructSpdyControlFrame(NULL, 0, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kAuthChallenge, arraysize(kAuthChallenge))); - scoped_ptr<spdy::SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); const char resp[] = "HTTP/1.1 200 OK\r\n" "Content-Length: 5\r\n\r\n"; - scoped_ptr<spdy::SpdyFrame> wrapped_get_resp( + scoped_ptr<SpdyFrame> wrapped_get_resp( ConstructSpdyBodyFrame(3, resp, strlen(resp), false)); - scoped_ptr<spdy::SpdyFrame> wrapped_body( + scoped_ptr<SpdyFrame> wrapped_body( ConstructSpdyBodyFrame(3, "hello", 5, false)); MockRead spdy_reads[] = { CreateMockRead(*conn_auth_resp, 1, ASYNC), @@ -6921,11 +6921,11 @@ TEST_F(HttpNetworkTransactionSpdy21Test, ssl.SetNextProto(SSLClientSocket::kProtoSPDY21); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp), CreateMockRead(*data), @@ -7020,16 +7020,16 @@ TEST_F(HttpNetworkTransactionSpdy21Test, AlternateProtocolWithSpdyLateBinding) { ssl.SetNextProto(SSLClientSocket::kProtoSPDY21); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> req1(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> req1(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req1), CreateMockWrite(*req2), }; - scoped_ptr<spdy::SpdyFrame> resp1(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data1(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> data2(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> resp1(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data1(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> data2(ConstructSpdyBodyFrame(3, true)); MockRead spdy_reads[] = { CreateMockRead(*resp1), CreateMockRead(*data1), @@ -7259,7 +7259,7 @@ TEST_F(HttpNetworkTransactionSpdy21Test, ssl.SetNextProto(SSLClientSocket::kProtoSPDY21); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite spdy_writes[] = { MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" "Host: www.google.com\r\n" @@ -7269,8 +7269,8 @@ TEST_F(HttpNetworkTransactionSpdy21Test, const char kCONNECTResponse[] = "HTTP/1.1 200 Connected\r\n\r\n"; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { MockRead(ASYNC, kCONNECTResponse, arraysize(kCONNECTResponse) - 1, 1), // 1 CreateMockRead(*resp.get(), 4), // 2, 4 @@ -7363,11 +7363,11 @@ TEST_F(HttpNetworkTransactionSpdy21Test, ssl.SetNextProto(SSLClientSocket::kProtoSPDY21); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp), CreateMockRead(*data), @@ -8246,7 +8246,7 @@ TEST_F(HttpNetworkTransactionSpdy21Test, SpdyPostNPNServerHangup) { ssl.SetNextProto(SSLClientSocket::kProtoSPDY21); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; MockRead spdy_reads[] = { @@ -8328,9 +8328,9 @@ TEST_F(HttpNetworkTransactionSpdy21Test, SpdyAlternateProtocolThroughProxy) { // retry-http-when-alternate-protocol fails logic kicks in, which was more // complicated to set up expectations for than the SPDY session. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockWrite data_writes_2[] = { // First connection attempt without Proxy-Authorization. @@ -8635,12 +8635,12 @@ TEST_F(HttpNetworkTransactionSpdy21Test, ProxyTunnelGetHangup) { TEST_F(HttpNetworkTransactionSpdy21Test, PreconnectWithExistingSpdySession) { SessionDependencies session_deps; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> req(ConstructSpdyGet( "https://www.google.com", false, 1, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp), CreateMockRead(*data), @@ -9095,18 +9095,18 @@ TEST_F(HttpNetworkTransactionSpdy21Test, UseIPConnectionPooling) { ssl.SetNextProto(SSLClientSocket::kProtoSPDY21); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> host1_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host1_req(ConstructSpdyGet( "https://www.google.com", false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> host2_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host2_req(ConstructSpdyGet( "https://www.gmail.com", false, 3, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*host1_req, 1), CreateMockWrite(*host2_req, 4), }; - scoped_ptr<spdy::SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(3, true)); MockRead spdy_reads[] = { CreateMockRead(*host1_resp, 2), CreateMockRead(*host1_resp_body, 3), @@ -9246,18 +9246,18 @@ TEST_F(HttpNetworkTransactionSpdy21Test, ssl.SetNextProto(SSLClientSocket::kProtoSPDY21); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> host1_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host1_req(ConstructSpdyGet( "https://www.google.com", false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> host2_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host2_req(ConstructSpdyGet( "https://www.gmail.com", false, 3, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*host1_req, 1), CreateMockWrite(*host2_req, 4), }; - scoped_ptr<spdy::SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(3, true)); MockRead spdy_reads[] = { CreateMockRead(*host1_resp, 2), CreateMockRead(*host1_resp_body, 3), @@ -9408,13 +9408,13 @@ TEST_F(HttpNetworkTransactionSpdy21Test, CloseIdleSpdySessionToOpenNewOne) { session_deps.socket_factory.AddSSLSocketDataProvider(&ssl1); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl2); - scoped_ptr<spdy::SpdyFrame> host1_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host1_req(ConstructSpdyGet( "https://www.a.com", false, 1, LOWEST)); MockWrite spdy1_writes[] = { CreateMockWrite(*host1_req, 1), }; - scoped_ptr<spdy::SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); MockRead spdy1_reads[] = { CreateMockRead(*host1_resp, 2), CreateMockRead(*host1_resp_body, 3), @@ -9427,13 +9427,13 @@ TEST_F(HttpNetworkTransactionSpdy21Test, CloseIdleSpdySessionToOpenNewOne) { spdy1_writes, arraysize(spdy1_writes))); session_deps.socket_factory.AddSocketDataProvider(spdy1_data.get()); - scoped_ptr<spdy::SpdyFrame> host2_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host2_req(ConstructSpdyGet( "https://www.b.com", false, 1, LOWEST)); MockWrite spdy2_writes[] = { CreateMockWrite(*host2_req, 1), }; - scoped_ptr<spdy::SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(1, true)); MockRead spdy2_reads[] = { CreateMockRead(*host2_resp, 2), CreateMockRead(*host2_resp_body, 3), diff --git a/net/http/http_network_transaction_spdy2_unittest.cc b/net/http/http_network_transaction_spdy2_unittest.cc index 934a96a..faa75d6 100644 --- a/net/http/http_network_transaction_spdy2_unittest.cc +++ b/net/http/http_network_transaction_spdy2_unittest.cc @@ -2150,12 +2150,12 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyGet) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); // fetch http://www.google.com/ via SPDY - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST, + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST, false)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp), CreateMockRead(*data), @@ -2209,13 +2209,13 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyGetWithProxyAuth) { // The first request will be a bare GET, the second request will be a // GET with a Proxy-Authorization header. - scoped_ptr<spdy::SpdyFrame> req_get( + scoped_ptr<SpdyFrame> req_get( ConstructSpdyGet(NULL, 0, false, 1, LOWEST, false)); const char* const kExtraAuthorizationHeaders[] = { "proxy-authorization", "Basic Zm9vOmJhcg==", }; - scoped_ptr<spdy::SpdyFrame> req_get_authorization( + scoped_ptr<SpdyFrame> req_get_authorization( ConstructSpdyGet( kExtraAuthorizationHeaders, arraysize(kExtraAuthorizationHeaders)/2, false, 3, LOWEST, false)); @@ -2231,15 +2231,15 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyGetWithProxyAuth) { "proxy-authenticate", "Basic realm=\"MyRealm1\"" }; - scoped_ptr<spdy::SpdyFrame> resp_authentication( + scoped_ptr<SpdyFrame> resp_authentication( ConstructSpdySynReplyError( "407 Proxy Authentication Required", kExtraAuthenticationHeaders, arraysize(kExtraAuthenticationHeaders)/2, 1)); - scoped_ptr<spdy::SpdyFrame> body_authentication( + scoped_ptr<SpdyFrame> body_authentication( ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> resp_data(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body_data(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> resp_data(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body_data(ConstructSpdyBodyFrame(3, true)); MockRead spdy_reads[] = { CreateMockRead(*resp_authentication, 2), CreateMockRead(*body_authentication, 3), @@ -2310,22 +2310,22 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyConnectHttps) { scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); // CONNECT to www.google.com:443 via SPDY - scoped_ptr<spdy::SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); // fetch https://www.google.com/ via HTTP const char get[] = "GET / HTTP/1.1\r\n" "Host: www.google.com\r\n" "Connection: keep-alive\r\n\r\n"; - scoped_ptr<spdy::SpdyFrame> wrapped_get( + scoped_ptr<SpdyFrame> wrapped_get( ConstructSpdyBodyFrame(1, get, strlen(get), false)); - scoped_ptr<spdy::SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); const char resp[] = "HTTP/1.1 200 OK\r\n" "Content-Length: 10\r\n\r\n"; - scoped_ptr<spdy::SpdyFrame> wrapped_get_resp( + scoped_ptr<SpdyFrame> wrapped_get_resp( ConstructSpdyBodyFrame(1, resp, strlen(resp), false)); - scoped_ptr<spdy::SpdyFrame> wrapped_body( + scoped_ptr<SpdyFrame> wrapped_body( ConstructSpdyBodyFrame(1, "1234567890", 10, false)); - scoped_ptr<spdy::SpdyFrame> window_update( + scoped_ptr<SpdyFrame> window_update( ConstructSpdyWindowUpdate(1, wrapped_get_resp->length())); MockWrite spdy_writes[] = { @@ -2391,20 +2391,20 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyConnectSpdy) { scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); // CONNECT to www.google.com:443 via SPDY - scoped_ptr<spdy::SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); // fetch https://www.google.com/ via SPDY const char* const kMyUrl = "https://www.google.com/"; - scoped_ptr<spdy::SpdyFrame> get(ConstructSpdyGet(kMyUrl, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> wrapped_get(ConstructWrappedSpdyFrame(get, 1)); - scoped_ptr<spdy::SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> get_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> wrapped_get_resp( + scoped_ptr<SpdyFrame> get(ConstructSpdyGet(kMyUrl, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> wrapped_get(ConstructWrappedSpdyFrame(get, 1)); + scoped_ptr<SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> get_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> wrapped_get_resp( ConstructWrappedSpdyFrame(get_resp, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> wrapped_body(ConstructWrappedSpdyFrame(body, 1)); - scoped_ptr<spdy::SpdyFrame> window_update_get_resp( + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> wrapped_body(ConstructWrappedSpdyFrame(body, 1)); + scoped_ptr<SpdyFrame> window_update_get_resp( ConstructSpdyWindowUpdate(1, wrapped_get_resp->length())); - scoped_ptr<spdy::SpdyFrame> window_update_body( + scoped_ptr<SpdyFrame> window_update_body( ConstructSpdyWindowUpdate(1, wrapped_body->length())); MockWrite spdy_writes[] = { @@ -2470,16 +2470,16 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyConnectFailure) { scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); // CONNECT to www.google.com:443 via SPDY - scoped_ptr<spdy::SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> get(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> get(ConstructSpdyRstStream(1, CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*connect, 1), CreateMockWrite(*get, 3), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdySynReplyError(1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdySynReplyError(1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp, 2, ASYNC), MockRead(ASYNC, 0, 4), @@ -4573,8 +4573,8 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RedirectOfHttpsConnectViaSpdyProxy) { request.url = GURL("https://www.google.com/"); request.load_flags = 0; - scoped_ptr<spdy::SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> goaway(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> goaway(ConstructSpdyRstStream(1, CANCEL)); MockWrite data_writes[] = { CreateMockWrite(*conn.get(), 0, SYNCHRONOUS), }; @@ -4583,7 +4583,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RedirectOfHttpsConnectViaSpdyProxy) { "location", "http://login.example.com/", }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdySynReplyError("302 Redirect", kExtraHeaders, arraysize(kExtraHeaders)/2, 1)); MockRead data_reads[] = { @@ -4689,8 +4689,8 @@ TEST_F(HttpNetworkTransactionSpdy2Test, request.url = GURL("https://www.google.com/"); request.load_flags = 0; - scoped_ptr<spdy::SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> goaway(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> goaway(ConstructSpdyRstStream(1, CANCEL)); MockWrite data_writes[] = { CreateMockWrite(*conn.get(), 0, SYNCHRONOUS), }; @@ -4699,10 +4699,10 @@ TEST_F(HttpNetworkTransactionSpdy2Test, "location", "http://login.example.com/", }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdySynReplyError("404 Not Found", kExtraHeaders, arraysize(kExtraHeaders)/2, 1)); - scoped_ptr<spdy::SpdyFrame> body( + scoped_ptr<SpdyFrame> body( ConstructSpdyBodyFrame(1, "The host does not exist", 23, true)); MockRead data_reads[] = { CreateMockRead(*resp.get(), 1, SYNCHRONOUS), @@ -4760,21 +4760,21 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthSpdyProxy) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); // Since we have proxy, should try to establish tunnel. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> rst(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); // After calling trans->RestartWithAuth(), this is the request we should // be issuing -- the final header line contains the credentials. const char* const kAuthCredentials[] = { "proxy-authorization", "Basic Zm9vOmJhcg==", }; - scoped_ptr<spdy::SpdyFrame> connect2( + scoped_ptr<SpdyFrame> connect2( ConstructSpdyConnect(kAuthCredentials, arraysize(kAuthCredentials)/2, 3)); // fetch https://www.google.com/ via HTTP const char get[] = "GET / HTTP/1.1\r\n" "Host: www.google.com\r\n" "Connection: keep-alive\r\n\r\n"; - scoped_ptr<spdy::SpdyFrame> wrapped_get( + scoped_ptr<SpdyFrame> wrapped_get( ConstructSpdyBodyFrame(3, get, strlen(get), false)); MockWrite spdy_writes[] = { @@ -4792,24 +4792,24 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthSpdyProxy) { "proxy-authenticate", "Basic realm=\"MyRealm1\"", }; - scoped_ptr<spdy::SpdyFrame> conn_auth_resp( + scoped_ptr<SpdyFrame> conn_auth_resp( ConstructSpdyControlFrame(NULL, 0, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kAuthChallenge, arraysize(kAuthChallenge))); - scoped_ptr<spdy::SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); const char resp[] = "HTTP/1.1 200 OK\r\n" "Content-Length: 5\r\n\r\n"; - scoped_ptr<spdy::SpdyFrame> wrapped_get_resp( + scoped_ptr<SpdyFrame> wrapped_get_resp( ConstructSpdyBodyFrame(3, resp, strlen(resp), false)); - scoped_ptr<spdy::SpdyFrame> wrapped_body( + scoped_ptr<SpdyFrame> wrapped_body( ConstructSpdyBodyFrame(3, "hello", 5, false)); MockRead spdy_reads[] = { CreateMockRead(*conn_auth_resp, 1, ASYNC), @@ -6920,11 +6920,11 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UseAlternateProtocolForNpnSpdy) { ssl.SetNextProto(SSLClientSocket::kProtoSPDY2); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp), CreateMockRead(*data), @@ -7019,16 +7019,16 @@ TEST_F(HttpNetworkTransactionSpdy2Test, AlternateProtocolWithSpdyLateBinding) { ssl.SetNextProto(SSLClientSocket::kProtoSPDY2); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> req1(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> req1(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req1), CreateMockWrite(*req2), }; - scoped_ptr<spdy::SpdyFrame> resp1(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data1(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> data2(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> resp1(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data1(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> data2(ConstructSpdyBodyFrame(3, true)); MockRead spdy_reads[] = { CreateMockRead(*resp1), CreateMockRead(*data1), @@ -7258,7 +7258,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ssl.SetNextProto(SSLClientSocket::kProtoSPDY2); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite spdy_writes[] = { MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" "Host: www.google.com\r\n" @@ -7268,8 +7268,8 @@ TEST_F(HttpNetworkTransactionSpdy2Test, const char kCONNECTResponse[] = "HTTP/1.1 200 Connected\r\n\r\n"; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { MockRead(ASYNC, kCONNECTResponse, arraysize(kCONNECTResponse) - 1, 1), // 1 CreateMockRead(*resp.get(), 4), // 2, 4 @@ -7362,11 +7362,11 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ssl.SetNextProto(SSLClientSocket::kProtoSPDY2); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp), CreateMockRead(*data), @@ -8245,7 +8245,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, SpdyPostNPNServerHangup) { ssl.SetNextProto(SSLClientSocket::kProtoSPDY2); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; MockRead spdy_reads[] = { @@ -8327,9 +8327,9 @@ TEST_F(HttpNetworkTransactionSpdy2Test, SpdyAlternateProtocolThroughProxy) { // retry-http-when-alternate-protocol fails logic kicks in, which was more // complicated to set up expectations for than the SPDY session. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockWrite data_writes_2[] = { // First connection attempt without Proxy-Authorization. @@ -8634,12 +8634,12 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ProxyTunnelGetHangup) { TEST_F(HttpNetworkTransactionSpdy2Test, PreconnectWithExistingSpdySession) { SessionDependencies session_deps; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> req(ConstructSpdyGet( "https://www.google.com", false, 1, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp), CreateMockRead(*data), @@ -9094,18 +9094,18 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UseIPConnectionPooling) { ssl.SetNextProto(SSLClientSocket::kProtoSPDY2); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> host1_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host1_req(ConstructSpdyGet( "https://www.google.com", false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> host2_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host2_req(ConstructSpdyGet( "https://www.gmail.com", false, 3, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*host1_req, 1), CreateMockWrite(*host2_req, 4), }; - scoped_ptr<spdy::SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(3, true)); MockRead spdy_reads[] = { CreateMockRead(*host1_resp, 2), CreateMockRead(*host1_resp_body, 3), @@ -9245,18 +9245,18 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ssl.SetNextProto(SSLClientSocket::kProtoSPDY2); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> host1_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host1_req(ConstructSpdyGet( "https://www.google.com", false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> host2_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host2_req(ConstructSpdyGet( "https://www.gmail.com", false, 3, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*host1_req, 1), CreateMockWrite(*host2_req, 4), }; - scoped_ptr<spdy::SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(3, true)); MockRead spdy_reads[] = { CreateMockRead(*host1_resp, 2), CreateMockRead(*host1_resp_body, 3), @@ -9407,13 +9407,13 @@ TEST_F(HttpNetworkTransactionSpdy2Test, CloseIdleSpdySessionToOpenNewOne) { session_deps.socket_factory.AddSSLSocketDataProvider(&ssl1); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl2); - scoped_ptr<spdy::SpdyFrame> host1_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host1_req(ConstructSpdyGet( "https://www.a.com", false, 1, LOWEST)); MockWrite spdy1_writes[] = { CreateMockWrite(*host1_req, 1), }; - scoped_ptr<spdy::SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); MockRead spdy1_reads[] = { CreateMockRead(*host1_resp, 2), CreateMockRead(*host1_resp_body, 3), @@ -9426,13 +9426,13 @@ TEST_F(HttpNetworkTransactionSpdy2Test, CloseIdleSpdySessionToOpenNewOne) { spdy1_writes, arraysize(spdy1_writes))); session_deps.socket_factory.AddSocketDataProvider(spdy1_data.get()); - scoped_ptr<spdy::SpdyFrame> host2_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host2_req(ConstructSpdyGet( "https://www.b.com", false, 1, LOWEST)); MockWrite spdy2_writes[] = { CreateMockWrite(*host2_req, 1), }; - scoped_ptr<spdy::SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(1, true)); MockRead spdy2_reads[] = { CreateMockRead(*host2_resp, 2), CreateMockRead(*host2_resp_body, 3), diff --git a/net/http/http_network_transaction_spdy3_unittest.cc b/net/http/http_network_transaction_spdy3_unittest.cc index 8612f4c..991c2a8 100644 --- a/net/http/http_network_transaction_spdy3_unittest.cc +++ b/net/http/http_network_transaction_spdy3_unittest.cc @@ -2151,12 +2151,12 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyGet) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); // fetch http://www.google.com/ via SPDY - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST, + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST, false)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp), CreateMockRead(*data), @@ -2210,13 +2210,13 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyGetWithProxyAuth) { // The first request will be a bare GET, the second request will be a // GET with a Proxy-Authorization header. - scoped_ptr<spdy::SpdyFrame> req_get( + scoped_ptr<SpdyFrame> req_get( ConstructSpdyGet(NULL, 0, false, 1, LOWEST, false)); const char* const kExtraAuthorizationHeaders[] = { "proxy-authorization", "Basic Zm9vOmJhcg==", }; - scoped_ptr<spdy::SpdyFrame> req_get_authorization( + scoped_ptr<SpdyFrame> req_get_authorization( ConstructSpdyGet( kExtraAuthorizationHeaders, arraysize(kExtraAuthorizationHeaders)/2, false, 3, LOWEST, false)); @@ -2232,15 +2232,15 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyGetWithProxyAuth) { "proxy-authenticate", "Basic realm=\"MyRealm1\"" }; - scoped_ptr<spdy::SpdyFrame> resp_authentication( + scoped_ptr<SpdyFrame> resp_authentication( ConstructSpdySynReplyError( "407 Proxy Authentication Required", kExtraAuthenticationHeaders, arraysize(kExtraAuthenticationHeaders)/2, 1)); - scoped_ptr<spdy::SpdyFrame> body_authentication( + scoped_ptr<SpdyFrame> body_authentication( ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> resp_data(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body_data(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> resp_data(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body_data(ConstructSpdyBodyFrame(3, true)); MockRead spdy_reads[] = { CreateMockRead(*resp_authentication, 2), CreateMockRead(*body_authentication, 3), @@ -2311,22 +2311,22 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyConnectHttps) { scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); // CONNECT to www.google.com:443 via SPDY - scoped_ptr<spdy::SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); // fetch https://www.google.com/ via HTTP const char get[] = "GET / HTTP/1.1\r\n" "Host: www.google.com\r\n" "Connection: keep-alive\r\n\r\n"; - scoped_ptr<spdy::SpdyFrame> wrapped_get( + scoped_ptr<SpdyFrame> wrapped_get( ConstructSpdyBodyFrame(1, get, strlen(get), false)); - scoped_ptr<spdy::SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); const char resp[] = "HTTP/1.1 200 OK\r\n" "Content-Length: 10\r\n\r\n"; - scoped_ptr<spdy::SpdyFrame> wrapped_get_resp( + scoped_ptr<SpdyFrame> wrapped_get_resp( ConstructSpdyBodyFrame(1, resp, strlen(resp), false)); - scoped_ptr<spdy::SpdyFrame> wrapped_body( + scoped_ptr<SpdyFrame> wrapped_body( ConstructSpdyBodyFrame(1, "1234567890", 10, false)); - scoped_ptr<spdy::SpdyFrame> window_update( + scoped_ptr<SpdyFrame> window_update( ConstructSpdyWindowUpdate(1, wrapped_get_resp->length())); MockWrite spdy_writes[] = { @@ -2392,20 +2392,20 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyConnectSpdy) { scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); // CONNECT to www.google.com:443 via SPDY - scoped_ptr<spdy::SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); // fetch https://www.google.com/ via SPDY const char* const kMyUrl = "https://www.google.com/"; - scoped_ptr<spdy::SpdyFrame> get(ConstructSpdyGet(kMyUrl, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> wrapped_get(ConstructWrappedSpdyFrame(get, 1)); - scoped_ptr<spdy::SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> get_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> wrapped_get_resp( + scoped_ptr<SpdyFrame> get(ConstructSpdyGet(kMyUrl, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> wrapped_get(ConstructWrappedSpdyFrame(get, 1)); + scoped_ptr<SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> get_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> wrapped_get_resp( ConstructWrappedSpdyFrame(get_resp, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> wrapped_body(ConstructWrappedSpdyFrame(body, 1)); - scoped_ptr<spdy::SpdyFrame> window_update_get_resp( + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> wrapped_body(ConstructWrappedSpdyFrame(body, 1)); + scoped_ptr<SpdyFrame> window_update_get_resp( ConstructSpdyWindowUpdate(1, wrapped_get_resp->length())); - scoped_ptr<spdy::SpdyFrame> window_update_body( + scoped_ptr<SpdyFrame> window_update_body( ConstructSpdyWindowUpdate(1, wrapped_body->length())); MockWrite spdy_writes[] = { @@ -2471,16 +2471,16 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyConnectFailure) { scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction(session)); // CONNECT to www.google.com:443 via SPDY - scoped_ptr<spdy::SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> get(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> get(ConstructSpdyRstStream(1, CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*connect, 1), CreateMockWrite(*get, 3), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdySynReplyError(1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdySynReplyError(1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp, 2, ASYNC), MockRead(ASYNC, 0, 4), @@ -4574,8 +4574,8 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RedirectOfHttpsConnectViaSpdyProxy) { request.url = GURL("https://www.google.com/"); request.load_flags = 0; - scoped_ptr<spdy::SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> goaway(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> goaway(ConstructSpdyRstStream(1, CANCEL)); MockWrite data_writes[] = { CreateMockWrite(*conn.get(), 0, SYNCHRONOUS), }; @@ -4584,7 +4584,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RedirectOfHttpsConnectViaSpdyProxy) { "location", "http://login.example.com/", }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdySynReplyError("302 Redirect", kExtraHeaders, arraysize(kExtraHeaders)/2, 1)); MockRead data_reads[] = { @@ -4690,8 +4690,8 @@ TEST_F(HttpNetworkTransactionSpdy3Test, request.url = GURL("https://www.google.com/"); request.load_flags = 0; - scoped_ptr<spdy::SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> goaway(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> goaway(ConstructSpdyRstStream(1, CANCEL)); MockWrite data_writes[] = { CreateMockWrite(*conn.get(), 0, SYNCHRONOUS), }; @@ -4700,10 +4700,10 @@ TEST_F(HttpNetworkTransactionSpdy3Test, "location", "http://login.example.com/", }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdySynReplyError("404 Not Found", kExtraHeaders, arraysize(kExtraHeaders)/2, 1)); - scoped_ptr<spdy::SpdyFrame> body( + scoped_ptr<SpdyFrame> body( ConstructSpdyBodyFrame(1, "The host does not exist", 23, true)); MockRead data_reads[] = { CreateMockRead(*resp.get(), 1, SYNCHRONOUS), @@ -4761,21 +4761,21 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthSpdyProxy) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps)); // Since we have proxy, should try to establish tunnel. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> rst(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); // After calling trans->RestartWithAuth(), this is the request we should // be issuing -- the final header line contains the credentials. const char* const kAuthCredentials[] = { "proxy-authorization", "Basic Zm9vOmJhcg==", }; - scoped_ptr<spdy::SpdyFrame> connect2( + scoped_ptr<SpdyFrame> connect2( ConstructSpdyConnect(kAuthCredentials, arraysize(kAuthCredentials)/2, 3)); // fetch https://www.google.com/ via HTTP const char get[] = "GET / HTTP/1.1\r\n" "Host: www.google.com\r\n" "Connection: keep-alive\r\n\r\n"; - scoped_ptr<spdy::SpdyFrame> wrapped_get( + scoped_ptr<SpdyFrame> wrapped_get( ConstructSpdyBodyFrame(3, get, strlen(get), false)); MockWrite spdy_writes[] = { @@ -4793,24 +4793,24 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthSpdyProxy) { "proxy-authenticate", "Basic realm=\"MyRealm1\"", }; - scoped_ptr<spdy::SpdyFrame> conn_auth_resp( + scoped_ptr<SpdyFrame> conn_auth_resp( ConstructSpdyControlFrame(NULL, 0, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kAuthChallenge, arraysize(kAuthChallenge))); - scoped_ptr<spdy::SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> conn_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); const char resp[] = "HTTP/1.1 200 OK\r\n" "Content-Length: 5\r\n\r\n"; - scoped_ptr<spdy::SpdyFrame> wrapped_get_resp( + scoped_ptr<SpdyFrame> wrapped_get_resp( ConstructSpdyBodyFrame(3, resp, strlen(resp), false)); - scoped_ptr<spdy::SpdyFrame> wrapped_body( + scoped_ptr<SpdyFrame> wrapped_body( ConstructSpdyBodyFrame(3, "hello", 5, false)); MockRead spdy_reads[] = { CreateMockRead(*conn_auth_resp, 1, ASYNC), @@ -6920,11 +6920,11 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseAlternateProtocolForNpnSpdy) { ssl.SetNextProto(SSLClientSocket::kProtoSPDY3); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp), CreateMockRead(*data), @@ -7019,16 +7019,16 @@ TEST_F(HttpNetworkTransactionSpdy3Test, AlternateProtocolWithSpdyLateBinding) { ssl.SetNextProto(SSLClientSocket::kProtoSPDY3); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> req1(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> req1(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req1), CreateMockWrite(*req2), }; - scoped_ptr<spdy::SpdyFrame> resp1(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data1(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> data2(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> resp1(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data1(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> data2(ConstructSpdyBodyFrame(3, true)); MockRead spdy_reads[] = { CreateMockRead(*resp1), CreateMockRead(*data1), @@ -7258,7 +7258,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ssl.SetNextProto(SSLClientSocket::kProtoSPDY3); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite spdy_writes[] = { MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" "Host: www.google.com\r\n" @@ -7268,8 +7268,8 @@ TEST_F(HttpNetworkTransactionSpdy3Test, const char kCONNECTResponse[] = "HTTP/1.1 200 Connected\r\n\r\n"; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { MockRead(ASYNC, kCONNECTResponse, arraysize(kCONNECTResponse) - 1, 1), // 1 CreateMockRead(*resp.get(), 4), // 2, 4 @@ -7362,11 +7362,11 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ssl.SetNextProto(SSLClientSocket::kProtoSPDY3); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp), CreateMockRead(*data), @@ -8245,7 +8245,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, SpdyPostNPNServerHangup) { ssl.SetNextProto(SSLClientSocket::kProtoSPDY3); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; MockRead spdy_reads[] = { @@ -8327,9 +8327,9 @@ TEST_F(HttpNetworkTransactionSpdy3Test, SpdyAlternateProtocolThroughProxy) { // retry-http-when-alternate-protocol fails logic kicks in, which was more // complicated to set up expectations for than the SPDY session. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockWrite data_writes_2[] = { // First connection attempt without Proxy-Authorization. @@ -8634,12 +8634,12 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ProxyTunnelGetHangup) { TEST_F(HttpNetworkTransactionSpdy3Test, PreconnectWithExistingSpdySession) { SessionDependencies session_deps; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> req(ConstructSpdyGet( "https://www.google.com", false, 1, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> data(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp), CreateMockRead(*data), @@ -9093,18 +9093,18 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseIPConnectionPooling) { ssl.SetNextProto(SSLClientSocket::kProtoSPDY3); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> host1_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host1_req(ConstructSpdyGet( "https://www.google.com", false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> host2_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host2_req(ConstructSpdyGet( "https://www.gmail.com", false, 3, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*host1_req, 1), CreateMockWrite(*host2_req, 4), }; - scoped_ptr<spdy::SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(3, true)); MockRead spdy_reads[] = { CreateMockRead(*host1_resp, 2), CreateMockRead(*host1_resp_body, 3), @@ -9244,18 +9244,18 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ssl.SetNextProto(SSLClientSocket::kProtoSPDY3); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl); - scoped_ptr<spdy::SpdyFrame> host1_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host1_req(ConstructSpdyGet( "https://www.google.com", false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> host2_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host2_req(ConstructSpdyGet( "https://www.gmail.com", false, 3, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*host1_req, 1), CreateMockWrite(*host2_req, 4), }; - scoped_ptr<spdy::SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(3, true)); MockRead spdy_reads[] = { CreateMockRead(*host1_resp, 2), CreateMockRead(*host1_resp_body, 3), @@ -9406,13 +9406,13 @@ TEST_F(HttpNetworkTransactionSpdy3Test, CloseIdleSpdySessionToOpenNewOne) { session_deps.socket_factory.AddSSLSocketDataProvider(&ssl1); session_deps.socket_factory.AddSSLSocketDataProvider(&ssl2); - scoped_ptr<spdy::SpdyFrame> host1_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host1_req(ConstructSpdyGet( "https://www.a.com", false, 1, LOWEST)); MockWrite spdy1_writes[] = { CreateMockWrite(*host1_req, 1), }; - scoped_ptr<spdy::SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> host1_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> host1_resp_body(ConstructSpdyBodyFrame(1, true)); MockRead spdy1_reads[] = { CreateMockRead(*host1_resp, 2), CreateMockRead(*host1_resp_body, 3), @@ -9425,13 +9425,13 @@ TEST_F(HttpNetworkTransactionSpdy3Test, CloseIdleSpdySessionToOpenNewOne) { spdy1_writes, arraysize(spdy1_writes))); session_deps.socket_factory.AddSocketDataProvider(spdy1_data.get()); - scoped_ptr<spdy::SpdyFrame> host2_req(ConstructSpdyGet( + scoped_ptr<SpdyFrame> host2_req(ConstructSpdyGet( "https://www.b.com", false, 1, LOWEST)); MockWrite spdy2_writes[] = { CreateMockWrite(*host2_req, 1), }; - scoped_ptr<spdy::SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> host2_resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> host2_resp_body(ConstructSpdyBodyFrame(1, true)); MockRead spdy2_reads[] = { CreateMockRead(*host2_resp, 2), CreateMockRead(*host2_resp_body, 3), diff --git a/net/http/http_proxy_client_socket_pool_spdy21_unittest.cc b/net/http/http_proxy_client_socket_pool_spdy21_unittest.cc index 3ff5e14..59bee4f 100644 --- a/net/http/http_proxy_client_socket_pool_spdy21_unittest.cc +++ b/net/http/http_proxy_client_socket_pool_spdy21_unittest.cc @@ -252,8 +252,8 @@ TEST_P(HttpProxyClientSocketPoolSpdy21Test, NeedAuth) { MockRead(ASYNC, 3, "Content-Length: 10\r\n\r\n"), MockRead(ASYNC, 4, "0123456789"), }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> rst(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), CreateMockWrite(*rst, 2, ASYNC), @@ -263,15 +263,15 @@ TEST_P(HttpProxyClientSocketPoolSpdy21Test, NeedAuth) { "version", "HTTP/1.1", "proxy-authenticate", "Basic realm=\"MyRealm1\"", }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdyControlFrame(NULL, 0, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kAuthChallenge, arraysize(kAuthChallenge))); MockRead spdy_reads[] = { @@ -348,12 +348,12 @@ TEST_P(HttpProxyClientSocketPoolSpdy21Test, AsyncHaveAuth) { MockRead(SYNCHRONOUS, "HTTP/1.1 200 Connection Established\r\n\r\n"), }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, + scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead spdy_reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2) @@ -460,7 +460,7 @@ TEST_P(HttpProxyClientSocketPoolSpdy21Test, TunnelUnexpectedClose) { MockRead(ASYNC, 1, "HTTP/1.1 200 Conn"), MockRead(ASYNC, ERR_CONNECTION_CLOSED, 2), }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, + scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC) @@ -497,14 +497,14 @@ TEST_P(HttpProxyClientSocketPoolSpdy21Test, TunnelSetupError) { MockRead reads[] = { MockRead(ASYNC, 1, "HTTP/1.1 304 Not Modified\r\n\r\n"), }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, + scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); - scoped_ptr<spdy::SpdyFrame> rst(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), CreateMockWrite(*rst, 2, ASYNC), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdySynReplyError(1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdySynReplyError(1)); MockRead spdy_reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 3), diff --git a/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc b/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc index b564d62..43da413 100644 --- a/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc +++ b/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc @@ -252,8 +252,8 @@ TEST_P(HttpProxyClientSocketPoolSpdy2Test, NeedAuth) { MockRead(ASYNC, 3, "Content-Length: 10\r\n\r\n"), MockRead(ASYNC, 4, "0123456789"), }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> rst(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), CreateMockWrite(*rst, 2, ASYNC), @@ -263,15 +263,15 @@ TEST_P(HttpProxyClientSocketPoolSpdy2Test, NeedAuth) { "version", "HTTP/1.1", "proxy-authenticate", "Basic realm=\"MyRealm1\"", }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdyControlFrame(NULL, 0, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kAuthChallenge, arraysize(kAuthChallenge))); MockRead spdy_reads[] = { @@ -348,12 +348,12 @@ TEST_P(HttpProxyClientSocketPoolSpdy2Test, AsyncHaveAuth) { MockRead(SYNCHRONOUS, "HTTP/1.1 200 Connection Established\r\n\r\n"), }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, + scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead spdy_reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2) @@ -460,7 +460,7 @@ TEST_P(HttpProxyClientSocketPoolSpdy2Test, TunnelUnexpectedClose) { MockRead(ASYNC, 1, "HTTP/1.1 200 Conn"), MockRead(ASYNC, ERR_CONNECTION_CLOSED, 2), }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, + scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC) @@ -497,14 +497,14 @@ TEST_P(HttpProxyClientSocketPoolSpdy2Test, TunnelSetupError) { MockRead reads[] = { MockRead(ASYNC, 1, "HTTP/1.1 304 Not Modified\r\n\r\n"), }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, + scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); - scoped_ptr<spdy::SpdyFrame> rst(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), CreateMockWrite(*rst, 2, ASYNC), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdySynReplyError(1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdySynReplyError(1)); MockRead spdy_reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 3), diff --git a/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc b/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc index 82f7ab0..6aed8e4 100644 --- a/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc +++ b/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc @@ -253,8 +253,8 @@ TEST_P(HttpProxyClientSocketPoolSpdy3Test, NeedAuth) { MockRead(ASYNC, 3, "Content-Length: 10\r\n\r\n"), MockRead(ASYNC, 4, "0123456789"), }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> rst(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), CreateMockWrite(*rst, 2, ASYNC), @@ -264,15 +264,15 @@ TEST_P(HttpProxyClientSocketPoolSpdy3Test, NeedAuth) { "version", "HTTP/1.1", "proxy-authenticate", "Basic realm=\"MyRealm1\"", }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdyControlFrame(NULL, 0, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kAuthChallenge, arraysize(kAuthChallenge))); MockRead spdy_reads[] = { @@ -349,12 +349,12 @@ TEST_P(HttpProxyClientSocketPoolSpdy3Test, AsyncHaveAuth) { MockRead(SYNCHRONOUS, "HTTP/1.1 200 Connection Established\r\n\r\n"), }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, + scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead spdy_reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2) @@ -461,7 +461,7 @@ TEST_P(HttpProxyClientSocketPoolSpdy3Test, TunnelUnexpectedClose) { MockRead(ASYNC, 1, "HTTP/1.1 200 Conn"), MockRead(ASYNC, ERR_CONNECTION_CLOSED, 2), }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, + scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC) @@ -498,14 +498,14 @@ TEST_P(HttpProxyClientSocketPoolSpdy3Test, TunnelSetupError) { MockRead reads[] = { MockRead(ASYNC, 1, "HTTP/1.1 304 Not Modified\r\n\r\n"), }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, + scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); - scoped_ptr<spdy::SpdyFrame> rst(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), CreateMockWrite(*rst, 2, ASYNC), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdySynReplyError(1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdySynReplyError(1)); MockRead spdy_reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 3), diff --git a/net/http/http_server_properties.h b/net/http/http_server_properties.h index 3878768..ccadf2b 100644 --- a/net/http/http_server_properties.h +++ b/net/http/http_server_properties.h @@ -37,7 +37,7 @@ struct NET_EXPORT PortAlternateProtocolPair { }; typedef std::map<HostPortPair, PortAlternateProtocolPair> AlternateProtocolMap; -typedef std::map<HostPortPair, spdy::SpdySettings> SpdySettingsMap; +typedef std::map<HostPortPair, SpdySettings> SpdySettingsMap; typedef std::map<HostPortPair, HttpPipelinedHostCapability> PipelineCapabilityMap; @@ -86,19 +86,19 @@ class NET_EXPORT HttpServerProperties { // Gets a reference to the SpdySettings stored for a host. // If no settings are stored, returns an empty set of settings. - virtual const spdy::SpdySettings& GetSpdySettings( + virtual const SpdySettings& GetSpdySettings( const HostPortPair& host_port_pair) const = 0; // Saves settings for a host. Returns true if SpdySettings are to be // persisted. Used by unittests only. // TODO(rtenneti): Move this method to test utility file. virtual bool SetSpdySettings(const HostPortPair& host_port_pair, - const spdy::SpdySettings& settings) = 0; + const SpdySettings& settings) = 0; // Saves an individual setting for a host. Returns true if SpdySetting is to // be persisted. virtual bool SetSpdySetting(const HostPortPair& host_port_pair, - const spdy::SpdySetting& setting) = 0; + const SpdySetting& setting) = 0; // Clears all spdy_settings. virtual void ClearSpdySettings() = 0; diff --git a/net/http/http_server_properties_impl.cc b/net/http/http_server_properties_impl.cc index 6601fe5..714f4c1 100644 --- a/net/http/http_server_properties_impl.cc +++ b/net/http/http_server_properties_impl.cc @@ -52,7 +52,7 @@ void HttpServerPropertiesImpl::InitializeAlternateProtocolServers( } void HttpServerPropertiesImpl::InitializeSpdySettingsServers( - std::map<HostPortPair, spdy::SpdySettings>* spdy_settings_map) { + std::map<HostPortPair, SpdySettings>* spdy_settings_map) { spdy_settings_map_.swap(*spdy_settings_map); } @@ -220,11 +220,11 @@ HttpServerPropertiesImpl::alternate_protocol_map() const { return alternate_protocol_map_; } -const spdy::SpdySettings& HttpServerPropertiesImpl::GetSpdySettings( +const SpdySettings& HttpServerPropertiesImpl::GetSpdySettings( const HostPortPair& host_port_pair) const { SpdySettingsMap::const_iterator it = spdy_settings_map_.find(host_port_pair); if (it == spdy_settings_map_.end()) { - CR_DEFINE_STATIC_LOCAL(spdy::SpdySettings, kEmptySpdySettings, ()); + CR_DEFINE_STATIC_LOCAL(SpdySettings, kEmptySpdySettings, ()); return kEmptySpdySettings; } return it->second; @@ -232,16 +232,16 @@ const spdy::SpdySettings& HttpServerPropertiesImpl::GetSpdySettings( bool HttpServerPropertiesImpl::SetSpdySettings( const HostPortPair& host_port_pair, - const spdy::SpdySettings& settings) { - spdy::SpdySettings persistent_settings; + const SpdySettings& settings) { + SpdySettings persistent_settings; // Iterate through the list, and only copy those settings which are marked // for persistence. - spdy::SpdySettings::const_iterator it; + SpdySettings::const_iterator it; for (it = settings.begin(); it != settings.end(); ++it) { - spdy::SettingsFlagsAndId id = it->first; - if (id.flags() & spdy::SETTINGS_FLAG_PLEASE_PERSIST) { - spdy::SettingsFlagsAndId new_id(spdy::SETTINGS_FLAG_PERSISTED, id.id()); + SettingsFlagsAndId id = it->first; + if (id.flags() & SETTINGS_FLAG_PLEASE_PERSIST) { + SettingsFlagsAndId new_id(SETTINGS_FLAG_PERSISTED, id.id()); persistent_settings.push_back(std::make_pair(new_id, it->second)); } } @@ -256,19 +256,19 @@ bool HttpServerPropertiesImpl::SetSpdySettings( bool HttpServerPropertiesImpl::SetSpdySetting( const HostPortPair& host_port_pair, - const spdy::SpdySetting& setting) { + const SpdySetting& setting) { - spdy::SettingsFlagsAndId id = setting.first; - if (!(id.flags() & spdy::SETTINGS_FLAG_PLEASE_PERSIST)) + SettingsFlagsAndId id = setting.first; + if (!(id.flags() & SETTINGS_FLAG_PLEASE_PERSIST)) return false; SpdySettingsMap::const_iterator it = spdy_settings_map_.find(host_port_pair); - spdy::SpdySettings persistent_settings; + SpdySettings persistent_settings; if (it != spdy_settings_map_.end()) { persistent_settings = it->second; } - spdy::SettingsFlagsAndId new_id(spdy::SETTINGS_FLAG_PERSISTED, id.id()); + SettingsFlagsAndId new_id(SETTINGS_FLAG_PERSISTED, id.id()); persistent_settings.push_back(std::make_pair(new_id, setting.second)); spdy_settings_map_[host_port_pair] = persistent_settings; diff --git a/net/http/http_server_properties_impl.h b/net/http/http_server_properties_impl.h index b4de808..eb4816e 100644 --- a/net/http/http_server_properties_impl.h +++ b/net/http/http_server_properties_impl.h @@ -105,18 +105,18 @@ class NET_EXPORT HttpServerPropertiesImpl // Gets a reference to the SpdySettings stored for a host. // If no settings are stored, returns an empty set of settings. - virtual const spdy::SpdySettings& GetSpdySettings( + virtual const SpdySettings& GetSpdySettings( const HostPortPair& host_port_pair) const OVERRIDE; // Saves settings for a host. Returns true if SpdySettings are to be // persisted because |spdy_settings_map_| has been updated. virtual bool SetSpdySettings(const HostPortPair& host_port_pair, - const spdy::SpdySettings& settings) OVERRIDE; + const SpdySettings& settings) OVERRIDE; // Saves an individual setting for a host. Returns true if SpdySetting is to // be persisted because |spdy_settings_map_| has been updated. virtual bool SetSpdySetting(const HostPortPair& host_port_pair, - const spdy::SpdySetting& setting) OVERRIDE; + const SpdySetting& setting) OVERRIDE; // Clears all spdy_settings. virtual void ClearSpdySettings() OVERRIDE; diff --git a/net/http/http_server_properties_impl_unittest.cc b/net/http/http_server_properties_impl_unittest.cc index d58ba31..c26491c 100644 --- a/net/http/http_server_properties_impl_unittest.cc +++ b/net/http/http_server_properties_impl_unittest.cc @@ -290,147 +290,147 @@ TEST_F(SpdySettingsServerPropertiesTest, Initialize) { EXPECT_TRUE(impl_.GetSpdySettings(spdy_server_google).empty()); // Check by initializing with www.google.com:443 spdy server settings. - spdy::SpdySettings spdy_settings; - spdy::SettingsFlagsAndId spdy_setting(spdy::SETTINGS_FLAG_PERSISTED, 1234); + SpdySettings spdy_settings; + SettingsFlagsAndId spdy_setting(SETTINGS_FLAG_PERSISTED, 1234); spdy_settings.push_back(std::make_pair(spdy_setting, 31337)); spdy_settings_map[spdy_server_google] = spdy_settings; impl_.InitializeSpdySettingsServers(&spdy_settings_map); - spdy::SpdySettings spdy_settings2 = impl_.GetSpdySettings(spdy_server_google); + SpdySettings spdy_settings2 = impl_.GetSpdySettings(spdy_server_google); ASSERT_EQ(1U, spdy_settings2.size()); - spdy::SpdySetting spdy_setting2 = spdy_settings2.front(); - spdy::SettingsFlagsAndId id2_ret(spdy_setting2.first); + SpdySetting spdy_setting2 = spdy_settings2.front(); + SettingsFlagsAndId id2_ret(spdy_setting2.first); EXPECT_EQ(1234U, id2_ret.id()); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, id2_ret.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, id2_ret.flags()); EXPECT_EQ(31337U, spdy_settings2.front().second); } TEST_F(SpdySettingsServerPropertiesTest, SetSpdySettings) { HostPortPair spdy_server_empty("", 443); - spdy::SpdySettings spdy_settings0 = impl_.GetSpdySettings(spdy_server_empty); + SpdySettings spdy_settings0 = impl_.GetSpdySettings(spdy_server_empty); EXPECT_EQ(0U, spdy_settings0.size()); // Returns kEmptySpdySettings // Add www.google.com:443 as persisting. HostPortPair spdy_server_google("www.google.com", 443); - spdy::SpdySettings spdy_settings1; - spdy::SettingsFlagsAndId id1(spdy::SETTINGS_FLAG_PLEASE_PERSIST, 1234); + SpdySettings spdy_settings1; + SettingsFlagsAndId id1(SETTINGS_FLAG_PLEASE_PERSIST, 1234); spdy_settings1.push_back(std::make_pair(id1, 31337)); EXPECT_TRUE(impl_.SetSpdySettings(spdy_server_google, spdy_settings1)); - spdy::SpdySettings spdy_settings1_ret = + SpdySettings spdy_settings1_ret = impl_.GetSpdySettings(spdy_server_google); ASSERT_EQ(1U, spdy_settings1_ret.size()); - spdy::SpdySetting spdy_setting1_ret = spdy_settings1_ret.front(); - spdy::SettingsFlagsAndId id1_ret(spdy_setting1_ret.first); + SpdySetting spdy_setting1_ret = spdy_settings1_ret.front(); + SettingsFlagsAndId id1_ret(spdy_setting1_ret.first); EXPECT_EQ(1234U, id1_ret.id()); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, id1_ret.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, id1_ret.flags()); EXPECT_EQ(31337U, spdy_setting1_ret.second); // Add mail.google.com:443 as not persisting. HostPortPair spdy_server_mail("mail.google.com", 443); - spdy::SpdySettings spdy_settings2; - spdy::SettingsFlagsAndId id2(0, 5678); + SpdySettings spdy_settings2; + SettingsFlagsAndId id2(0, 5678); spdy_settings2.push_back(std::make_pair(id2, 62667)); EXPECT_FALSE(impl_.SetSpdySettings(spdy_server_mail, spdy_settings2)); - spdy::SpdySettings spdy_settings2_ret = + SpdySettings spdy_settings2_ret = impl_.GetSpdySettings(spdy_server_mail); EXPECT_EQ(0U, spdy_settings2_ret.size()); // Returns kEmptySpdySettings // Add docs.google.com:443 as persisting HostPortPair spdy_server_docs("docs.google.com", 443); - spdy::SpdySettings spdy_settings3; - spdy::SettingsFlagsAndId id3(spdy::SETTINGS_FLAG_PLEASE_PERSIST, 9012); + SpdySettings spdy_settings3; + SettingsFlagsAndId id3(SETTINGS_FLAG_PLEASE_PERSIST, 9012); spdy_settings3.push_back(std::make_pair(id3, 93997)); EXPECT_TRUE(impl_.SetSpdySettings(spdy_server_docs, spdy_settings3)); - spdy::SpdySettings spdy_settings3_ret = + SpdySettings spdy_settings3_ret = impl_.GetSpdySettings(spdy_server_docs); ASSERT_EQ(1U, spdy_settings3_ret.size()); - spdy::SpdySetting spdy_setting3_ret = spdy_settings3_ret.front(); - spdy::SettingsFlagsAndId id3_ret(spdy_setting3_ret.first); + SpdySetting spdy_setting3_ret = spdy_settings3_ret.front(); + SettingsFlagsAndId id3_ret(spdy_setting3_ret.first); EXPECT_EQ(9012U, id3_ret.id()); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, id3_ret.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, id3_ret.flags()); EXPECT_EQ(93997U, spdy_setting3_ret.second); } TEST_F(SpdySettingsServerPropertiesTest, SetSpdySetting) { HostPortPair spdy_server_empty("", 443); - spdy::SpdySettings spdy_settings0 = impl_.GetSpdySettings(spdy_server_empty); + SpdySettings spdy_settings0 = impl_.GetSpdySettings(spdy_server_empty); EXPECT_EQ(0U, spdy_settings0.size()); // Returns kEmptySpdySettings // Add www.google.com:443 as persisting. HostPortPair spdy_server_google("www.google.com", 443); - spdy::SettingsFlagsAndId id1(spdy::SETTINGS_FLAG_PLEASE_PERSIST, 1234); + SettingsFlagsAndId id1(SETTINGS_FLAG_PLEASE_PERSIST, 1234); EXPECT_TRUE(impl_.SetSpdySetting( spdy_server_google, std::make_pair(id1, 31337))); - spdy::SpdySettings spdy_settings1_ret = + SpdySettings spdy_settings1_ret = impl_.GetSpdySettings(spdy_server_google); ASSERT_EQ(1U, spdy_settings1_ret.size()); - spdy::SpdySetting spdy_setting1_ret = spdy_settings1_ret.front(); - spdy::SettingsFlagsAndId id1_ret(spdy_setting1_ret.first); + SpdySetting spdy_setting1_ret = spdy_settings1_ret.front(); + SettingsFlagsAndId id1_ret(spdy_setting1_ret.first); EXPECT_EQ(1234U, id1_ret.id()); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, id1_ret.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, id1_ret.flags()); EXPECT_EQ(31337U, spdy_setting1_ret.second); // Add mail.google.com:443 as not persisting. HostPortPair spdy_server_mail("mail.google.com", 443); - spdy::SettingsFlagsAndId id2(0, 5678); + SettingsFlagsAndId id2(0, 5678); EXPECT_FALSE(impl_.SetSpdySetting( spdy_server_mail, std::make_pair(id2, 62667))); - spdy::SpdySettings spdy_settings2_ret = + SpdySettings spdy_settings2_ret = impl_.GetSpdySettings(spdy_server_mail); EXPECT_EQ(0U, spdy_settings2_ret.size()); // Returns kEmptySpdySettings // Add docs.google.com:443 as persisting HostPortPair spdy_server_docs("docs.google.com", 443); - spdy::SettingsFlagsAndId id3(spdy::SETTINGS_FLAG_PLEASE_PERSIST, 9012); + SettingsFlagsAndId id3(SETTINGS_FLAG_PLEASE_PERSIST, 9012); EXPECT_TRUE(impl_.SetSpdySetting( spdy_server_docs, std::make_pair(id3, 93997))); - spdy::SpdySettings spdy_settings3_ret = + SpdySettings spdy_settings3_ret = impl_.GetSpdySettings(spdy_server_docs); ASSERT_EQ(1U, spdy_settings3_ret.size()); - spdy::SpdySetting spdy_setting3_ret = spdy_settings3_ret.front(); - spdy::SettingsFlagsAndId id3_ret(spdy_setting3_ret.first); + SpdySetting spdy_setting3_ret = spdy_settings3_ret.front(); + SettingsFlagsAndId id3_ret(spdy_setting3_ret.first); EXPECT_EQ(9012U, id3_ret.id()); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, id3_ret.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, id3_ret.flags()); EXPECT_EQ(93997U, spdy_setting3_ret.second); // Check data for www.google.com:443. - spdy::SpdySettings spdy_settings4_ret = + SpdySettings spdy_settings4_ret = impl_.GetSpdySettings(spdy_server_google); ASSERT_EQ(1U, spdy_settings4_ret.size()); - spdy::SpdySetting spdy_setting4_ret = spdy_settings4_ret.front(); - spdy::SettingsFlagsAndId id4_ret(spdy_setting4_ret.first); + SpdySetting spdy_setting4_ret = spdy_settings4_ret.front(); + SettingsFlagsAndId id4_ret(spdy_setting4_ret.first); EXPECT_EQ(1234U, id4_ret.id()); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, id4_ret.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, id4_ret.flags()); EXPECT_EQ(31337U, spdy_setting4_ret.second); } TEST_F(SpdySettingsServerPropertiesTest, Clear) { // Add www.google.com:443 as persisting. HostPortPair spdy_server_google("www.google.com", 443); - spdy::SpdySettings spdy_settings1; - spdy::SettingsFlagsAndId id1(spdy::SETTINGS_FLAG_PLEASE_PERSIST, 1234); + SpdySettings spdy_settings1; + SettingsFlagsAndId id1(SETTINGS_FLAG_PLEASE_PERSIST, 1234); spdy_settings1.push_back(std::make_pair(id1, 31337)); EXPECT_TRUE(impl_.SetSpdySettings(spdy_server_google, spdy_settings1)); - spdy::SpdySettings spdy_settings1_ret = + SpdySettings spdy_settings1_ret = impl_.GetSpdySettings(spdy_server_google); ASSERT_EQ(1U, spdy_settings1_ret.size()); - spdy::SpdySetting spdy_setting1_ret = spdy_settings1_ret.front(); - spdy::SettingsFlagsAndId id1_ret(spdy_setting1_ret.first); + SpdySetting spdy_setting1_ret = spdy_settings1_ret.front(); + SettingsFlagsAndId id1_ret(spdy_setting1_ret.first); EXPECT_EQ(1234U, id1_ret.id()); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, id1_ret.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, id1_ret.flags()); EXPECT_EQ(31337U, spdy_setting1_ret.second); // Add docs.google.com:443 as persisting HostPortPair spdy_server_docs("docs.google.com", 443); - spdy::SpdySettings spdy_settings3; - spdy::SettingsFlagsAndId id3(spdy::SETTINGS_FLAG_PLEASE_PERSIST, 9012); + SpdySettings spdy_settings3; + SettingsFlagsAndId id3(SETTINGS_FLAG_PLEASE_PERSIST, 9012); spdy_settings3.push_back(std::make_pair(id3, 93997)); EXPECT_TRUE(impl_.SetSpdySettings(spdy_server_docs, spdy_settings3)); - spdy::SpdySettings spdy_settings3_ret = + SpdySettings spdy_settings3_ret = impl_.GetSpdySettings(spdy_server_docs); ASSERT_EQ(1U, spdy_settings3_ret.size()); - spdy::SpdySetting spdy_setting3_ret = spdy_settings3_ret.front(); - spdy::SettingsFlagsAndId id3_ret(spdy_setting3_ret.first); + SpdySetting spdy_setting3_ret = spdy_settings3_ret.front(); + SettingsFlagsAndId id3_ret(spdy_setting3_ret.first); EXPECT_EQ(9012U, id3_ret.id()); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, id3_ret.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, id3_ret.flags()); EXPECT_EQ(93997U, spdy_setting3_ret.second); impl_.Clear(); diff --git a/net/spdy/buffered_spdy_framer.cc b/net/spdy/buffered_spdy_framer.cc index 6a48a5d..279d1d7 100644 --- a/net/spdy/buffered_spdy_framer.cc +++ b/net/spdy/buffered_spdy_framer.cc @@ -6,7 +6,7 @@ #include "base/logging.h" -namespace spdy { +namespace net { BufferedSpdyFramer::BufferedSpdyFramer(int version) : spdy_framer_(version), @@ -27,7 +27,7 @@ void BufferedSpdyFramer::set_visitor( spdy_framer_.set_visitor(this); } -void BufferedSpdyFramer::OnError(spdy::SpdyFramer* spdy_framer) { +void BufferedSpdyFramer::OnError(SpdyFramer* spdy_framer) { DCHECK(spdy_framer); visitor_->OnError(spdy_framer->error_code()); } @@ -42,21 +42,21 @@ void BufferedSpdyFramer::OnControl(const SpdyControlFrame* frame) { break; case GOAWAY: visitor_->OnGoAway( - *reinterpret_cast<const spdy::SpdyGoAwayControlFrame*>(frame)); + *reinterpret_cast<const SpdyGoAwayControlFrame*>(frame)); break; case PING: visitor_->OnPing( - *reinterpret_cast<const spdy::SpdyPingControlFrame*>(frame)); + *reinterpret_cast<const SpdyPingControlFrame*>(frame)); break; case SETTINGS: break; case RST_STREAM: visitor_->OnRstStream( - *reinterpret_cast<const spdy::SpdyRstStreamControlFrame*>(frame)); + *reinterpret_cast<const SpdyRstStreamControlFrame*>(frame)); break; - case spdy::WINDOW_UPDATE: + case WINDOW_UPDATE: visitor_->OnWindowUpdate( - *reinterpret_cast<const spdy::SpdyWindowUpdateControlFrame*>(frame)); + *reinterpret_cast<const SpdyWindowUpdateControlFrame*>(frame)); break; default: NOTREACHED(); // Error! @@ -224,7 +224,7 @@ SpdyWindowUpdateControlFrame* BufferedSpdyFramer::CreateWindowUpdate( } SpdyCredentialControlFrame* BufferedSpdyFramer::CreateCredentialFrame( - const spdy::SpdyCredential& credential) const { + const SpdyCredential& credential) const { return spdy_framer_.CreateCredentialFrame(credential); } @@ -274,4 +274,4 @@ void BufferedSpdyFramer::InitHeaderStreaming(const SpdyControlFrame* frame) { frame_size_without_header_block); } -} // namespace spdy +} // namespace net diff --git a/net/spdy/buffered_spdy_framer.h b/net/spdy/buffered_spdy_framer.h index f12421f..726fb0b 100644 --- a/net/spdy/buffered_spdy_framer.h +++ b/net/spdy/buffered_spdy_framer.h @@ -16,7 +16,7 @@ #include "net/spdy/spdy_framer.h" #include "net/spdy/spdy_protocol.h" -namespace spdy { +namespace net { class NET_EXPORT_PRIVATE BufferedSpdyFramerVisitorInterface { public: @@ -27,7 +27,7 @@ class NET_EXPORT_PRIVATE BufferedSpdyFramerVisitorInterface { virtual void OnError(int error_code) = 0; // Called if an error is detected in a SPDY stream. - virtual void OnStreamError(spdy::SpdyStreamId stream_id, + virtual void OnStreamError(SpdyStreamId stream_id, const std::string& description) = 0; // Called after all the header data for SYN_STREAM control frame is received. @@ -43,17 +43,17 @@ class NET_EXPORT_PRIVATE BufferedSpdyFramerVisitorInterface { const linked_ptr<SpdyHeaderBlock>& headers) = 0; // Called after a RST_STREAM frame is received. - virtual void OnRstStream(const spdy::SpdyRstStreamControlFrame& frame) = 0; + virtual void OnRstStream(const SpdyRstStreamControlFrame& frame) = 0; // Called after a GOAWAY frame is received. - virtual void OnGoAway(const spdy::SpdyGoAwayControlFrame& frame) = 0; + virtual void OnGoAway(const SpdyGoAwayControlFrame& frame) = 0; // Called after a PING frame is received. - virtual void OnPing(const spdy::SpdyPingControlFrame& frame) = 0; + virtual void OnPing(const SpdyPingControlFrame& frame) = 0; // Called after a WINDOW_UPDATE frame is received. virtual void OnWindowUpdate( - const spdy::SpdyWindowUpdateControlFrame& frame) = 0; + const SpdyWindowUpdateControlFrame& frame) = 0; // Called when data is received. // |stream_id| The stream receiving data. @@ -86,7 +86,7 @@ class NET_EXPORT_PRIVATE BufferedSpdyFramer void set_visitor(BufferedSpdyFramerVisitorInterface* visitor); // SpdyFramerVisitorInterface - virtual void OnError(spdy::SpdyFramer* spdy_framer) OVERRIDE; + virtual void OnError(SpdyFramer* spdy_framer) OVERRIDE; virtual void OnControl(const SpdyControlFrame* frame) OVERRIDE; virtual bool OnCredentialFrameData(const char* frame_data, size_t len) OVERRIDE; @@ -133,7 +133,7 @@ class NET_EXPORT_PRIVATE BufferedSpdyFramer SpdyStreamId stream_id, uint32 delta_window_size) const; SpdyCredentialControlFrame* CreateCredentialFrame( - const spdy::SpdyCredential& credential) const; + const SpdyCredential& credential) const; SpdyDataFrame* CreateDataFrame(SpdyStreamId stream_id, const char* data, uint32 len, @@ -164,6 +164,6 @@ class NET_EXPORT_PRIVATE BufferedSpdyFramer DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramer); }; -} // namespace spdy +} // namespace net #endif // NET_SPDY_BUFFERED_SPDY_FRAMER_H_ diff --git a/net/spdy/buffered_spdy_framer_spdy2_unittest.cc b/net/spdy/buffered_spdy_framer_spdy2_unittest.cc index f627da2..800f28f 100644 --- a/net/spdy/buffered_spdy_framer_spdy2_unittest.cc +++ b/net/spdy/buffered_spdy_framer_spdy2_unittest.cc @@ -9,7 +9,7 @@ using namespace net::test_spdy2; -namespace spdy { +namespace net { namespace { @@ -30,7 +30,7 @@ class TestBufferedSpdyVisitor : public BufferedSpdyFramerVisitorInterface { error_count_++; } - void OnStreamError(spdy::SpdyStreamId stream_id, + void OnStreamError(SpdyStreamId stream_id, const std::string& description) { LOG(INFO) << "SpdyFramer Error on stream: " << stream_id << " " << description; @@ -95,11 +95,11 @@ class TestBufferedSpdyVisitor : public BufferedSpdyFramerVisitorInterface { } } - void OnRstStream(const spdy::SpdyRstStreamControlFrame& frame) {} - void OnGoAway(const spdy::SpdyGoAwayControlFrame& frame) {} - void OnPing(const spdy::SpdyPingControlFrame& frame) {} - void OnWindowUpdate(const spdy::SpdyWindowUpdateControlFrame& frame) {} - void OnCredential(const spdy::SpdyCredentialControlFrame& frame) {} + void OnRstStream(const SpdyRstStreamControlFrame& frame) {} + void OnGoAway(const SpdyGoAwayControlFrame& frame) {} + void OnPing(const SpdyPingControlFrame& frame) {} + void OnWindowUpdate(const SpdyWindowUpdateControlFrame& frame) {} + void OnCredential(const SpdyCredentialControlFrame& frame) {} // Convenience function which runs a framer simulation with particular input. void SimulateInFramer(const unsigned char* input, size_t size) { @@ -260,4 +260,4 @@ TEST_F(BufferedSpdyFramerSpdy2Test, ReadHeadersHeaderBlock) { EXPECT_EQ(1, visitor.headers_frame_count_); EXPECT_TRUE(CompareHeaderBlocks(&headers, &visitor.headers_)); } -} // namespace spdy +} // namespace net diff --git a/net/spdy/buffered_spdy_framer_spdy3_unittest.cc b/net/spdy/buffered_spdy_framer_spdy3_unittest.cc index 27f8717..acd0079 100644 --- a/net/spdy/buffered_spdy_framer_spdy3_unittest.cc +++ b/net/spdy/buffered_spdy_framer_spdy3_unittest.cc @@ -9,7 +9,7 @@ using namespace net::test_spdy3; -namespace spdy { +namespace net { namespace { @@ -30,7 +30,7 @@ class TestBufferedSpdyVisitor : public BufferedSpdyFramerVisitorInterface { error_count_++; } - void OnStreamError(spdy::SpdyStreamId stream_id, + void OnStreamError(SpdyStreamId stream_id, const std::string& description) { LOG(INFO) << "SpdyFramer Error on stream: " << stream_id << " " << description; @@ -95,11 +95,11 @@ class TestBufferedSpdyVisitor : public BufferedSpdyFramerVisitorInterface { } } - void OnRstStream(const spdy::SpdyRstStreamControlFrame& frame) {} - void OnGoAway(const spdy::SpdyGoAwayControlFrame& frame) {} - void OnPing(const spdy::SpdyPingControlFrame& frame) {} - void OnWindowUpdate(const spdy::SpdyWindowUpdateControlFrame& frame) {} - void OnCredential(const spdy::SpdyCredentialControlFrame& frame) {} + void OnRstStream(const SpdyRstStreamControlFrame& frame) {} + void OnGoAway(const SpdyGoAwayControlFrame& frame) {} + void OnPing(const SpdyPingControlFrame& frame) {} + void OnWindowUpdate(const SpdyWindowUpdateControlFrame& frame) {} + void OnCredential(const SpdyCredentialControlFrame& frame) {} // Convenience function which runs a framer simulation with particular input. void SimulateInFramer(const unsigned char* input, size_t size) { @@ -260,4 +260,4 @@ TEST_F(BufferedSpdyFramerSpdy3Test, ReadHeadersHeaderBlock) { EXPECT_EQ(1, visitor.headers_frame_count_); EXPECT_TRUE(CompareHeaderBlocks(&headers, &visitor.headers_)); } -} // namespace spdy +} // namespace net diff --git a/net/spdy/spdy_bitmasks.h b/net/spdy/spdy_bitmasks.h index 1d1b42c..ed93a33 100644 --- a/net/spdy/spdy_bitmasks.h +++ b/net/spdy/spdy_bitmasks.h @@ -6,7 +6,7 @@ #define NET_SPDY_SPDY_BITMASKS_H_ #pragma once -namespace spdy { +namespace net { // StreamId mask from the SpdyHeader const unsigned int kStreamIdMask = 0x7fffffff; @@ -27,6 +27,6 @@ const int kDataFlagsMask = 0x03; // Legal flags on control packets. const int kControlFlagsMask = 0x03; -} // namespace spdy +} // namespace net #endif // NET_SPDY_SPDY_BITMASKS_H_ diff --git a/net/spdy/spdy_frame_builder.cc b/net/spdy/spdy_frame_builder.cc index 2948b3c..5d0acab 100644 --- a/net/spdy/spdy_frame_builder.cc +++ b/net/spdy/spdy_frame_builder.cc @@ -7,7 +7,7 @@ #include "net/spdy/spdy_frame_builder.h" #include "net/spdy/spdy_protocol.h" -namespace spdy { +namespace net { SpdyFrameBuilder::SpdyFrameBuilder(size_t size) : buffer_(NULL), @@ -90,4 +90,4 @@ bool SpdyFrameBuilder::Resize(size_t new_capacity) { return true; } -} // namespace spdy +} // namespace net diff --git a/net/spdy/spdy_frame_builder.h b/net/spdy/spdy_frame_builder.h index db5926d6..c38d11b 100644 --- a/net/spdy/spdy_frame_builder.h +++ b/net/spdy/spdy_frame_builder.h @@ -14,7 +14,7 @@ #include "net/base/net_export.h" #include "net/spdy/spdy_protocol.h" -namespace spdy { +namespace net { // This class provides facilities for basic binary value packing and unpacking // into Spdy frames. @@ -128,6 +128,6 @@ class NET_EXPORT_PRIVATE SpdyFrameBuilder { size_t variable_buffer_offset_; // IF non-zero, then offset to a buffer. }; -} // namespace spdy +} // namespace net #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_ diff --git a/net/spdy/spdy_frame_reader.cc b/net/spdy/spdy_frame_reader.cc index 183bae9..57bf9eb 100644 --- a/net/spdy/spdy_frame_reader.cc +++ b/net/spdy/spdy_frame_reader.cc @@ -7,7 +7,7 @@ #include "base/sys_byteorder.h" #include "net/spdy/spdy_frame_reader.h" -namespace spdy { +namespace net { SpdyFrameReader::SpdyFrameReader(const char* data, const size_t len) : data_(data), @@ -123,4 +123,4 @@ void SpdyFrameReader::OnFailure() { ofs_ = len_; } -} // namespace spdy +} // namespace net diff --git a/net/spdy/spdy_frame_reader.h b/net/spdy/spdy_frame_reader.h index 72805a4..489ef4d 100644 --- a/net/spdy/spdy_frame_reader.h +++ b/net/spdy/spdy_frame_reader.h @@ -10,7 +10,7 @@ #include "base/string_piece.h" #include "net/base/net_export.h" -namespace spdy { +namespace net { // Used for reading SPDY frames. Though there isn't really anything terribly // SPDY-specific here, it's a helper class that's useful when doing SPDY @@ -90,7 +90,6 @@ class NET_EXPORT_PRIVATE SpdyFrameReader { size_t ofs_; }; -} // namespace spdy +} // namespace net #endif // NET_SPDY_FRAME_READER_H_ - diff --git a/net/spdy/spdy_frame_reader_test.cc b/net/spdy/spdy_frame_reader_test.cc index aeaca94..fda2fce 100644 --- a/net/spdy/spdy_frame_reader_test.cc +++ b/net/spdy/spdy_frame_reader_test.cc @@ -10,7 +10,7 @@ #include "net/spdy/spdy_frame_reader.h" #include "testing/platform_test.h" -namespace spdy { +namespace net { TEST(SpdyFrameReaderTest, ReadUInt16) { // Frame data in network byte order. @@ -246,4 +246,4 @@ TEST(SpdyFrameReaderTest, ReadBytesWithBufferTooSmall) { EXPECT_STREQ("", dest); } -} // namespace +} // namespace net diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc index 3a41198..a5cc9e3 100644 --- a/net/spdy/spdy_framer.cc +++ b/net/spdy/spdy_framer.cc @@ -24,7 +24,7 @@ using std::vector; -namespace spdy { +namespace net { // Compute the id of our dictionary so that we know we're using the // right one when asked for it. @@ -1252,7 +1252,7 @@ SpdyWindowUpdateControlFrame* SpdyFramer::CreateWindowUpdate( DCHECK_EQ(0u, stream_id & ~kStreamIdMask); DCHECK_GT(delta_window_size, 0u); DCHECK_LE(delta_window_size, - static_cast<uint32>(spdy::kSpdyStreamMaximumWindowSize)); + static_cast<uint32>(kSpdyStreamMaximumWindowSize)); SpdyFrameBuilder frame(SpdyWindowUpdateControlFrame::size()); frame.WriteUInt16(kControlFlagMask | spdy_version_); @@ -1797,4 +1797,4 @@ void SpdyFramer::set_enable_compression_default(bool value) { compression_default_ = value; } -} // namespace spdy +} // namespace net diff --git a/net/spdy/spdy_framer.h b/net/spdy/spdy_framer.h index d335a05..73913b1 100644 --- a/net/spdy/spdy_framer.h +++ b/net/spdy/spdy_framer.h @@ -22,6 +22,7 @@ typedef struct z_stream_s z_stream; // Forward declaration for zlib. namespace net { + class HttpProxyClientSocketPoolTest; class HttpNetworkLayer; class HttpNetworkTransactionTest; @@ -32,9 +33,6 @@ class SpdySessionTest; class SpdyStreamTest; class SpdyWebSocketStreamTest; class WebSocketJobTest; -} - -namespace spdy { class SpdyFramer; class SpdyFrameBuilder; @@ -596,6 +594,6 @@ class NET_EXPORT_PRIVATE SpdyFramer { static bool compression_default_; }; -} // namespace spdy +} // namespace net #endif // NET_SPDY_SPDY_FRAMER_H_ diff --git a/net/spdy/spdy_framer_test.cc b/net/spdy/spdy_framer_test.cc index 3c594ac..af47005 100644 --- a/net/spdy/spdy_framer_test.cc +++ b/net/spdy/spdy_framer_test.cc @@ -11,7 +11,7 @@ #include "net/spdy/spdy_frame_builder.h" #include "testing/platform_test.h" -namespace spdy { +namespace net { namespace test { @@ -433,27 +433,9 @@ class TestSpdyVisitor : public SpdyFramerVisitorInterface { } // namespace test -} // namespace spdy - -using spdy::SpdyControlFlags; -using spdy::SpdyControlFrame; -using spdy::SpdyDataFrame; -using spdy::SpdyFrame; -using spdy::SpdyFrameBuilder; -using spdy::SpdyFramer; -using spdy::SpdyHeaderBlock; -using spdy::SpdySynStreamControlFrame; -using spdy::kControlFlagMask; -using spdy::kLengthMask; -using spdy::CONTROL_FLAG_NONE; -using spdy::DATA_FLAG_COMPRESSED; -using spdy::DATA_FLAG_FIN; -using spdy::SYN_STREAM; -using spdy::test::CompareCharArraysWithHexError; -using spdy::test::SpdyFramerTestUtil; -using spdy::test::TestSpdyVisitor; - -namespace spdy { +using test::CompareCharArraysWithHexError; +using test::SpdyFramerTestUtil; +using test::TestSpdyVisitor; TEST(SpdyFrameBuilderTest, WriteLimits) { SpdyFrameBuilder builder(kLengthMask + 4); @@ -523,9 +505,9 @@ class SpdyFramerTest return true; } - spdy::SpdySetting SpdySettingFromWireFormat(uint32 key, uint32 value) { - return spdy::SpdySetting( - spdy::SettingsFlagsAndId::FromWireFormat(spdy_version_, key), + SpdySetting SpdySettingFromWireFormat(uint32 key, uint32 value) { + return SpdySetting( + SettingsFlagsAndId::FromWireFormat(spdy_version_, key), value); } @@ -2645,4 +2627,4 @@ TEST_P(SpdyFramerTest, SettingsFlagsAndId) { EXPECT_EQ(kWireFormat, id_and_flags.GetWireFormat(spdy_version_)); } -} // namespace +} // namespace net diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc index a23a060d..b796e68 100644 --- a/net/spdy/spdy_http_stream.cc +++ b/net/spdy/spdy_http_stream.cc @@ -196,7 +196,7 @@ int SpdyHttpStream::SendRequest(const HttpRequestHeaders& request_headers, stream_->SetDelegate(this); - linked_ptr<spdy::SpdyHeaderBlock> headers(new spdy::SpdyHeaderBlock); + linked_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock); CreateSpdyHeadersFromHttpRequest(*request_info_, request_headers, headers.get(), stream_->GetProtocolVersion(), direct_); @@ -294,7 +294,7 @@ int SpdyHttpStream::OnSendBody() { return stream_->WriteStreamData( request_body_buf_, request_body_buf_->BytesRemaining(), - eof ? spdy::DATA_FLAG_FIN : spdy::DATA_FLAG_NONE); + eof ? DATA_FLAG_FIN : DATA_FLAG_NONE); } int SpdyHttpStream::OnSendBodyComplete(int status, bool* eof) { @@ -329,7 +329,7 @@ int SpdyHttpStream::OnSendBodyComplete(int status, bool* eof) { return OK; } -int SpdyHttpStream::OnResponseReceived(const spdy::SpdyHeaderBlock& response, +int SpdyHttpStream::OnResponseReceived(const SpdyHeaderBlock& response, base::Time response_time, int status) { if (!response_info_) { diff --git a/net/spdy/spdy_http_stream.h b/net/spdy/spdy_http_stream.h index b4b644d..e3f5132 100644 --- a/net/spdy/spdy_http_stream.h +++ b/net/spdy/spdy_http_stream.h @@ -77,7 +77,7 @@ class NET_EXPORT_PRIVATE SpdyHttpStream : public SpdyStream::Delegate, virtual bool OnSendHeadersComplete(int status) OVERRIDE; virtual int OnSendBody() OVERRIDE; virtual int OnSendBodyComplete(int status, bool* eof) OVERRIDE; - virtual int OnResponseReceived(const spdy::SpdyHeaderBlock& response, + virtual int OnResponseReceived(const SpdyHeaderBlock& response, base::Time response_time, int status) OVERRIDE; virtual void OnDataReceived(const char* buffer, int bytes) OVERRIDE; diff --git a/net/spdy/spdy_http_stream_spdy2_unittest.cc b/net/spdy/spdy_http_stream_spdy2_unittest.cc index b7704a8..b45de55 100644 --- a/net/spdy/spdy_http_stream_spdy2_unittest.cc +++ b/net/spdy/spdy_http_stream_spdy2_unittest.cc @@ -70,11 +70,11 @@ class SpdyHttpStreamSpdy2Test : public testing::Test { }; TEST_F(SpdyHttpStreamSpdy2Test, SendRequest) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req.get(), 1), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp, 2), MockRead(SYNCHRONOUS, 0, 3) // EOF @@ -118,15 +118,15 @@ TEST_F(SpdyHttpStreamSpdy2Test, SendRequest) { TEST_F(SpdyHttpStreamSpdy2Test, SendChunkedPost) { UploadDataStream::set_merge_chunks(false); - scoped_ptr<spdy::SpdyFrame> req(ConstructChunkedSpdyPost(NULL, 0)); - scoped_ptr<spdy::SpdyFrame> chunk1(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> chunk2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructChunkedSpdyPost(NULL, 0)); + scoped_ptr<SpdyFrame> chunk1(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> chunk2(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*req.get(), 1), CreateMockWrite(*chunk1, 2), // POST upload frames CreateMockWrite(*chunk2, 3), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); MockRead reads[] = { CreateMockRead(*resp, 4), CreateMockRead(*chunk1, 5), @@ -180,11 +180,11 @@ TEST_F(SpdyHttpStreamSpdy2Test, SendChunkedPost) { TEST_F(SpdyHttpStreamSpdy2Test, SpdyURLTest) { const char * const full_url = "http://www.google.com/foo?query=what#anchor"; const char * const base_url = "http://www.google.com/foo?query=what"; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(base_url, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(base_url, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req.get(), 1), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp, 2), MockRead(SYNCHRONOUS, 0, 3) // EOF @@ -210,7 +210,7 @@ TEST_F(SpdyHttpStreamSpdy2Test, SpdyURLTest) { EXPECT_EQ(ERR_IO_PENDING, http_stream->SendRequest(headers, NULL, &response, callback.callback())); - spdy::SpdyHeaderBlock* spdy_header = + SpdyHeaderBlock* spdy_header = http_stream->stream()->spdy_headers().get(); EXPECT_TRUE(spdy_header != NULL); if (spdy_header->find("url") != spdy_header->end()) diff --git a/net/spdy/spdy_http_stream_spdy3_unittest.cc b/net/spdy/spdy_http_stream_spdy3_unittest.cc index a42050d..92ebf4a 100644 --- a/net/spdy/spdy_http_stream_spdy3_unittest.cc +++ b/net/spdy/spdy_http_stream_spdy3_unittest.cc @@ -76,11 +76,11 @@ class SpdyHttpStreamSpdy3Test : public testing::Test { }; TEST_F(SpdyHttpStreamSpdy3Test, SendRequest) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req.get(), 1), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp, 2), MockRead(SYNCHRONOUS, 0, 3) // EOF @@ -124,15 +124,15 @@ TEST_F(SpdyHttpStreamSpdy3Test, SendRequest) { TEST_F(SpdyHttpStreamSpdy3Test, SendChunkedPost) { UploadDataStream::set_merge_chunks(false); - scoped_ptr<spdy::SpdyFrame> req(ConstructChunkedSpdyPost(NULL, 0)); - scoped_ptr<spdy::SpdyFrame> chunk1(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> chunk2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructChunkedSpdyPost(NULL, 0)); + scoped_ptr<SpdyFrame> chunk1(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> chunk2(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*req.get(), 1), CreateMockWrite(*chunk1, 2), // POST upload frames CreateMockWrite(*chunk2, 3), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); MockRead reads[] = { CreateMockRead(*resp, 4), CreateMockRead(*chunk1, 5), @@ -186,11 +186,11 @@ TEST_F(SpdyHttpStreamSpdy3Test, SendChunkedPost) { TEST_F(SpdyHttpStreamSpdy3Test, SpdyURLTest) { const char * const full_url = "http://www.google.com/foo?query=what#anchor"; const char * const base_url = "http://www.google.com/foo?query=what"; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(base_url, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(base_url, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req.get(), 1), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp, 2), MockRead(SYNCHRONOUS, 0, 3) // EOF @@ -216,7 +216,7 @@ TEST_F(SpdyHttpStreamSpdy3Test, SpdyURLTest) { EXPECT_EQ(ERR_IO_PENDING, http_stream->SendRequest(headers, NULL, &response, callback.callback())); - spdy::SpdyHeaderBlock* spdy_header = + SpdyHeaderBlock* spdy_header = http_stream->stream()->spdy_headers().get(); EXPECT_TRUE(spdy_header != NULL); if (spdy_header->find(":path") != spdy_header->end()) @@ -291,14 +291,14 @@ void SpdyHttpStreamSpdy3Test::TestSendCredentials( const std::string& cert, const std::string& proof, SSLClientCertType type) { - spdy::SpdyCredential cred; + SpdyCredential cred; cred.slot = 1; cred.proof = proof; cred.certs.push_back(cert); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> credential(ConstructSpdyCredential(cred)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet("http://www.gmail.com", + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> credential(ConstructSpdyCredential(cred)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet("http://www.gmail.com", false, 3, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req.get(), 0), @@ -306,8 +306,8 @@ void SpdyHttpStreamSpdy3Test::TestSendCredentials( CreateMockWrite(*req2.get(), 3), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); MockRead reads[] = { CreateMockRead(*resp, 1), CreateMockRead(*resp2, 4), diff --git a/net/spdy/spdy_http_utils.cc b/net/spdy/spdy_http_utils.cc index 414c1e42..14993a0 100644 --- a/net/spdy/spdy_http_utils.cc +++ b/net/spdy/spdy_http_utils.cc @@ -19,13 +19,13 @@ namespace net { -bool SpdyHeadersToHttpResponse(const spdy::SpdyHeaderBlock& headers, +bool SpdyHeadersToHttpResponse(const SpdyHeaderBlock& headers, HttpResponseInfo* response) { std::string version; std::string status; // The "status" and "version" headers are required. - spdy::SpdyHeaderBlock::const_iterator it; + SpdyHeaderBlock::const_iterator it; it = headers.find("status"); if (it == headers.end()) return false; @@ -77,7 +77,7 @@ bool SpdyHeadersToHttpResponse(const spdy::SpdyHeaderBlock& headers, void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info, const HttpRequestHeaders& request_headers, - spdy::SpdyHeaderBlock* headers, + SpdyHeaderBlock* headers, int protocol_version, bool direct) { diff --git a/net/spdy/spdy_http_utils.h b/net/spdy/spdy_http_utils.h index 0361fb8..3abe269 100644 --- a/net/spdy/spdy_http_utils.h +++ b/net/spdy/spdy_http_utils.h @@ -21,14 +21,14 @@ class HttpRequestHeaders; // |info| output parameter for the HttpResponseInfo. // Returns true if successfully converted. False if the SpdyHeaderBlock is // incomplete (e.g. missing 'status' or 'version'). -bool SpdyHeadersToHttpResponse(const spdy::SpdyHeaderBlock& headers, +bool SpdyHeadersToHttpResponse(const SpdyHeaderBlock& headers, HttpResponseInfo* response); // Create a SpdyHeaderBlock for a Spdy SYN_STREAM Frame from // HttpRequestInfo and HttpRequestHeaders. void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info, const HttpRequestHeaders& request_headers, - spdy::SpdyHeaderBlock* headers, + SpdyHeaderBlock* headers, int protocol_version, bool direct); diff --git a/net/spdy/spdy_network_transaction_spdy21_unittest.cc b/net/spdy/spdy_network_transaction_spdy21_unittest.cc index efae94b..18968a1 100644 --- a/net/spdy/spdy_network_transaction_spdy21_unittest.cc +++ b/net/spdy/spdy_network_transaction_spdy21_unittest.cc @@ -544,11 +544,11 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, Constructor) { TEST_P(SpdyNetworkTransactionSpdy21Test, Get) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -571,10 +571,10 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, GetAtEachPriority) { for (RequestPriority p = HIGHEST; p < NUM_PRIORITIES; p = RequestPriority(p+1)) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, p)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, p)); MockWrite writes[] = { CreateMockWrite(*req) }; - const int spdy_prio = reinterpret_cast<spdy::SpdySynStreamControlFrame*>( + const int spdy_prio = reinterpret_cast<SpdySynStreamControlFrame*>( req.get())->priority(); // this repeats the RequestPriority-->SpdyPriority mapping from // SpdyFramer::ConvertRequestPriorityToSpdyPriority to make @@ -597,8 +597,8 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, GetAtEachPriority) { FAIL(); } - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -631,20 +631,20 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, GetAtEachPriority) { // can allow multiple streams in flight. TEST_P(SpdyNetworkTransactionSpdy21Test, ThreeGets) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); - scoped_ptr<spdy::SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 5)); - scoped_ptr<spdy::SpdyFrame> body3(ConstructSpdyBodyFrame(5, false)); - scoped_ptr<spdy::SpdyFrame> fbody3(ConstructSpdyBodyFrame(5, true)); + scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, LOWEST)); + scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 5)); + scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(5, false)); + scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(5, true)); MockWrite writes[] = { CreateMockWrite(*req), @@ -726,15 +726,15 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ThreeGets) { } TEST_P(SpdyNetworkTransactionSpdy21Test, TwoGetsLateBinding) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); MockWrite writes[] = { CreateMockWrite(*req), @@ -813,15 +813,15 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, TwoGetsLateBinding) { } TEST_P(SpdyNetworkTransactionSpdy21Test, TwoGetsLateBindingFromPreconnect) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); MockWrite writes[] = { CreateMockWrite(*req), @@ -919,27 +919,27 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, TwoGetsLateBindingFromPreconnect) { // second transaction completes, so we can assert on read_index(). TEST_P(SpdyNetworkTransactionSpdy21Test, ThreeGetsWithMaxConcurrent) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); - - scoped_ptr<spdy::SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 5)); - scoped_ptr<spdy::SpdyFrame> body3(ConstructSpdyBodyFrame(5, false)); - scoped_ptr<spdy::SpdyFrame> fbody3(ConstructSpdyBodyFrame(5, true)); - - spdy::SpdySettings settings; - spdy::SettingsFlagsAndId id(0, spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + + scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, LOWEST)); + scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 5)); + scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(5, false)); + scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(5, true)); + + SpdySettings settings; + SettingsFlagsAndId id(0, SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 1; - settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); - scoped_ptr<spdy::SpdyFrame> settings_frame(ConstructSpdySettings(settings)); + settings.push_back(SpdySetting(id, max_concurrent_streams)); + scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); MockWrite writes[] = { CreateMockWrite(*req), @@ -1051,33 +1051,33 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ThreeGetsWithMaxConcurrent) { // the response from the server. TEST_P(SpdyNetworkTransactionSpdy21Test, FourGetsWithMaxConcurrentPriority) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); - scoped_ptr<spdy::SpdyFrame> req4( + scoped_ptr<SpdyFrame> req4( ConstructSpdyGet(NULL, 0, false, 5, HIGHEST)); - scoped_ptr<spdy::SpdyFrame> resp4(ConstructSpdyGetSynReply(NULL, 0, 5)); - scoped_ptr<spdy::SpdyFrame> fbody4(ConstructSpdyBodyFrame(5, true)); + scoped_ptr<SpdyFrame> resp4(ConstructSpdyGetSynReply(NULL, 0, 5)); + scoped_ptr<SpdyFrame> fbody4(ConstructSpdyBodyFrame(5, true)); - scoped_ptr<spdy::SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 7, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 7)); - scoped_ptr<spdy::SpdyFrame> body3(ConstructSpdyBodyFrame(7, false)); - scoped_ptr<spdy::SpdyFrame> fbody3(ConstructSpdyBodyFrame(7, true)); + scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 7, LOWEST)); + scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 7)); + scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(7, false)); + scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(7, true)); - spdy::SpdySettings settings; - spdy::SettingsFlagsAndId id(0, spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + SpdySettings settings; + SettingsFlagsAndId id(0, SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 1; - settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); - scoped_ptr<spdy::SpdyFrame> settings_frame(ConstructSpdySettings(settings)); + settings.push_back(SpdySetting(id, max_concurrent_streams)); + scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*req2), @@ -1206,22 +1206,22 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, FourGetsWithMaxConcurrentPriority) { // the spdy_session TEST_P(SpdyNetworkTransactionSpdy21Test, ThreeGetsWithMaxConcurrentDelete) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); - - spdy::SpdySettings settings; - spdy::SettingsFlagsAndId id(0, spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + + SpdySettings settings; + SettingsFlagsAndId id(0, SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 1; - settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); - scoped_ptr<spdy::SpdyFrame> settings_frame(ConstructSpdySettings(settings)); + settings.push_back(SpdySetting(id, max_concurrent_streams)); + scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*req2), @@ -1344,20 +1344,20 @@ class KillerCallback : public TestCompletionCallbackBase { TEST_P(SpdyNetworkTransactionSpdy21Test, ThreeGetsWithMaxConcurrentSocketClose) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fin_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fin_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - spdy::SpdySettings settings; - spdy::SettingsFlagsAndId id(0, spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + SpdySettings settings; + SettingsFlagsAndId id(0, SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 1; - settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); - scoped_ptr<spdy::SpdyFrame> settings_frame(ConstructSpdySettings(settings)); + settings.push_back(SpdySetting(id, max_concurrent_streams)); + scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*req2), @@ -1442,16 +1442,16 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, Put) { request.url = GURL("http://www.google.com/"); const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_STREAM, // Kind = Syn + SYN_STREAM, // Kind = Syn 1, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_FIN, // Control Flags + CONTROL_FLAG_FIN, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; const char* const kPutHeaders[] = { "method", "PUT", @@ -1461,31 +1461,31 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, Put) { "version", "HTTP/1.1", "content-length", "0" }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPacket(kSynStartHeader, NULL, 0, + scoped_ptr<SpdyFrame> req(ConstructSpdyPacket(kSynStartHeader, NULL, 0, kPutHeaders, arraysize(kPutHeaders) / 2)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); const SpdyHeaderInfo kSynReplyHeader = { - spdy::SYN_REPLY, // Kind = SynReply + SYN_REPLY, // Kind = SynReply 1, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; static const char* const kStandardGetHeaders[] = { "status", "200", "version", "HTTP/1.1" "content-length", "1234" }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPacket(kSynReplyHeader, + scoped_ptr<SpdyFrame> resp(ConstructSpdyPacket(kSynReplyHeader, NULL, 0, kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); MockRead reads[] = { CreateMockRead(*resp), @@ -1513,16 +1513,16 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, Head) { request.url = GURL("http://www.google.com/"); const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_STREAM, // Kind = Syn + SYN_STREAM, // Kind = Syn 1, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_FIN, // Control Flags + CONTROL_FLAG_FIN, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; const char* const kHeadHeaders[] = { "method", "HEAD", @@ -1532,31 +1532,31 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, Head) { "version", "HTTP/1.1", "content-length", "0" }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPacket(kSynStartHeader, NULL, 0, + scoped_ptr<SpdyFrame> req(ConstructSpdyPacket(kSynStartHeader, NULL, 0, kHeadHeaders, arraysize(kHeadHeaders) / 2)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); const SpdyHeaderInfo kSynReplyHeader = { - spdy::SYN_REPLY, // Kind = SynReply + SYN_REPLY, // Kind = SynReply 1, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; static const char* const kStandardGetHeaders[] = { "status", "200", "version", "HTTP/1.1" "content-length", "1234" }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPacket(kSynReplyHeader, + scoped_ptr<SpdyFrame> resp(ConstructSpdyPacket(kSynReplyHeader, NULL, 0, kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); MockRead reads[] = { CreateMockRead(*resp), @@ -1578,14 +1578,14 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, Head) { // Test that a simple POST works. TEST_P(SpdyNetworkTransactionSpdy21Test, Post) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPost(kUploadDataSize, NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyPost(kUploadDataSize, NULL, 0)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*body), // POST upload frame }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -1607,16 +1607,16 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, Post) { // Test that a chunked POST works. TEST_P(SpdyNetworkTransactionSpdy21Test, ChunkedPost) { UploadDataStream::set_merge_chunks(false); - scoped_ptr<spdy::SpdyFrame> req(ConstructChunkedSpdyPost(NULL, 0)); - scoped_ptr<spdy::SpdyFrame> chunk1(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> chunk2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructChunkedSpdyPost(NULL, 0)); + scoped_ptr<SpdyFrame> chunk1(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> chunk2(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*chunk1), CreateMockWrite(*chunk2), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*chunk1), @@ -1647,15 +1647,15 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, NullPost) { // When request.upload_data is NULL for post, content-length is // expected to be 0. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPost(0, NULL, 0)); + scoped_ptr<SpdyFrame> req(ConstructSpdyPost(0, NULL, 0)); // Set the FIN bit since there will be no body. - req->set_flags(spdy::CONTROL_FLAG_FIN); + req->set_flags(CONTROL_FLAG_FIN); MockWrite writes[] = { CreateMockWrite(*req), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -1692,17 +1692,17 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, EmptyPost) { ASSERT_EQ(request.upload_data->GetContentLengthSync(), stream->size()); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> req(ConstructSpdyPost( request.upload_data->GetContentLengthSync(), NULL, 0)); // Set the FIN bit since there will be no body. - req->set_flags(spdy::CONTROL_FLAG_FIN); + req->set_flags(CONTROL_FLAG_FIN); MockWrite writes[] = { CreateMockWrite(*req), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -1740,8 +1740,8 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, PostWithEarlySynReply) { ASSERT_EQ(OK, stream->Init()); ASSERT_EQ(request.upload_data->GetContentLengthSync(), stream->size()); - scoped_ptr<spdy::SpdyFrame> stream_reply(ConstructSpdyPostSynReply(NULL, 0)); - scoped_ptr<spdy::SpdyFrame> stream_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> stream_reply(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> stream_body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream_reply, 2), CreateMockRead(*stream_body, 3), @@ -1765,16 +1765,16 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, PostWithEarlySynReply) { // socket causes the TCP write to return zero. This test checks that the client // tries to queue up the RST_STREAM frame again. TEST_P(SpdyNetworkTransactionSpdy21Test, SocketWriteReturnsZero) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> rst( - ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(1, CANCEL)); MockWrite writes[] = { CreateMockWrite(*req.get(), 0, SYNCHRONOUS), MockWrite(SYNCHRONOUS, 0, 0, 2), CreateMockWrite(*rst.get(), 3, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp.get(), 1, ASYNC), MockRead(ASYNC, 0, 0, 4) // EOF @@ -1806,7 +1806,7 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SocketWriteReturnsZero) { // Test that the transaction doesn't crash when we don't have a reply. TEST_P(SpdyNetworkTransactionSpdy21Test, ResponseWithoutSynReply) { - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*body), MockRead(ASYNC, 0, 0) // EOF @@ -1824,11 +1824,11 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ResponseWithoutSynReply) { // Test that the transaction doesn't crash when we get two replies on the same // stream ID. See http://crbug.com/45639. TEST_P(SpdyNetworkTransactionSpdy21Test, ResponseWithTwoSynReplies) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*resp), @@ -1889,11 +1889,11 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, WindowUpdateReceived) { static int kFrameCount = 2; scoped_ptr<std::string> content( new std::string(kMaxSpdyFrameChunkSize, 'a')); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPost( + scoped_ptr<SpdyFrame> req(ConstructSpdyPost( kMaxSpdyFrameChunkSize * kFrameCount, NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body( + scoped_ptr<SpdyFrame> body( ConstructSpdyBodyFrame(1, content->c_str(), content->size(), false)); - scoped_ptr<spdy::SpdyFrame> body_end( + scoped_ptr<SpdyFrame> body_end( ConstructSpdyBodyFrame(1, content->c_str(), content->size(), true)); MockWrite writes[] = { @@ -1904,11 +1904,11 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, WindowUpdateReceived) { static const int32 kDeltaWindowSize = 0xff; static const int kDeltaCount = 4; - scoped_ptr<spdy::SpdyFrame> window_update( + scoped_ptr<SpdyFrame> window_update( ConstructSpdyWindowUpdate(1, kDeltaWindowSize)); - scoped_ptr<spdy::SpdyFrame> window_update_dummy( + scoped_ptr<SpdyFrame> window_update_dummy( ConstructSpdyWindowUpdate(2, kDeltaWindowSize)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); MockRead reads[] = { CreateMockRead(*window_update_dummy), CreateMockRead(*window_update_dummy), @@ -1950,7 +1950,7 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, WindowUpdateReceived) { SpdyHttpStream* stream = static_cast<SpdyHttpStream*>(trans->stream_.get()); ASSERT_TRUE(stream != NULL); ASSERT_TRUE(stream->stream() != NULL); - EXPECT_EQ(static_cast<int>(spdy::kSpdyStreamInitialWindowSize) + + EXPECT_EQ(static_cast<int>(kSpdyStreamInitialWindowSize) + kDeltaWindowSize * kDeltaCount - kMaxSpdyFrameChunkSize * kFrameCount, stream->stream()->send_window_size()); @@ -1960,8 +1960,8 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, WindowUpdateReceived) { // Test that received data frames and sent WINDOW_UPDATE frames change // the recv_window_size_ correctly. TEST_P(SpdyNetworkTransactionSpdy21Test, WindowUpdateSent) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> window_update( + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> window_update( ConstructSpdyWindowUpdate(1, kUploadDataSize)); MockWrite writes[] = { @@ -1969,11 +1969,11 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, WindowUpdateSent) { CreateMockWrite(*window_update), }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body_no_fin( + scoped_ptr<SpdyFrame> body_no_fin( ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> body_fin( + scoped_ptr<SpdyFrame> body_fin( ConstructSpdyBodyFrame(1, NULL, 0, true)); MockRead reads[] = { CreateMockRead(*resp), @@ -2007,7 +2007,7 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, WindowUpdateSent) { ASSERT_TRUE(stream->stream() != NULL); EXPECT_EQ( - static_cast<int>(spdy::kSpdyStreamInitialWindowSize) - kUploadDataSize, + static_cast<int>(kSpdyStreamInitialWindowSize) - kUploadDataSize, stream->stream()->recv_window_size()); const HttpResponseInfo* response = trans->GetResponseInfo(); @@ -2050,12 +2050,12 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, WindowUpdateOverflow) { scoped_ptr<std::string> content( new std::string(kMaxSpdyFrameChunkSize, 'a')); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPost( + scoped_ptr<SpdyFrame> req(ConstructSpdyPost( kMaxSpdyFrameChunkSize * kFrameCount, NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body( + scoped_ptr<SpdyFrame> body( ConstructSpdyBodyFrame(1, content->c_str(), content->size(), false)); - scoped_ptr<spdy::SpdyFrame> rst( - ConstructSpdyRstStream(1, spdy::FLOW_CONTROL_ERROR)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(1, FLOW_CONTROL_ERROR)); // We're not going to write a data frame with FIN, we'll receive a bad // WINDOW_UPDATE while sending a request and will send a RST_STREAM frame. @@ -2066,11 +2066,11 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, WindowUpdateOverflow) { }; static const int32 kDeltaWindowSize = 0x7fffffff; // cause an overflow - scoped_ptr<spdy::SpdyFrame> window_update( + scoped_ptr<SpdyFrame> window_update( ConstructSpdyWindowUpdate(1, kDeltaWindowSize)); - scoped_ptr<spdy::SpdyFrame> window_update2( + scoped_ptr<SpdyFrame> window_update2( ConstructSpdyWindowUpdate(2, kDeltaWindowSize)); - scoped_ptr<spdy::SpdyFrame> reply(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> reply(ConstructSpdyPostSynReply(NULL, 0)); MockRead reads[] = { CreateMockRead(*window_update2), @@ -2137,29 +2137,29 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, FlowControlStallResume) { // data frame that we will send once the WINDOW_UPDATE is received, // therefore +3. size_t nwrites = - spdy::kSpdyStreamInitialWindowSize / kMaxSpdyFrameChunkSize + 3; + kSpdyStreamInitialWindowSize / kMaxSpdyFrameChunkSize + 3; // Calculate last frame's size; 0 size data frame is legal. size_t last_frame_size = - spdy::kSpdyStreamInitialWindowSize % kMaxSpdyFrameChunkSize; + kSpdyStreamInitialWindowSize % kMaxSpdyFrameChunkSize; // Construct content for a data frame of maximum size. scoped_ptr<std::string> content( new std::string(kMaxSpdyFrameChunkSize, 'a')); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPost( - spdy::kSpdyStreamInitialWindowSize + kUploadDataSize, NULL, 0)); + scoped_ptr<SpdyFrame> req(ConstructSpdyPost( + kSpdyStreamInitialWindowSize + kUploadDataSize, NULL, 0)); // Full frames. - scoped_ptr<spdy::SpdyFrame> body1( + scoped_ptr<SpdyFrame> body1( ConstructSpdyBodyFrame(1, content->c_str(), content->size(), false)); // Last frame to zero out the window size. - scoped_ptr<spdy::SpdyFrame> body2( + scoped_ptr<SpdyFrame> body2( ConstructSpdyBodyFrame(1, content->c_str(), last_frame_size, false)); // Data frame to be sent once WINDOW_UPDATE frame is received. - scoped_ptr<spdy::SpdyFrame> body3(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(1, true)); // Fill in mock writes. scoped_array<MockWrite> writes(new MockWrite[nwrites]); @@ -2172,9 +2172,9 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, FlowControlStallResume) { // Construct read frame, give enough space to upload the rest of the // data. - scoped_ptr<spdy::SpdyFrame> window_update( + scoped_ptr<SpdyFrame> window_update( ConstructSpdyWindowUpdate(1, kUploadDataSize)); - scoped_ptr<spdy::SpdyFrame> reply(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> reply(ConstructSpdyPostSynReply(NULL, 0)); MockRead reads[] = { CreateMockRead(*window_update), CreateMockRead(*window_update), @@ -2195,7 +2195,7 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, FlowControlStallResume) { request.url = GURL("http://www.google.com/"); request.upload_data = new UploadData(); scoped_ptr<std::string> upload_data( - new std::string(spdy::kSpdyStreamInitialWindowSize, 'a')); + new std::string(kSpdyStreamInitialWindowSize, 'a')); upload_data->append(kUploadData, kUploadDataSize); request.upload_data->AppendBytes(upload_data->c_str(), upload_data->size()); NormalSpdyTransactionHelper helper(request, @@ -2229,12 +2229,12 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, FlowControlStallResume) { TEST_P(SpdyNetworkTransactionSpdy21Test, CancelledTransaction) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), // This following read isn't used by the test, except during the @@ -2267,15 +2267,15 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, CancelledTransaction) { // Verify that the client sends a Rst Frame upon cancelling the stream. TEST_P(SpdyNetworkTransactionSpdy21Test, CancelledTransactionSendRst) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> rst( - ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(1, CANCEL)); MockWrite writes[] = { CreateMockWrite(*req, 0, SYNCHRONOUS), CreateMockWrite(*rst, 2, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 0, 3) // EOF @@ -2312,7 +2312,7 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, CancelledTransactionSendRst) { // to start another transaction on a session that is closing down. See // http://crbug.com/47455 TEST_P(SpdyNetworkTransactionSpdy21Test, StartTransactionOnReadCallback) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; MockWrite writes2[] = { CreateMockWrite(*req) }; @@ -2325,7 +2325,7 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, StartTransactionOnReadCallback) { 'h', 'e', 'l', 'l', 'o', '!', }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp, 2), MockRead(ASYNC, ERR_IO_PENDING, 3), // Force a pause @@ -2376,11 +2376,11 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, StartTransactionOnReadCallback) { // transaction. Failures will usually be valgrind errors. See // http://crbug.com/46925 TEST_P(SpdyNetworkTransactionSpdy21Test, DeleteSessionOnReadCallback) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp.get(), 2), MockRead(ASYNC, ERR_IO_PENDING, 3), // Force a pause @@ -2427,7 +2427,7 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, RedirectGetRequest) { "accept-encoding", "gzip,deflate", }; - const SpdyHeaderInfo kSynStartHeader = MakeSpdyHeader(spdy::SYN_STREAM); + const SpdyHeaderInfo kSynStartHeader = MakeSpdyHeader(SYN_STREAM); const char* const kStandardGetHeaders[] = { "host", "www.google.com", @@ -2458,13 +2458,13 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, RedirectGetRequest) { }; // Setup writes/reads to www.google.com - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPacket( + scoped_ptr<SpdyFrame> req(ConstructSpdyPacket( kSynStartHeader, kExtraHeaders, arraysize(kExtraHeaders) / 2, kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyPacket( + scoped_ptr<SpdyFrame> req2(ConstructSpdyPacket( kSynStartHeader, kExtraHeaders, arraysize(kExtraHeaders) / 2, kStandardGetHeaders2, arraysize(kStandardGetHeaders2) / 2)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReplyRedirect(1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReplyRedirect(1)); MockWrite writes[] = { CreateMockWrite(*req, 1), }; @@ -2474,8 +2474,8 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, RedirectGetRequest) { }; // Setup writes/reads to www.foo.com - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); MockWrite writes2[] = { CreateMockWrite(*req2, 1), }; @@ -2527,17 +2527,17 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, RedirectGetRequest) { // Detect response with upper case headers and reset the stream. TEST_P(SpdyNetworkTransactionSpdy21Test, UpperCaseHeaders) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> - rst(ConstructSpdyRstStream(1, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + rst(ConstructSpdyRstStream(1, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*syn, 0), CreateMockWrite(*rst, 2), }; const char* const kExtraHeaders[] = {"X-UpperCase", "yes"}; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> reply(ConstructSpdyGetSynReply(kExtraHeaders, 1, 1)); MockRead reads[] = { CreateMockRead(*reply, 1), @@ -2561,10 +2561,10 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, UpperCaseHeaders) { // Detect response with upper case headers in a HEADERS frame and reset the // stream. TEST_P(SpdyNetworkTransactionSpdy21Test, UpperCaseHeadersInHeadersFrame) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> - rst(ConstructSpdyRstStream(1, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + rst(ConstructSpdyRstStream(1, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*syn, 0), CreateMockWrite(*rst, 2), @@ -2577,29 +2577,29 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, UpperCaseHeadersInHeadersFrame) { static const char* const kLateHeaders[] = { "X-UpperCase", "yes", }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 1, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream1_reply), CreateMockRead(*stream1_headers), @@ -2619,21 +2619,21 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, UpperCaseHeadersInHeadersFrame) { // Detect push stream with upper case headers and reset the stream. TEST_P(SpdyNetworkTransactionSpdy21Test, UpperCaseHeadersOnPush) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> - rst(ConstructSpdyRstStream(2, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*syn, 0), CreateMockWrite(*rst, 2), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> reply(ConstructSpdyGetSynReply(NULL, 0, 1)); const char* const extra_headers[] = {"X-UpperCase", "yes"}; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> push(ConstructSpdyPush(extra_headers, 1, 2, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*reply, 1), CreateMockRead(*push, 1), @@ -2663,7 +2663,7 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, RedirectServerPush) { "accept-encoding", "gzip,deflate", }; - const SpdyHeaderInfo kSynStartHeader = MakeSpdyHeader(spdy::SYN_STREAM); + const SpdyHeaderInfo kSynStartHeader = MakeSpdyHeader(SYN_STREAM); const char* const kStandardGetHeaders[] = { "host", "www.google.com", @@ -2680,14 +2680,14 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, RedirectServerPush) { }; // Setup writes/reads to www.google.com - scoped_ptr<spdy::SpdyFrame> req( + scoped_ptr<SpdyFrame> req( ConstructSpdyPacket(kSynStartHeader, kExtraHeaders, arraysize(kExtraHeaders) / 2, kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> rep( + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> rep( ConstructSpdyPush(NULL, 0, 2, @@ -2695,8 +2695,8 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, RedirectServerPush) { "http://www.google.com/foo.dat", "301 Moved Permanently", "http://www.foo.com/index.php")); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> rst(ConstructSpdyRstStream(2, spdy::CANCEL)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(2, CANCEL)); MockWrite writes[] = { CreateMockWrite(*req, 1), CreateMockWrite(*rst, 6), @@ -2724,14 +2724,14 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, RedirectServerPush) { "version", "HTTP/1.1" }; - scoped_ptr<spdy::SpdyFrame> req2( + scoped_ptr<SpdyFrame> req2( ConstructSpdyPacket(kSynStartHeader, kExtraHeaders, arraysize(kExtraHeaders) / 2, kStandardGetHeaders2, arraysize(kStandardGetHeaders2) / 2)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); MockWrite writes2[] = { CreateMockWrite(*req2, 1), }; @@ -2799,17 +2799,17 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushSingleDataFrame) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -2852,17 +2852,17 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushBeforeSynReply) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -2905,21 +2905,21 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushSingleDataFrame2) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, 1, "http://www.google.com/foo.dat")); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), @@ -2953,24 +2953,24 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushSingleDataFrame2) { } TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushServerAborted) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, 1, "http://www.google.com/foo.dat")); - scoped_ptr<spdy::SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + stream2_rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), CreateMockRead(*stream2_syn, 3), @@ -3023,26 +3023,26 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushDuplicate) { 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> - stream3_rst(ConstructSpdyRstStream(4, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + stream3_rst(ConstructSpdyRstStream(4, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream3_rst, 5), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, 1, "http://www.google.com/foo.dat")); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream3_syn(ConstructSpdyPush(NULL, 0, 4, @@ -3090,17 +3090,17 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushMultipleDataFrame) { static const char kPushBodyFrame3[] = " hello"; static const char kPushBodyFrame4[] = " my baby"; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -3154,17 +3154,17 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, static const char kPushBodyFrame3[] = " hello"; static const char kPushBodyFrame4[] = " my baby"; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -3209,20 +3209,20 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, } TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushInvalidAssociatedStreamID0) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, spdy::INVALID_STREAM)); + scoped_ptr<SpdyFrame> + stream2_rst(ConstructSpdyRstStream(2, INVALID_STREAM)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream2_rst, 4), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -3271,20 +3271,20 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushInvalidAssociatedStreamID0) { } TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushInvalidAssociatedStreamID9) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, spdy::INVALID_ASSOCIATED_STREAM)); + scoped_ptr<SpdyFrame> + stream2_rst(ConstructSpdyRstStream(2, INVALID_ASSOCIATED_STREAM)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream2_rst, 4), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -3333,20 +3333,20 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushInvalidAssociatedStreamID9) { } TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushNoURL) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + stream2_rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream2_rst, 4), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, 1)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), @@ -3429,15 +3429,15 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SynReplyHeaders) { }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { - scoped_ptr<spdy::SpdyFrame> req( + scoped_ptr<SpdyFrame> req( ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdyGetSynReply(test_cases[i].extra_headers, test_cases[i].num_headers, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -3474,17 +3474,17 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SynReplyHeaders) { // through the HTTP layer, and the response matches the request. TEST_P(SpdyNetworkTransactionSpdy21Test, SynReplyHeadersVary) { static const SpdyHeaderInfo syn_reply_info = { - spdy::SYN_REPLY, // Syn Reply + SYN_REPLY, // Syn Reply 1, // Stream ID 0, // Associated Stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Data Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; // Modify the following data to change/add test cases: struct SynReplyTests { @@ -3559,7 +3559,7 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SynReplyHeadersVary) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> frame_req( + scoped_ptr<SpdyFrame> frame_req( ConstructSpdyGet(test_cases[i].extra_headers[0], test_cases[i].num_headers[0], false, 1, LOWEST)); @@ -3569,14 +3569,14 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SynReplyHeadersVary) { }; // Construct the reply. - scoped_ptr<spdy::SpdyFrame> frame_reply( + scoped_ptr<SpdyFrame> frame_reply( ConstructSpdyPacket(*test_cases[i].syn_reply, test_cases[i].extra_headers[1], test_cases[i].num_headers[1], NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*frame_reply), CreateMockRead(*body), @@ -3643,17 +3643,17 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SynReplyHeadersVary) { // Verify that we don't crash on invalid SynReply responses. TEST_P(SpdyNetworkTransactionSpdy21Test, InvalidSynReply) { const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_REPLY, // Kind = SynReply + SYN_REPLY, // Kind = SynReply 1, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; struct InvalidSynReplyTests { @@ -3681,18 +3681,18 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, InvalidSynReply) { }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { - scoped_ptr<spdy::SpdyFrame> req( + scoped_ptr<SpdyFrame> req( ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req), }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdyPacket(kSynStartHeader, NULL, 0, test_cases[i].headers, test_cases[i].num_headers)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -3713,25 +3713,25 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, InvalidSynReply) { // Verify that we don't crash on some corrupt frames. TEST_P(SpdyNetworkTransactionSpdy21Test, CorruptFrameSessionError) { // This is the length field that's too short. - scoped_ptr<spdy::SpdyFrame> syn_reply_wrong_length( + scoped_ptr<SpdyFrame> syn_reply_wrong_length( ConstructSpdyGetSynReply(NULL, 0, 1)); syn_reply_wrong_length->set_length(syn_reply_wrong_length->length() - 4); struct SynReplyTests { - const spdy::SpdyFrame* syn_reply; + const SpdyFrame* syn_reply; } test_cases[] = { { syn_reply_wrong_length.get(), }, }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { - scoped_ptr<spdy::SpdyFrame> req( + scoped_ptr<SpdyFrame> req( ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req), MockWrite(ASYNC, 0, 0) // EOF }; - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*test_cases[i].syn_reply), CreateMockRead(*body), @@ -3751,7 +3751,7 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, CorruptFrameSessionError) { // Test that we shutdown correctly on write errors. TEST_P(SpdyNetworkTransactionSpdy21Test, WriteError) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { // We'll write 10 bytes successfully MockWrite(ASYNC, req->data(), 10), @@ -3773,12 +3773,12 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, WriteError) { // Test that partial writes work. TEST_P(SpdyNetworkTransactionSpdy21Test, PartialWrite) { // Chop the SYN_STREAM frame into 5 chunks. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); const int kChunks = 5; scoped_array<MockWrite> writes(ChopWriteFrame(*req.get(), kChunks)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -3801,18 +3801,18 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, PartialWrite) { // the server. Verify that teardown is all clean. TEST_P(SpdyNetworkTransactionSpdy21Test, DecompressFailureOnSynReply) { // For this test, we turn on the normal compression. - spdy::SpdyFramer::set_enable_compression_default(true); + SpdyFramer::set_enable_compression_default(true); - scoped_ptr<spdy::SpdyFrame> compressed( + scoped_ptr<SpdyFrame> compressed( ConstructSpdyGet(NULL, 0, true, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> rst( - ConstructSpdyRstStream(1, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(1, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*compressed), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), }; @@ -3833,12 +3833,12 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, NetLog) { static const char* const kExtraHeaders[] = { "user-agent", "Chrome", }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(kExtraHeaders, 1, false, 1, + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(kExtraHeaders, 1, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -3894,10 +3894,10 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, NetLog) { CapturingNetLog::Entry entry = entries[pos]; NetLogSpdySynParameter* request_params = static_cast<NetLogSpdySynParameter*>(entry.extra_parameters.get()); - spdy::SpdyHeaderBlock* headers = + SpdyHeaderBlock* headers = request_params->GetHeaders().get(); - spdy::SpdyHeaderBlock expected; + SpdyHeaderBlock expected; expected["host"] = "www.google.com"; expected["url"] = "/"; expected["scheme"] = "http"; @@ -3905,8 +3905,8 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, NetLog) { expected["method"] = "GET"; expected["user-agent"] = "Chrome"; EXPECT_EQ(expected.size(), headers->size()); - spdy::SpdyHeaderBlock::const_iterator end = expected.end(); - for (spdy::SpdyHeaderBlock::const_iterator it = expected.begin(); + SpdyHeaderBlock::const_iterator end = expected.end(); + for (SpdyHeaderBlock::const_iterator it = expected.begin(); it != end; ++it) { EXPECT_EQ(it->second, (*headers)[it->first]); @@ -3918,17 +3918,17 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, NetLog) { // on the network, but issued a Read for only 5 of those bytes) that the data // flow still works correctly. TEST_P(SpdyNetworkTransactionSpdy21Test, BufferFull) { - spdy::BufferedSpdyFramer framer(2); + BufferedSpdyFramer framer(2); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // 2 data frames in a single read. - scoped_ptr<spdy::SpdyFrame> data_frame_1( - framer.CreateDataFrame(1, "goodby", 6, spdy::DATA_FLAG_NONE)); - scoped_ptr<spdy::SpdyFrame> data_frame_2( - framer.CreateDataFrame(1, "e worl", 6, spdy::DATA_FLAG_NONE)); - const spdy::SpdyFrame* data_frames[2] = { + scoped_ptr<SpdyFrame> data_frame_1( + framer.CreateDataFrame(1, "goodby", 6, DATA_FLAG_NONE)); + scoped_ptr<SpdyFrame> data_frame_2( + framer.CreateDataFrame(1, "e worl", 6, DATA_FLAG_NONE)); + const SpdyFrame* data_frames[2] = { data_frame_1.get(), data_frame_2.get(), }; @@ -3936,10 +3936,10 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, BufferFull) { int combined_data_frames_len = CombineFrames(data_frames, arraysize(data_frames), combined_data_frames, arraysize(combined_data_frames)); - scoped_ptr<spdy::SpdyFrame> last_frame( - framer.CreateDataFrame(1, "d", 1, spdy::DATA_FLAG_FIN)); + scoped_ptr<SpdyFrame> last_frame( + framer.CreateDataFrame(1, "d", 1, DATA_FLAG_FIN)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), MockRead(ASYNC, ERR_IO_PENDING), // Force a pause @@ -4013,17 +4013,17 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, BufferFull) { // at the same time, ensure that we don't notify a read completion for // each data frame individually. TEST_P(SpdyNetworkTransactionSpdy21Test, Buffering) { - spdy::BufferedSpdyFramer framer(2); + BufferedSpdyFramer framer(2); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // 4 data frames in a single read. - scoped_ptr<spdy::SpdyFrame> data_frame( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_NONE)); - scoped_ptr<spdy::SpdyFrame> data_frame_fin( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_FIN)); - const spdy::SpdyFrame* data_frames[4] = { + scoped_ptr<SpdyFrame> data_frame( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_NONE)); + scoped_ptr<SpdyFrame> data_frame_fin( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_FIN)); + const SpdyFrame* data_frames[4] = { data_frame.get(), data_frame.get(), data_frame.get(), @@ -4034,7 +4034,7 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, Buffering) { CombineFrames(data_frames, arraysize(data_frames), combined_data_frames, arraysize(combined_data_frames)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), MockRead(ASYNC, ERR_IO_PENDING), // Force a pause @@ -4108,20 +4108,20 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, Buffering) { // Verify the case where we buffer data but read it after it has been buffered. TEST_P(SpdyNetworkTransactionSpdy21Test, BufferedAll) { - spdy::BufferedSpdyFramer framer(2); + BufferedSpdyFramer framer(2); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // 5 data frames in a single read. - scoped_ptr<spdy::SpdyFrame> syn_reply( + scoped_ptr<SpdyFrame> syn_reply( ConstructSpdyGetSynReply(NULL, 0, 1)); - syn_reply->set_flags(spdy::CONTROL_FLAG_NONE); // turn off FIN bit - scoped_ptr<spdy::SpdyFrame> data_frame( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_NONE)); - scoped_ptr<spdy::SpdyFrame> data_frame_fin( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_FIN)); - const spdy::SpdyFrame* frames[5] = { + syn_reply->set_flags(CONTROL_FLAG_NONE); // turn off FIN bit + scoped_ptr<SpdyFrame> data_frame( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_NONE)); + scoped_ptr<SpdyFrame> data_frame_fin( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_FIN)); + const SpdyFrame* frames[5] = { syn_reply.get(), data_frame.get(), data_frame.get(), @@ -4200,16 +4200,16 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, BufferedAll) { // Verify the case where we buffer data and close the connection. TEST_P(SpdyNetworkTransactionSpdy21Test, BufferedClosed) { - spdy::BufferedSpdyFramer framer(2); + BufferedSpdyFramer framer(2); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // All data frames in a single read. // NOTE: We don't FIN the stream. - scoped_ptr<spdy::SpdyFrame> data_frame( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_NONE)); - const spdy::SpdyFrame* data_frames[4] = { + scoped_ptr<SpdyFrame> data_frame( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_NONE)); + const SpdyFrame* data_frames[4] = { data_frame.get(), data_frame.get(), data_frame.get(), @@ -4219,7 +4219,7 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, BufferedClosed) { int combined_data_frames_len = CombineFrames(data_frames, arraysize(data_frames), combined_data_frames, arraysize(combined_data_frames)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), MockRead(ASYNC, ERR_IO_PENDING), // Force a wait @@ -4291,16 +4291,16 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, BufferedClosed) { // Verify the case where we buffer data and cancel the transaction. TEST_P(SpdyNetworkTransactionSpdy21Test, BufferedCancelled) { - spdy::BufferedSpdyFramer framer(2); + BufferedSpdyFramer framer(2); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // NOTE: We don't FIN the stream. - scoped_ptr<spdy::SpdyFrame> data_frame( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_NONE)); + scoped_ptr<SpdyFrame> data_frame( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_NONE)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), MockRead(ASYNC, ERR_IO_PENDING), // Force a wait @@ -4364,17 +4364,17 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, BufferedCancelled) { // the settings in the SpdySettingsStorage. TEST_P(SpdyNetworkTransactionSpdy21Test, SettingsSaved) { static const SpdyHeaderInfo kSynReplyInfo = { - spdy::SYN_REPLY, // Syn Reply + SYN_REPLY, // Syn Reply 1, // Stream ID 0, // Associated Stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Data Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; static const char* const kExtraHeaders[] = { "status", "200", @@ -4392,11 +4392,11 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SettingsSaved) { host_port_pair).empty()); // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // Construct the reply. - scoped_ptr<spdy::SpdyFrame> reply( + scoped_ptr<SpdyFrame> reply( ConstructSpdyPacket(kSynReplyInfo, kExtraHeaders, arraysize(kExtraHeaders) / 2, @@ -4409,25 +4409,25 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SettingsSaved) { unsigned int kSampleValue2 = 0x0b0b0b0b; unsigned int kSampleId3 = 0x3; unsigned int kSampleValue3 = 0x0c0c0c0c; - scoped_ptr<spdy::SpdyFrame> settings_frame; + scoped_ptr<SpdyFrame> settings_frame; { // Construct the SETTINGS frame. - spdy::SpdySettings settings; + SpdySettings settings; // First add a persisted setting - spdy::SettingsFlagsAndId setting1(spdy::SETTINGS_FLAG_PLEASE_PERSIST, + SettingsFlagsAndId setting1(SETTINGS_FLAG_PLEASE_PERSIST, kSampleId1); settings.push_back(std::make_pair(setting1, kSampleValue1)); // Next add a non-persisted setting - spdy::SettingsFlagsAndId setting2(0, kSampleId2); + SettingsFlagsAndId setting2(0, kSampleId2); settings.push_back(std::make_pair(setting2, kSampleValue2)); // Next add another persisted setting - spdy::SettingsFlagsAndId setting3(spdy::SETTINGS_FLAG_PLEASE_PERSIST, + SettingsFlagsAndId setting3(SETTINGS_FLAG_PLEASE_PERSIST, kSampleId3); settings.push_back(std::make_pair(setting3, kSampleValue3)); settings_frame.reset(ConstructSpdySettings(settings)); } - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*reply), CreateMockRead(*body), @@ -4450,22 +4450,22 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SettingsSaved) { #ifdef PERSIST_SPDY_SETTINGS { // Verify we had two persisted settings. - spdy::SpdySettings saved_settings = + SpdySettings saved_settings = spdy_session_pool->http_server_properties()->GetSpdySettings( host_port_pair); ASSERT_EQ(2u, saved_settings.size()); // Verify the first persisted setting. - spdy::SpdySetting setting = saved_settings.front(); + SpdySetting setting = saved_settings.front(); saved_settings.pop_front(); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, setting.first.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, setting.first.flags()); EXPECT_EQ(kSampleId1, setting.first.id()); EXPECT_EQ(kSampleValue1, setting.second); // Verify the second persisted setting. setting = saved_settings.front(); saved_settings.pop_front(); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, setting.first.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, setting.first.flags()); EXPECT_EQ(kSampleId3, setting.first.id()); EXPECT_EQ(kSampleValue3, setting.second); } @@ -4476,17 +4476,17 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SettingsSaved) { // server upon session establishment. TEST_P(SpdyNetworkTransactionSpdy21Test, SettingsPlayback) { static const SpdyHeaderInfo kSynReplyInfo = { - spdy::SYN_REPLY, // Syn Reply + SYN_REPLY, // Syn Reply 1, // Stream ID 0, // Associated Stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Data Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; static const char* kExtraHeaders[] = { "status", "200", @@ -4509,13 +4509,13 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SettingsPlayback) { unsigned int kSampleValue2 = 0x0c0c0c0c; // Manually insert settings into the SpdySettingsStorage here. { - spdy::SpdySettings settings; + SpdySettings settings; // First add a persisted setting - spdy::SettingsFlagsAndId setting1(spdy::SETTINGS_FLAG_PLEASE_PERSIST, + SettingsFlagsAndId setting1(SETTINGS_FLAG_PLEASE_PERSIST, kSampleId1); settings.push_back(std::make_pair(setting1, kSampleValue1)); // Next add another persisted setting - spdy::SettingsFlagsAndId setting2(spdy::SETTINGS_FLAG_PLEASE_PERSIST, + SettingsFlagsAndId setting2(SETTINGS_FLAG_PLEASE_PERSIST, kSampleId2); settings.push_back(std::make_pair(setting2, kSampleValue2)); @@ -4527,13 +4527,13 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SettingsPlayback) { host_port_pair).size()); // Construct the SETTINGS frame. - const spdy::SpdySettings& settings = + const SpdySettings& settings = spdy_session_pool->http_server_properties()->GetSpdySettings( host_port_pair); - scoped_ptr<spdy::SpdyFrame> settings_frame(ConstructSpdySettings(settings)); + scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*settings_frame), @@ -4541,14 +4541,14 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SettingsPlayback) { }; // Construct the reply. - scoped_ptr<spdy::SpdyFrame> reply( + scoped_ptr<SpdyFrame> reply( ConstructSpdyPacket(kSynReplyInfo, kExtraHeaders, arraysize(kExtraHeaders) / 2, NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*reply), CreateMockRead(*body), @@ -4568,32 +4568,32 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SettingsPlayback) { { // Verify we had two persisted settings. - spdy::SpdySettings saved_settings = + SpdySettings saved_settings = spdy_session_pool->http_server_properties()->GetSpdySettings( host_port_pair); ASSERT_EQ(2u, saved_settings.size()); // Verify the first persisted setting. - spdy::SpdySetting setting = saved_settings.front(); + SpdySetting setting = saved_settings.front(); saved_settings.pop_front(); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, setting.first.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, setting.first.flags()); EXPECT_EQ(kSampleId1, setting.first.id()); EXPECT_EQ(kSampleValue1, setting.second); // Verify the second persisted setting. setting = saved_settings.front(); saved_settings.pop_front(); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, setting.first.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, setting.first.flags()); EXPECT_EQ(kSampleId2, setting.first.id()); EXPECT_EQ(kSampleValue2, setting.second); } } TEST_P(SpdyNetworkTransactionSpdy21Test, GoAwayWithActiveStream) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> go_away(ConstructSpdyGoAway()); + scoped_ptr<SpdyFrame> go_away(ConstructSpdyGoAway()); MockRead reads[] = { CreateMockRead(*go_away), MockRead(ASYNC, 0, 0), // EOF @@ -4611,10 +4611,10 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, GoAwayWithActiveStream) { } TEST_P(SpdyNetworkTransactionSpdy21Test, CloseWithActiveStream) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), MockRead(SYNCHRONOUS, 0, 0) // EOF @@ -4666,9 +4666,9 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ProxyConnect) { "Host: www.google.com\r\n" "Proxy-Connection: keep-alive\r\n\r\n"}; const char kHTTP200[] = {"HTTP/1.1 200 OK\r\n\r\n"}; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockWrite writes_SPDYNPN[] = { MockWrite(SYNCHRONOUS, kConnect443, arraysize(kConnect443) - 1, 0), @@ -4769,13 +4769,13 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, DirectConnectProxyReconnect) { helper.RunPreTestSetup(); // Construct and send a simple GET request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req, 1), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp, 2), CreateMockRead(*body, 3), @@ -4824,10 +4824,10 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, DirectConnectProxyReconnect) { "Host: www.google.com\r\n" "Proxy-Connection: keep-alive\r\n\r\n"}; const char kHTTP200[] = {"HTTP/1.1 200 OK\r\n\r\n"}; - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet( + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet( "http://www.google.com/foo.dat", false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); MockWrite writes_SPDYNPN[] = { MockWrite(SYNCHRONOUS, kConnect443, arraysize(kConnect443) - 1, 0), @@ -4929,8 +4929,8 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, DirectConnectProxyReconnect) { // This can happen when a server reboots without saying goodbye, or when // we're behind a NAT that masked the RST. TEST_P(SpdyNetworkTransactionSpdy21Test, VerifyRetryOnConnectionReset) { - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -5012,11 +5012,11 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, VerifyRetryOnConnectionReset) { // Test that turning SPDY on and off works properly. TEST_P(SpdyNetworkTransactionSpdy21Test, SpdyOnOffToggle) { net::HttpStreamFactory::set_spdy_enabled(true); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -5062,13 +5062,13 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SpdyBasicAuth) { // The first request will be a bare GET, the second request will be a // GET with an Authorization header. - scoped_ptr<spdy::SpdyFrame> req_get( + scoped_ptr<SpdyFrame> req_get( ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); const char* const kExtraAuthorizationHeaders[] = { "authorization", "Basic Zm9vOmJhcg==", }; - scoped_ptr<spdy::SpdyFrame> req_get_authorization( + scoped_ptr<SpdyFrame> req_get_authorization( ConstructSpdyGet( kExtraAuthorizationHeaders, arraysize(kExtraAuthorizationHeaders) / 2, @@ -5085,16 +5085,16 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SpdyBasicAuth) { "www-authenticate", "Basic realm=\"MyRealm\"" }; - scoped_ptr<spdy::SpdyFrame> resp_authentication( + scoped_ptr<SpdyFrame> resp_authentication( ConstructSpdySynReplyError( "401 Authentication Required", kExtraAuthenticationHeaders, arraysize(kExtraAuthenticationHeaders) / 2, 1)); - scoped_ptr<spdy::SpdyFrame> body_authentication( + scoped_ptr<SpdyFrame> body_authentication( ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> resp_data(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body_data(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> resp_data(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body_data(ConstructSpdyBodyFrame(3, true)); MockRead spdy_reads[] = { CreateMockRead(*resp_authentication, 2), CreateMockRead(*body_authentication, 3), @@ -5154,9 +5154,9 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushWithHeaders) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), @@ -5174,30 +5174,30 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushWithHeaders) { "version", "HTTP/1.1" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 2, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 2, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), @@ -5238,9 +5238,9 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushClaimBeforeHeaders) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 0, SYNCHRONOUS), @@ -5258,30 +5258,30 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushClaimBeforeHeaders) { "version", "HTTP/1.1" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 2, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 2, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*stream1_reply, 1), @@ -5375,9 +5375,9 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushWithTwoHeaderFrames) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 0, SYNCHRONOUS), @@ -5397,41 +5397,41 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushWithTwoHeaderFrames) { "version", "HTTP/1.1" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 2, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_headers1(ConstructSpdyControlFrame(kMiddleHeaders, arraysize(kMiddleHeaders) / 2, false, 2, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_headers2(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 2, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*stream1_reply, 1), @@ -5528,7 +5528,7 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushWithTwoHeaderFrames) { } TEST_P(SpdyNetworkTransactionSpdy21Test, SynReplyWithHeaders) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; static const char* const kInitialHeaders[] = { @@ -5541,29 +5541,29 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SynReplyWithHeaders) { "hello", "bye", }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 1, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream1_reply), CreateMockRead(*stream1_headers), @@ -5584,7 +5584,7 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SynReplyWithHeaders) { } TEST_P(SpdyNetworkTransactionSpdy21Test, SynReplyWithLateHeaders) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; static const char* const kInitialHeaders[] = { @@ -5597,30 +5597,30 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SynReplyWithLateHeaders) { "hello", "bye", }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 1, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> stream1_body2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> stream1_body2(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream1_reply), CreateMockRead(*stream1_body), @@ -5642,7 +5642,7 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SynReplyWithLateHeaders) { } TEST_P(SpdyNetworkTransactionSpdy21Test, SynReplyWithDuplicateLateHeaders) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; static const char* const kInitialHeaders[] = { @@ -5655,30 +5655,30 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, SynReplyWithDuplicateLateHeaders) { "status", "500 Server Error", }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 1, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> stream1_body2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> stream1_body2(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream1_reply), CreateMockRead(*stream1_body), @@ -5733,27 +5733,27 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushCrossOriginCorrectness) { const char* url_to_fetch = kTestCases[index]; const char* url_to_push = kTestCases[index + 1]; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(url_to_fetch, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> push_rst( - ConstructSpdyRstStream(2, spdy::REFUSED_STREAM)); + scoped_ptr<SpdyFrame> push_rst( + ConstructSpdyRstStream(2, REFUSED_STREAM)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*push_rst, 4), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, 1, url_to_push)); - scoped_ptr<spdy::SpdyFrame> rst( - ConstructSpdyRstStream(2, spdy::CANCEL)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(2, CANCEL)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), @@ -5811,17 +5811,17 @@ TEST_P(SpdyNetworkTransactionSpdy21Test, ServerPushCrossOriginCorrectness) { TEST_P(SpdyNetworkTransactionSpdy21Test, RetryAfterRefused) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req, 1), CreateMockWrite(*req2, 3), }; - scoped_ptr<spdy::SpdyFrame> refused( - ConstructSpdyRstStream(1, spdy::REFUSED_STREAM)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> refused( + ConstructSpdyRstStream(1, REFUSED_STREAM)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(3, true)); MockRead reads[] = { CreateMockRead(*refused, 2), CreateMockRead(*resp, 4), diff --git a/net/spdy/spdy_network_transaction_spdy2_unittest.cc b/net/spdy/spdy_network_transaction_spdy2_unittest.cc index 40b0c6a..a64fb51 100644 --- a/net/spdy/spdy_network_transaction_spdy2_unittest.cc +++ b/net/spdy/spdy_network_transaction_spdy2_unittest.cc @@ -544,11 +544,11 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, Constructor) { TEST_P(SpdyNetworkTransactionSpdy2Test, Get) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -571,10 +571,10 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, GetAtEachPriority) { for (RequestPriority p = HIGHEST; p < NUM_PRIORITIES; p = RequestPriority(p+1)) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, p)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, p)); MockWrite writes[] = { CreateMockWrite(*req) }; - const int spdy_prio = reinterpret_cast<spdy::SpdySynStreamControlFrame*>( + const int spdy_prio = reinterpret_cast<SpdySynStreamControlFrame*>( req.get())->priority(); // this repeats the RequestPriority-->SpdyPriority mapping from // SpdyFramer::ConvertRequestPriorityToSpdyPriority to make @@ -597,8 +597,8 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, GetAtEachPriority) { FAIL(); } - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -631,20 +631,20 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, GetAtEachPriority) { // can allow multiple streams in flight. TEST_P(SpdyNetworkTransactionSpdy2Test, ThreeGets) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); - scoped_ptr<spdy::SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 5)); - scoped_ptr<spdy::SpdyFrame> body3(ConstructSpdyBodyFrame(5, false)); - scoped_ptr<spdy::SpdyFrame> fbody3(ConstructSpdyBodyFrame(5, true)); + scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, LOWEST)); + scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 5)); + scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(5, false)); + scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(5, true)); MockWrite writes[] = { CreateMockWrite(*req), @@ -726,15 +726,15 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ThreeGets) { } TEST_P(SpdyNetworkTransactionSpdy2Test, TwoGetsLateBinding) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); MockWrite writes[] = { CreateMockWrite(*req), @@ -813,15 +813,15 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, TwoGetsLateBinding) { } TEST_P(SpdyNetworkTransactionSpdy2Test, TwoGetsLateBindingFromPreconnect) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); MockWrite writes[] = { CreateMockWrite(*req), @@ -919,27 +919,27 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, TwoGetsLateBindingFromPreconnect) { // second transaction completes, so we can assert on read_index(). TEST_P(SpdyNetworkTransactionSpdy2Test, ThreeGetsWithMaxConcurrent) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); - - scoped_ptr<spdy::SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 5)); - scoped_ptr<spdy::SpdyFrame> body3(ConstructSpdyBodyFrame(5, false)); - scoped_ptr<spdy::SpdyFrame> fbody3(ConstructSpdyBodyFrame(5, true)); - - spdy::SpdySettings settings; - spdy::SettingsFlagsAndId id(0, spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + + scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, LOWEST)); + scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 5)); + scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(5, false)); + scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(5, true)); + + SpdySettings settings; + SettingsFlagsAndId id(0, SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 1; - settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); - scoped_ptr<spdy::SpdyFrame> settings_frame(ConstructSpdySettings(settings)); + settings.push_back(SpdySetting(id, max_concurrent_streams)); + scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); MockWrite writes[] = { CreateMockWrite(*req), @@ -1051,33 +1051,33 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ThreeGetsWithMaxConcurrent) { // the response from the server. TEST_P(SpdyNetworkTransactionSpdy2Test, FourGetsWithMaxConcurrentPriority) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); - scoped_ptr<spdy::SpdyFrame> req4( + scoped_ptr<SpdyFrame> req4( ConstructSpdyGet(NULL, 0, false, 5, HIGHEST)); - scoped_ptr<spdy::SpdyFrame> resp4(ConstructSpdyGetSynReply(NULL, 0, 5)); - scoped_ptr<spdy::SpdyFrame> fbody4(ConstructSpdyBodyFrame(5, true)); + scoped_ptr<SpdyFrame> resp4(ConstructSpdyGetSynReply(NULL, 0, 5)); + scoped_ptr<SpdyFrame> fbody4(ConstructSpdyBodyFrame(5, true)); - scoped_ptr<spdy::SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 7, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 7)); - scoped_ptr<spdy::SpdyFrame> body3(ConstructSpdyBodyFrame(7, false)); - scoped_ptr<spdy::SpdyFrame> fbody3(ConstructSpdyBodyFrame(7, true)); + scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 7, LOWEST)); + scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 7)); + scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(7, false)); + scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(7, true)); - spdy::SpdySettings settings; - spdy::SettingsFlagsAndId id(0, spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + SpdySettings settings; + SettingsFlagsAndId id(0, SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 1; - settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); - scoped_ptr<spdy::SpdyFrame> settings_frame(ConstructSpdySettings(settings)); + settings.push_back(SpdySetting(id, max_concurrent_streams)); + scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*req2), @@ -1206,22 +1206,22 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, FourGetsWithMaxConcurrentPriority) { // the spdy_session TEST_P(SpdyNetworkTransactionSpdy2Test, ThreeGetsWithMaxConcurrentDelete) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); - - spdy::SpdySettings settings; - spdy::SettingsFlagsAndId id(0, spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + + SpdySettings settings; + SettingsFlagsAndId id(0, SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 1; - settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); - scoped_ptr<spdy::SpdyFrame> settings_frame(ConstructSpdySettings(settings)); + settings.push_back(SpdySetting(id, max_concurrent_streams)); + scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*req2), @@ -1343,20 +1343,20 @@ class KillerCallback : public TestCompletionCallbackBase { // a pending stream creation. http://crbug.com/52901 TEST_P(SpdyNetworkTransactionSpdy2Test, ThreeGetsWithMaxConcurrentSocketClose) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fin_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fin_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - spdy::SpdySettings settings; - spdy::SettingsFlagsAndId id(0, spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + SpdySettings settings; + SettingsFlagsAndId id(0, SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 1; - settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); - scoped_ptr<spdy::SpdyFrame> settings_frame(ConstructSpdySettings(settings)); + settings.push_back(SpdySetting(id, max_concurrent_streams)); + scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*req2), @@ -1441,16 +1441,16 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, Put) { request.url = GURL("http://www.google.com/"); const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_STREAM, // Kind = Syn + SYN_STREAM, // Kind = Syn 1, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_FIN, // Control Flags + CONTROL_FLAG_FIN, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; const char* const kPutHeaders[] = { "method", "PUT", @@ -1460,31 +1460,31 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, Put) { "version", "HTTP/1.1", "content-length", "0" }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPacket(kSynStartHeader, NULL, 0, + scoped_ptr<SpdyFrame> req(ConstructSpdyPacket(kSynStartHeader, NULL, 0, kPutHeaders, arraysize(kPutHeaders) / 2)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); const SpdyHeaderInfo kSynReplyHeader = { - spdy::SYN_REPLY, // Kind = SynReply + SYN_REPLY, // Kind = SynReply 1, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; static const char* const kStandardGetHeaders[] = { "status", "200", "version", "HTTP/1.1" "content-length", "1234" }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPacket(kSynReplyHeader, + scoped_ptr<SpdyFrame> resp(ConstructSpdyPacket(kSynReplyHeader, NULL, 0, kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); MockRead reads[] = { CreateMockRead(*resp), @@ -1512,16 +1512,16 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, Head) { request.url = GURL("http://www.google.com/"); const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_STREAM, // Kind = Syn + SYN_STREAM, // Kind = Syn 1, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_FIN, // Control Flags + CONTROL_FLAG_FIN, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; const char* const kHeadHeaders[] = { "method", "HEAD", @@ -1531,31 +1531,31 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, Head) { "version", "HTTP/1.1", "content-length", "0" }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPacket(kSynStartHeader, NULL, 0, + scoped_ptr<SpdyFrame> req(ConstructSpdyPacket(kSynStartHeader, NULL, 0, kHeadHeaders, arraysize(kHeadHeaders) / 2)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); const SpdyHeaderInfo kSynReplyHeader = { - spdy::SYN_REPLY, // Kind = SynReply + SYN_REPLY, // Kind = SynReply 1, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; static const char* const kStandardGetHeaders[] = { "status", "200", "version", "HTTP/1.1" "content-length", "1234" }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPacket(kSynReplyHeader, + scoped_ptr<SpdyFrame> resp(ConstructSpdyPacket(kSynReplyHeader, NULL, 0, kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); MockRead reads[] = { CreateMockRead(*resp), @@ -1577,14 +1577,14 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, Head) { // Test that a simple POST works. TEST_P(SpdyNetworkTransactionSpdy2Test, Post) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPost(kUploadDataSize, NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyPost(kUploadDataSize, NULL, 0)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*body), // POST upload frame }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -1606,16 +1606,16 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, Post) { // Test that a chunked POST works. TEST_P(SpdyNetworkTransactionSpdy2Test, ChunkedPost) { UploadDataStream::set_merge_chunks(false); - scoped_ptr<spdy::SpdyFrame> req(ConstructChunkedSpdyPost(NULL, 0)); - scoped_ptr<spdy::SpdyFrame> chunk1(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> chunk2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructChunkedSpdyPost(NULL, 0)); + scoped_ptr<SpdyFrame> chunk1(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> chunk2(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*chunk1), CreateMockWrite(*chunk2), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*chunk1), @@ -1646,15 +1646,15 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, NullPost) { // When request.upload_data is NULL for post, content-length is // expected to be 0. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPost(0, NULL, 0)); + scoped_ptr<SpdyFrame> req(ConstructSpdyPost(0, NULL, 0)); // Set the FIN bit since there will be no body. - req->set_flags(spdy::CONTROL_FLAG_FIN); + req->set_flags(CONTROL_FLAG_FIN); MockWrite writes[] = { CreateMockWrite(*req), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -1691,17 +1691,17 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, EmptyPost) { ASSERT_EQ(request.upload_data->GetContentLengthSync(), stream->size()); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> req(ConstructSpdyPost( request.upload_data->GetContentLengthSync(), NULL, 0)); // Set the FIN bit since there will be no body. - req->set_flags(spdy::CONTROL_FLAG_FIN); + req->set_flags(CONTROL_FLAG_FIN); MockWrite writes[] = { CreateMockWrite(*req), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -1739,8 +1739,8 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, PostWithEarlySynReply) { ASSERT_EQ(OK, stream->Init()); ASSERT_EQ(request.upload_data->GetContentLengthSync(), stream->size()); - scoped_ptr<spdy::SpdyFrame> stream_reply(ConstructSpdyPostSynReply(NULL, 0)); - scoped_ptr<spdy::SpdyFrame> stream_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> stream_reply(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> stream_body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream_reply, 2), CreateMockRead(*stream_body, 3), @@ -1764,16 +1764,16 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, PostWithEarlySynReply) { // socket causes the TCP write to return zero. This test checks that the client // tries to queue up the RST_STREAM frame again. TEST_P(SpdyNetworkTransactionSpdy2Test, SocketWriteReturnsZero) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> rst( - ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(1, CANCEL)); MockWrite writes[] = { CreateMockWrite(*req.get(), 0, SYNCHRONOUS), MockWrite(SYNCHRONOUS, 0, 0, 2), CreateMockWrite(*rst.get(), 3, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp.get(), 1, ASYNC), MockRead(ASYNC, 0, 0, 4) // EOF @@ -1805,7 +1805,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SocketWriteReturnsZero) { // Test that the transaction doesn't crash when we don't have a reply. TEST_P(SpdyNetworkTransactionSpdy2Test, ResponseWithoutSynReply) { - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*body), MockRead(ASYNC, 0, 0) // EOF @@ -1823,11 +1823,11 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ResponseWithoutSynReply) { // Test that the transaction doesn't crash when we get two replies on the same // stream ID. See http://crbug.com/45639. TEST_P(SpdyNetworkTransactionSpdy2Test, ResponseWithTwoSynReplies) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*resp), @@ -1865,12 +1865,12 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ResponseWithTwoSynReplies) { TEST_P(SpdyNetworkTransactionSpdy2Test, CancelledTransaction) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), // This following read isn't used by the test, except during the @@ -1903,15 +1903,15 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, CancelledTransaction) { // Verify that the client sends a Rst Frame upon cancelling the stream. TEST_P(SpdyNetworkTransactionSpdy2Test, CancelledTransactionSendRst) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> rst( - ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(1, CANCEL)); MockWrite writes[] = { CreateMockWrite(*req, 0, SYNCHRONOUS), CreateMockWrite(*rst, 2, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 0, 3) // EOF @@ -1948,7 +1948,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, CancelledTransactionSendRst) { // to start another transaction on a session that is closing down. See // http://crbug.com/47455 TEST_P(SpdyNetworkTransactionSpdy2Test, StartTransactionOnReadCallback) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; MockWrite writes2[] = { CreateMockWrite(*req) }; @@ -1961,7 +1961,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, StartTransactionOnReadCallback) { 'h', 'e', 'l', 'l', 'o', '!', }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp, 2), MockRead(ASYNC, ERR_IO_PENDING, 3), // Force a pause @@ -2012,11 +2012,11 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, StartTransactionOnReadCallback) { // transaction. Failures will usually be valgrind errors. See // http://crbug.com/46925 TEST_P(SpdyNetworkTransactionSpdy2Test, DeleteSessionOnReadCallback) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp.get(), 2), MockRead(ASYNC, ERR_IO_PENDING, 3), // Force a pause @@ -2063,7 +2063,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, RedirectGetRequest) { "accept-encoding", "gzip,deflate", }; - const SpdyHeaderInfo kSynStartHeader = MakeSpdyHeader(spdy::SYN_STREAM); + const SpdyHeaderInfo kSynStartHeader = MakeSpdyHeader(SYN_STREAM); const char* const kStandardGetHeaders[] = { "host", "www.google.com", @@ -2094,13 +2094,13 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, RedirectGetRequest) { }; // Setup writes/reads to www.google.com - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPacket( + scoped_ptr<SpdyFrame> req(ConstructSpdyPacket( kSynStartHeader, kExtraHeaders, arraysize(kExtraHeaders) / 2, kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyPacket( + scoped_ptr<SpdyFrame> req2(ConstructSpdyPacket( kSynStartHeader, kExtraHeaders, arraysize(kExtraHeaders) / 2, kStandardGetHeaders2, arraysize(kStandardGetHeaders2) / 2)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReplyRedirect(1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReplyRedirect(1)); MockWrite writes[] = { CreateMockWrite(*req, 1), }; @@ -2110,8 +2110,8 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, RedirectGetRequest) { }; // Setup writes/reads to www.foo.com - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); MockWrite writes2[] = { CreateMockWrite(*req2, 1), }; @@ -2163,17 +2163,17 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, RedirectGetRequest) { // Detect response with upper case headers and reset the stream. TEST_P(SpdyNetworkTransactionSpdy2Test, UpperCaseHeaders) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> - rst(ConstructSpdyRstStream(1, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + rst(ConstructSpdyRstStream(1, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*syn, 0), CreateMockWrite(*rst, 2), }; const char* const kExtraHeaders[] = {"X-UpperCase", "yes"}; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> reply(ConstructSpdyGetSynReply(kExtraHeaders, 1, 1)); MockRead reads[] = { CreateMockRead(*reply, 1), @@ -2197,10 +2197,10 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, UpperCaseHeaders) { // Detect response with upper case headers in a HEADERS frame and reset the // stream. TEST_P(SpdyNetworkTransactionSpdy2Test, UpperCaseHeadersInHeadersFrame) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> - rst(ConstructSpdyRstStream(1, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + rst(ConstructSpdyRstStream(1, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*syn, 0), CreateMockWrite(*rst, 2), @@ -2213,29 +2213,29 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, UpperCaseHeadersInHeadersFrame) { static const char* const kLateHeaders[] = { "X-UpperCase", "yes", }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 1, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream1_reply), CreateMockRead(*stream1_headers), @@ -2255,21 +2255,21 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, UpperCaseHeadersInHeadersFrame) { // Detect push stream with upper case headers and reset the stream. TEST_P(SpdyNetworkTransactionSpdy2Test, UpperCaseHeadersOnPush) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> - rst(ConstructSpdyRstStream(2, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*syn, 0), CreateMockWrite(*rst, 2), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> reply(ConstructSpdyGetSynReply(NULL, 0, 1)); const char* const extra_headers[] = {"X-UpperCase", "yes"}; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> push(ConstructSpdyPush(extra_headers, 1, 2, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*reply, 1), CreateMockRead(*push, 1), @@ -2299,7 +2299,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, RedirectServerPush) { "accept-encoding", "gzip,deflate", }; - const SpdyHeaderInfo kSynStartHeader = MakeSpdyHeader(spdy::SYN_STREAM); + const SpdyHeaderInfo kSynStartHeader = MakeSpdyHeader(SYN_STREAM); const char* const kStandardGetHeaders[] = { "host", "www.google.com", @@ -2316,14 +2316,14 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, RedirectServerPush) { }; // Setup writes/reads to www.google.com - scoped_ptr<spdy::SpdyFrame> req( + scoped_ptr<SpdyFrame> req( ConstructSpdyPacket(kSynStartHeader, kExtraHeaders, arraysize(kExtraHeaders) / 2, kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> rep( + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> rep( ConstructSpdyPush(NULL, 0, 2, @@ -2331,8 +2331,8 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, RedirectServerPush) { "http://www.google.com/foo.dat", "301 Moved Permanently", "http://www.foo.com/index.php")); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> rst(ConstructSpdyRstStream(2, spdy::CANCEL)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(2, CANCEL)); MockWrite writes[] = { CreateMockWrite(*req, 1), CreateMockWrite(*rst, 6), @@ -2360,14 +2360,14 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, RedirectServerPush) { "version", "HTTP/1.1" }; - scoped_ptr<spdy::SpdyFrame> req2( + scoped_ptr<SpdyFrame> req2( ConstructSpdyPacket(kSynStartHeader, kExtraHeaders, arraysize(kExtraHeaders) / 2, kStandardGetHeaders2, arraysize(kStandardGetHeaders2) / 2)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); MockWrite writes2[] = { CreateMockWrite(*req2, 1), }; @@ -2435,17 +2435,17 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushSingleDataFrame) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -2488,17 +2488,17 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushBeforeSynReply) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -2541,21 +2541,21 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushSingleDataFrame2) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, 1, "http://www.google.com/foo.dat")); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), @@ -2589,24 +2589,24 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushSingleDataFrame2) { } TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushServerAborted) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, 1, "http://www.google.com/foo.dat")); - scoped_ptr<spdy::SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + stream2_rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), CreateMockRead(*stream2_syn, 3), @@ -2659,26 +2659,26 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushDuplicate) { 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> - stream3_rst(ConstructSpdyRstStream(4, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + stream3_rst(ConstructSpdyRstStream(4, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream3_rst, 5), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, 1, "http://www.google.com/foo.dat")); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream3_syn(ConstructSpdyPush(NULL, 0, 4, @@ -2726,17 +2726,17 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushMultipleDataFrame) { static const char kPushBodyFrame3[] = " hello"; static const char kPushBodyFrame4[] = " my baby"; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -2790,17 +2790,17 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, static const char kPushBodyFrame3[] = " hello"; static const char kPushBodyFrame4[] = " my baby"; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -2845,20 +2845,20 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, } TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushInvalidAssociatedStreamID0) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, spdy::INVALID_STREAM)); + scoped_ptr<SpdyFrame> + stream2_rst(ConstructSpdyRstStream(2, INVALID_STREAM)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream2_rst, 4), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -2907,20 +2907,20 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushInvalidAssociatedStreamID0) { } TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushInvalidAssociatedStreamID9) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, spdy::INVALID_ASSOCIATED_STREAM)); + scoped_ptr<SpdyFrame> + stream2_rst(ConstructSpdyRstStream(2, INVALID_ASSOCIATED_STREAM)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream2_rst, 4), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -2969,20 +2969,20 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushInvalidAssociatedStreamID9) { } TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushNoURL) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + stream2_rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream2_rst, 4), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, 1)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), @@ -3065,15 +3065,15 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SynReplyHeaders) { }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { - scoped_ptr<spdy::SpdyFrame> req( + scoped_ptr<SpdyFrame> req( ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdyGetSynReply(test_cases[i].extra_headers, test_cases[i].num_headers, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -3110,17 +3110,17 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SynReplyHeaders) { // through the HTTP layer, and the response matches the request. TEST_P(SpdyNetworkTransactionSpdy2Test, SynReplyHeadersVary) { static const SpdyHeaderInfo syn_reply_info = { - spdy::SYN_REPLY, // Syn Reply + SYN_REPLY, // Syn Reply 1, // Stream ID 0, // Associated Stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Data Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; // Modify the following data to change/add test cases: struct SynReplyTests { @@ -3195,7 +3195,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SynReplyHeadersVary) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> frame_req( + scoped_ptr<SpdyFrame> frame_req( ConstructSpdyGet(test_cases[i].extra_headers[0], test_cases[i].num_headers[0], false, 1, LOWEST)); @@ -3205,14 +3205,14 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SynReplyHeadersVary) { }; // Construct the reply. - scoped_ptr<spdy::SpdyFrame> frame_reply( + scoped_ptr<SpdyFrame> frame_reply( ConstructSpdyPacket(*test_cases[i].syn_reply, test_cases[i].extra_headers[1], test_cases[i].num_headers[1], NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*frame_reply), CreateMockRead(*body), @@ -3279,17 +3279,17 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SynReplyHeadersVary) { // Verify that we don't crash on invalid SynReply responses. TEST_P(SpdyNetworkTransactionSpdy2Test, InvalidSynReply) { const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_REPLY, // Kind = SynReply + SYN_REPLY, // Kind = SynReply 1, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; struct InvalidSynReplyTests { @@ -3317,18 +3317,18 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, InvalidSynReply) { }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { - scoped_ptr<spdy::SpdyFrame> req( + scoped_ptr<SpdyFrame> req( ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req), }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdyPacket(kSynStartHeader, NULL, 0, test_cases[i].headers, test_cases[i].num_headers)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -3349,25 +3349,25 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, InvalidSynReply) { // Verify that we don't crash on some corrupt frames. TEST_P(SpdyNetworkTransactionSpdy2Test, CorruptFrameSessionError) { // This is the length field that's too short. - scoped_ptr<spdy::SpdyFrame> syn_reply_wrong_length( + scoped_ptr<SpdyFrame> syn_reply_wrong_length( ConstructSpdyGetSynReply(NULL, 0, 1)); syn_reply_wrong_length->set_length(syn_reply_wrong_length->length() - 4); struct SynReplyTests { - const spdy::SpdyFrame* syn_reply; + const SpdyFrame* syn_reply; } test_cases[] = { { syn_reply_wrong_length.get(), }, }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { - scoped_ptr<spdy::SpdyFrame> req( + scoped_ptr<SpdyFrame> req( ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req), MockWrite(ASYNC, 0, 0) // EOF }; - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*test_cases[i].syn_reply), CreateMockRead(*body), @@ -3387,7 +3387,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, CorruptFrameSessionError) { // Test that we shutdown correctly on write errors. TEST_P(SpdyNetworkTransactionSpdy2Test, WriteError) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { // We'll write 10 bytes successfully MockWrite(ASYNC, req->data(), 10), @@ -3409,12 +3409,12 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, WriteError) { // Test that partial writes work. TEST_P(SpdyNetworkTransactionSpdy2Test, PartialWrite) { // Chop the SYN_STREAM frame into 5 chunks. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); const int kChunks = 5; scoped_array<MockWrite> writes(ChopWriteFrame(*req.get(), kChunks)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -3437,18 +3437,18 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, PartialWrite) { // the server. Verify that teardown is all clean. TEST_P(SpdyNetworkTransactionSpdy2Test, DecompressFailureOnSynReply) { // For this test, we turn on the normal compression. - spdy::SpdyFramer::set_enable_compression_default(true); + SpdyFramer::set_enable_compression_default(true); - scoped_ptr<spdy::SpdyFrame> compressed( + scoped_ptr<SpdyFrame> compressed( ConstructSpdyGet(NULL, 0, true, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> rst( - ConstructSpdyRstStream(1, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(1, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*compressed), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), }; @@ -3469,12 +3469,12 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, NetLog) { static const char* const kExtraHeaders[] = { "user-agent", "Chrome", }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(kExtraHeaders, 1, false, 1, + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(kExtraHeaders, 1, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -3530,10 +3530,10 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, NetLog) { CapturingNetLog::Entry entry = entries[pos]; NetLogSpdySynParameter* request_params = static_cast<NetLogSpdySynParameter*>(entry.extra_parameters.get()); - spdy::SpdyHeaderBlock* headers = + SpdyHeaderBlock* headers = request_params->GetHeaders().get(); - spdy::SpdyHeaderBlock expected; + SpdyHeaderBlock expected; expected["host"] = "www.google.com"; expected["url"] = "/"; expected["scheme"] = "http"; @@ -3541,8 +3541,8 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, NetLog) { expected["method"] = "GET"; expected["user-agent"] = "Chrome"; EXPECT_EQ(expected.size(), headers->size()); - spdy::SpdyHeaderBlock::const_iterator end = expected.end(); - for (spdy::SpdyHeaderBlock::const_iterator it = expected.begin(); + SpdyHeaderBlock::const_iterator end = expected.end(); + for (SpdyHeaderBlock::const_iterator it = expected.begin(); it != end; ++it) { EXPECT_EQ(it->second, (*headers)[it->first]); @@ -3554,17 +3554,17 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, NetLog) { // on the network, but issued a Read for only 5 of those bytes) that the data // flow still works correctly. TEST_P(SpdyNetworkTransactionSpdy2Test, BufferFull) { - spdy::BufferedSpdyFramer framer(2); + BufferedSpdyFramer framer(2); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // 2 data frames in a single read. - scoped_ptr<spdy::SpdyFrame> data_frame_1( - framer.CreateDataFrame(1, "goodby", 6, spdy::DATA_FLAG_NONE)); - scoped_ptr<spdy::SpdyFrame> data_frame_2( - framer.CreateDataFrame(1, "e worl", 6, spdy::DATA_FLAG_NONE)); - const spdy::SpdyFrame* data_frames[2] = { + scoped_ptr<SpdyFrame> data_frame_1( + framer.CreateDataFrame(1, "goodby", 6, DATA_FLAG_NONE)); + scoped_ptr<SpdyFrame> data_frame_2( + framer.CreateDataFrame(1, "e worl", 6, DATA_FLAG_NONE)); + const SpdyFrame* data_frames[2] = { data_frame_1.get(), data_frame_2.get(), }; @@ -3572,10 +3572,10 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, BufferFull) { int combined_data_frames_len = CombineFrames(data_frames, arraysize(data_frames), combined_data_frames, arraysize(combined_data_frames)); - scoped_ptr<spdy::SpdyFrame> last_frame( - framer.CreateDataFrame(1, "d", 1, spdy::DATA_FLAG_FIN)); + scoped_ptr<SpdyFrame> last_frame( + framer.CreateDataFrame(1, "d", 1, DATA_FLAG_FIN)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), MockRead(ASYNC, ERR_IO_PENDING), // Force a pause @@ -3649,17 +3649,17 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, BufferFull) { // at the same time, ensure that we don't notify a read completion for // each data frame individually. TEST_P(SpdyNetworkTransactionSpdy2Test, Buffering) { - spdy::BufferedSpdyFramer framer(2); + BufferedSpdyFramer framer(2); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // 4 data frames in a single read. - scoped_ptr<spdy::SpdyFrame> data_frame( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_NONE)); - scoped_ptr<spdy::SpdyFrame> data_frame_fin( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_FIN)); - const spdy::SpdyFrame* data_frames[4] = { + scoped_ptr<SpdyFrame> data_frame( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_NONE)); + scoped_ptr<SpdyFrame> data_frame_fin( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_FIN)); + const SpdyFrame* data_frames[4] = { data_frame.get(), data_frame.get(), data_frame.get(), @@ -3670,7 +3670,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, Buffering) { CombineFrames(data_frames, arraysize(data_frames), combined_data_frames, arraysize(combined_data_frames)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), MockRead(ASYNC, ERR_IO_PENDING), // Force a pause @@ -3744,20 +3744,20 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, Buffering) { // Verify the case where we buffer data but read it after it has been buffered. TEST_P(SpdyNetworkTransactionSpdy2Test, BufferedAll) { - spdy::BufferedSpdyFramer framer(2); + BufferedSpdyFramer framer(2); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // 5 data frames in a single read. - scoped_ptr<spdy::SpdyFrame> syn_reply( + scoped_ptr<SpdyFrame> syn_reply( ConstructSpdyGetSynReply(NULL, 0, 1)); - syn_reply->set_flags(spdy::CONTROL_FLAG_NONE); // turn off FIN bit - scoped_ptr<spdy::SpdyFrame> data_frame( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_NONE)); - scoped_ptr<spdy::SpdyFrame> data_frame_fin( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_FIN)); - const spdy::SpdyFrame* frames[5] = { + syn_reply->set_flags(CONTROL_FLAG_NONE); // turn off FIN bit + scoped_ptr<SpdyFrame> data_frame( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_NONE)); + scoped_ptr<SpdyFrame> data_frame_fin( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_FIN)); + const SpdyFrame* frames[5] = { syn_reply.get(), data_frame.get(), data_frame.get(), @@ -3836,16 +3836,16 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, BufferedAll) { // Verify the case where we buffer data and close the connection. TEST_P(SpdyNetworkTransactionSpdy2Test, BufferedClosed) { - spdy::BufferedSpdyFramer framer(2); + BufferedSpdyFramer framer(2); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // All data frames in a single read. // NOTE: We don't FIN the stream. - scoped_ptr<spdy::SpdyFrame> data_frame( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_NONE)); - const spdy::SpdyFrame* data_frames[4] = { + scoped_ptr<SpdyFrame> data_frame( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_NONE)); + const SpdyFrame* data_frames[4] = { data_frame.get(), data_frame.get(), data_frame.get(), @@ -3855,7 +3855,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, BufferedClosed) { int combined_data_frames_len = CombineFrames(data_frames, arraysize(data_frames), combined_data_frames, arraysize(combined_data_frames)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), MockRead(ASYNC, ERR_IO_PENDING), // Force a wait @@ -3927,16 +3927,16 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, BufferedClosed) { // Verify the case where we buffer data and cancel the transaction. TEST_P(SpdyNetworkTransactionSpdy2Test, BufferedCancelled) { - spdy::BufferedSpdyFramer framer(2); + BufferedSpdyFramer framer(2); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // NOTE: We don't FIN the stream. - scoped_ptr<spdy::SpdyFrame> data_frame( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_NONE)); + scoped_ptr<SpdyFrame> data_frame( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_NONE)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), MockRead(ASYNC, ERR_IO_PENDING), // Force a wait @@ -4000,17 +4000,17 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, BufferedCancelled) { // the settings in the SpdySettingsStorage. TEST_P(SpdyNetworkTransactionSpdy2Test, SettingsSaved) { static const SpdyHeaderInfo kSynReplyInfo = { - spdy::SYN_REPLY, // Syn Reply + SYN_REPLY, // Syn Reply 1, // Stream ID 0, // Associated Stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Data Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; static const char* const kExtraHeaders[] = { "status", "200", @@ -4028,11 +4028,11 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SettingsSaved) { host_port_pair).empty()); // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // Construct the reply. - scoped_ptr<spdy::SpdyFrame> reply( + scoped_ptr<SpdyFrame> reply( ConstructSpdyPacket(kSynReplyInfo, kExtraHeaders, arraysize(kExtraHeaders) / 2, @@ -4045,25 +4045,25 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SettingsSaved) { unsigned int kSampleValue2 = 0x0b0b0b0b; unsigned int kSampleId3 = 0x3; unsigned int kSampleValue3 = 0x0c0c0c0c; - scoped_ptr<spdy::SpdyFrame> settings_frame; + scoped_ptr<SpdyFrame> settings_frame; { // Construct the SETTINGS frame. - spdy::SpdySettings settings; + SpdySettings settings; // First add a persisted setting - spdy::SettingsFlagsAndId setting1(spdy::SETTINGS_FLAG_PLEASE_PERSIST, + SettingsFlagsAndId setting1(SETTINGS_FLAG_PLEASE_PERSIST, kSampleId1); settings.push_back(std::make_pair(setting1, kSampleValue1)); // Next add a non-persisted setting - spdy::SettingsFlagsAndId setting2(0, kSampleId2); + SettingsFlagsAndId setting2(0, kSampleId2); settings.push_back(std::make_pair(setting2, kSampleValue2)); // Next add another persisted setting - spdy::SettingsFlagsAndId setting3(spdy::SETTINGS_FLAG_PLEASE_PERSIST, + SettingsFlagsAndId setting3(SETTINGS_FLAG_PLEASE_PERSIST, kSampleId3); settings.push_back(std::make_pair(setting3, kSampleValue3)); settings_frame.reset(ConstructSpdySettings(settings)); } - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*reply), CreateMockRead(*body), @@ -4086,22 +4086,22 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SettingsSaved) { #ifdef PERSIST_SPDY_SETTINGS { // Verify we had two persisted settings. - spdy::SpdySettings saved_settings = + SpdySettings saved_settings = spdy_session_pool->http_server_properties()->GetSpdySettings( host_port_pair); ASSERT_EQ(2u, saved_settings.size()); // Verify the first persisted setting. - spdy::SpdySetting setting = saved_settings.front(); + SpdySetting setting = saved_settings.front(); saved_settings.pop_front(); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, setting.first.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, setting.first.flags()); EXPECT_EQ(kSampleId1, setting.first.id()); EXPECT_EQ(kSampleValue1, setting.second); // Verify the second persisted setting. setting = saved_settings.front(); saved_settings.pop_front(); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, setting.first.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, setting.first.flags()); EXPECT_EQ(kSampleId3, setting.first.id()); EXPECT_EQ(kSampleValue3, setting.second); } @@ -4112,17 +4112,17 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SettingsSaved) { // server upon session establishment. TEST_P(SpdyNetworkTransactionSpdy2Test, SettingsPlayback) { static const SpdyHeaderInfo kSynReplyInfo = { - spdy::SYN_REPLY, // Syn Reply + SYN_REPLY, // Syn Reply 1, // Stream ID 0, // Associated Stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Data Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; static const char* kExtraHeaders[] = { "status", "200", @@ -4145,13 +4145,13 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SettingsPlayback) { unsigned int kSampleValue2 = 0x0c0c0c0c; // Manually insert settings into the SpdySettingsStorage here. { - spdy::SpdySettings settings; + SpdySettings settings; // First add a persisted setting - spdy::SettingsFlagsAndId setting1(spdy::SETTINGS_FLAG_PLEASE_PERSIST, + SettingsFlagsAndId setting1(SETTINGS_FLAG_PLEASE_PERSIST, kSampleId1); settings.push_back(std::make_pair(setting1, kSampleValue1)); // Next add another persisted setting - spdy::SettingsFlagsAndId setting2(spdy::SETTINGS_FLAG_PLEASE_PERSIST, + SettingsFlagsAndId setting2(SETTINGS_FLAG_PLEASE_PERSIST, kSampleId2); settings.push_back(std::make_pair(setting2, kSampleValue2)); @@ -4163,13 +4163,13 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SettingsPlayback) { host_port_pair).size()); // Construct the SETTINGS frame. - const spdy::SpdySettings& settings = + const SpdySettings& settings = spdy_session_pool->http_server_properties()->GetSpdySettings( host_port_pair); - scoped_ptr<spdy::SpdyFrame> settings_frame(ConstructSpdySettings(settings)); + scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*settings_frame), @@ -4177,14 +4177,14 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SettingsPlayback) { }; // Construct the reply. - scoped_ptr<spdy::SpdyFrame> reply( + scoped_ptr<SpdyFrame> reply( ConstructSpdyPacket(kSynReplyInfo, kExtraHeaders, arraysize(kExtraHeaders) / 2, NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*reply), CreateMockRead(*body), @@ -4204,32 +4204,32 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SettingsPlayback) { { // Verify we had two persisted settings. - spdy::SpdySettings saved_settings = + SpdySettings saved_settings = spdy_session_pool->http_server_properties()->GetSpdySettings( host_port_pair); ASSERT_EQ(2u, saved_settings.size()); // Verify the first persisted setting. - spdy::SpdySetting setting = saved_settings.front(); + SpdySetting setting = saved_settings.front(); saved_settings.pop_front(); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, setting.first.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, setting.first.flags()); EXPECT_EQ(kSampleId1, setting.first.id()); EXPECT_EQ(kSampleValue1, setting.second); // Verify the second persisted setting. setting = saved_settings.front(); saved_settings.pop_front(); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, setting.first.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, setting.first.flags()); EXPECT_EQ(kSampleId2, setting.first.id()); EXPECT_EQ(kSampleValue2, setting.second); } } TEST_P(SpdyNetworkTransactionSpdy2Test, GoAwayWithActiveStream) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> go_away(ConstructSpdyGoAway()); + scoped_ptr<SpdyFrame> go_away(ConstructSpdyGoAway()); MockRead reads[] = { CreateMockRead(*go_away), MockRead(ASYNC, 0, 0), // EOF @@ -4247,10 +4247,10 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, GoAwayWithActiveStream) { } TEST_P(SpdyNetworkTransactionSpdy2Test, CloseWithActiveStream) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), MockRead(SYNCHRONOUS, 0, 0) // EOF @@ -4302,9 +4302,9 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ProxyConnect) { "Host: www.google.com\r\n" "Proxy-Connection: keep-alive\r\n\r\n"}; const char kHTTP200[] = {"HTTP/1.1 200 OK\r\n\r\n"}; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockWrite writes_SPDYNPN[] = { MockWrite(SYNCHRONOUS, kConnect443, arraysize(kConnect443) - 1, 0), @@ -4405,13 +4405,13 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, DirectConnectProxyReconnect) { helper.RunPreTestSetup(); // Construct and send a simple GET request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req, 1), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp, 2), CreateMockRead(*body, 3), @@ -4460,10 +4460,10 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, DirectConnectProxyReconnect) { "Host: www.google.com\r\n" "Proxy-Connection: keep-alive\r\n\r\n"}; const char kHTTP200[] = {"HTTP/1.1 200 OK\r\n\r\n"}; - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet( + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet( "http://www.google.com/foo.dat", false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); MockWrite writes_SPDYNPN[] = { MockWrite(SYNCHRONOUS, kConnect443, arraysize(kConnect443) - 1, 0), @@ -4565,8 +4565,8 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, DirectConnectProxyReconnect) { // This can happen when a server reboots without saying goodbye, or when // we're behind a NAT that masked the RST. TEST_P(SpdyNetworkTransactionSpdy2Test, VerifyRetryOnConnectionReset) { - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -4648,11 +4648,11 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, VerifyRetryOnConnectionReset) { // Test that turning SPDY on and off works properly. TEST_P(SpdyNetworkTransactionSpdy2Test, SpdyOnOffToggle) { net::HttpStreamFactory::set_spdy_enabled(true); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -4698,13 +4698,13 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SpdyBasicAuth) { // The first request will be a bare GET, the second request will be a // GET with an Authorization header. - scoped_ptr<spdy::SpdyFrame> req_get( + scoped_ptr<SpdyFrame> req_get( ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); const char* const kExtraAuthorizationHeaders[] = { "authorization", "Basic Zm9vOmJhcg==", }; - scoped_ptr<spdy::SpdyFrame> req_get_authorization( + scoped_ptr<SpdyFrame> req_get_authorization( ConstructSpdyGet( kExtraAuthorizationHeaders, arraysize(kExtraAuthorizationHeaders) / 2, @@ -4721,16 +4721,16 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SpdyBasicAuth) { "www-authenticate", "Basic realm=\"MyRealm\"" }; - scoped_ptr<spdy::SpdyFrame> resp_authentication( + scoped_ptr<SpdyFrame> resp_authentication( ConstructSpdySynReplyError( "401 Authentication Required", kExtraAuthenticationHeaders, arraysize(kExtraAuthenticationHeaders) / 2, 1)); - scoped_ptr<spdy::SpdyFrame> body_authentication( + scoped_ptr<SpdyFrame> body_authentication( ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> resp_data(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body_data(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> resp_data(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body_data(ConstructSpdyBodyFrame(3, true)); MockRead spdy_reads[] = { CreateMockRead(*resp_authentication, 2), CreateMockRead(*body_authentication, 3), @@ -4790,9 +4790,9 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushWithHeaders) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), @@ -4810,30 +4810,30 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushWithHeaders) { "version", "HTTP/1.1" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 2, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 2, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), @@ -4874,9 +4874,9 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushClaimBeforeHeaders) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 0, SYNCHRONOUS), @@ -4894,30 +4894,30 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushClaimBeforeHeaders) { "version", "HTTP/1.1" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 2, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 2, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*stream1_reply, 1), @@ -5011,9 +5011,9 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushWithTwoHeaderFrames) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 0, SYNCHRONOUS), @@ -5033,41 +5033,41 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushWithTwoHeaderFrames) { "version", "HTTP/1.1" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 2, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_headers1(ConstructSpdyControlFrame(kMiddleHeaders, arraysize(kMiddleHeaders) / 2, false, 2, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_headers2(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 2, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*stream1_reply, 1), @@ -5164,7 +5164,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushWithTwoHeaderFrames) { } TEST_P(SpdyNetworkTransactionSpdy2Test, SynReplyWithHeaders) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; static const char* const kInitialHeaders[] = { @@ -5177,29 +5177,29 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SynReplyWithHeaders) { "hello", "bye", }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 1, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream1_reply), CreateMockRead(*stream1_headers), @@ -5220,7 +5220,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SynReplyWithHeaders) { } TEST_P(SpdyNetworkTransactionSpdy2Test, SynReplyWithLateHeaders) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; static const char* const kInitialHeaders[] = { @@ -5233,30 +5233,30 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SynReplyWithLateHeaders) { "hello", "bye", }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 1, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> stream1_body2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> stream1_body2(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream1_reply), CreateMockRead(*stream1_body), @@ -5278,7 +5278,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SynReplyWithLateHeaders) { } TEST_P(SpdyNetworkTransactionSpdy2Test, SynReplyWithDuplicateLateHeaders) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; static const char* const kInitialHeaders[] = { @@ -5291,30 +5291,30 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SynReplyWithDuplicateLateHeaders) { "status", "500 Server Error", }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 1, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> stream1_body2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> stream1_body2(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream1_reply), CreateMockRead(*stream1_body), @@ -5369,27 +5369,27 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushCrossOriginCorrectness) { const char* url_to_fetch = kTestCases[index]; const char* url_to_push = kTestCases[index + 1]; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(url_to_fetch, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> push_rst( - ConstructSpdyRstStream(2, spdy::REFUSED_STREAM)); + scoped_ptr<SpdyFrame> push_rst( + ConstructSpdyRstStream(2, REFUSED_STREAM)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*push_rst, 4), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, 1, url_to_push)); - scoped_ptr<spdy::SpdyFrame> rst( - ConstructSpdyRstStream(2, spdy::CANCEL)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(2, CANCEL)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), @@ -5447,17 +5447,17 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushCrossOriginCorrectness) { TEST_P(SpdyNetworkTransactionSpdy2Test, RetryAfterRefused) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req, 1), CreateMockWrite(*req2, 3), }; - scoped_ptr<spdy::SpdyFrame> refused( - ConstructSpdyRstStream(1, spdy::REFUSED_STREAM)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> refused( + ConstructSpdyRstStream(1, REFUSED_STREAM)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(3, true)); MockRead reads[] = { CreateMockRead(*refused, 2), CreateMockRead(*resp, 4), diff --git a/net/spdy/spdy_network_transaction_spdy3_unittest.cc b/net/spdy/spdy_network_transaction_spdy3_unittest.cc index 6d038c6..d0c771d 100644 --- a/net/spdy/spdy_network_transaction_spdy3_unittest.cc +++ b/net/spdy/spdy_network_transaction_spdy3_unittest.cc @@ -545,11 +545,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, Constructor) { TEST_P(SpdyNetworkTransactionSpdy3Test, Get) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -572,10 +572,10 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, GetAtEachPriority) { for (RequestPriority p = HIGHEST; p < NUM_PRIORITIES; p = RequestPriority(p+1)) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, p)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, p)); MockWrite writes[] = { CreateMockWrite(*req) }; - const int spdy_prio = reinterpret_cast<spdy::SpdySynStreamControlFrame*>( + const int spdy_prio = reinterpret_cast<SpdySynStreamControlFrame*>( req.get())->priority(); // this repeats the RequestPriority-->SpdyPriority mapping from // SpdyFramer::ConvertRequestPriorityToSpdyPriority to make @@ -598,8 +598,8 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, GetAtEachPriority) { FAIL(); } - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -632,20 +632,20 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, GetAtEachPriority) { // can allow multiple streams in flight. TEST_P(SpdyNetworkTransactionSpdy3Test, ThreeGets) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); - scoped_ptr<spdy::SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 5)); - scoped_ptr<spdy::SpdyFrame> body3(ConstructSpdyBodyFrame(5, false)); - scoped_ptr<spdy::SpdyFrame> fbody3(ConstructSpdyBodyFrame(5, true)); + scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, LOWEST)); + scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 5)); + scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(5, false)); + scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(5, true)); MockWrite writes[] = { CreateMockWrite(*req), @@ -727,15 +727,15 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ThreeGets) { } TEST_P(SpdyNetworkTransactionSpdy3Test, TwoGetsLateBinding) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); MockWrite writes[] = { CreateMockWrite(*req), @@ -814,15 +814,15 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, TwoGetsLateBinding) { } TEST_P(SpdyNetworkTransactionSpdy3Test, TwoGetsLateBindingFromPreconnect) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); MockWrite writes[] = { CreateMockWrite(*req), @@ -920,27 +920,27 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, TwoGetsLateBindingFromPreconnect) { // second transaction completes, so we can assert on read_index(). TEST_P(SpdyNetworkTransactionSpdy3Test, ThreeGetsWithMaxConcurrent) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); - - scoped_ptr<spdy::SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 5)); - scoped_ptr<spdy::SpdyFrame> body3(ConstructSpdyBodyFrame(5, false)); - scoped_ptr<spdy::SpdyFrame> fbody3(ConstructSpdyBodyFrame(5, true)); - - spdy::SpdySettings settings; - spdy::SettingsFlagsAndId id(0, spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + + scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, LOWEST)); + scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 5)); + scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(5, false)); + scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(5, true)); + + SpdySettings settings; + SettingsFlagsAndId id(0, SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 1; - settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); - scoped_ptr<spdy::SpdyFrame> settings_frame(ConstructSpdySettings(settings)); + settings.push_back(SpdySetting(id, max_concurrent_streams)); + scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); MockWrite writes[] = { CreateMockWrite(*req), @@ -1052,33 +1052,33 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ThreeGetsWithMaxConcurrent) { // the response from the server. TEST_P(SpdyNetworkTransactionSpdy3Test, FourGetsWithMaxConcurrentPriority) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); - scoped_ptr<spdy::SpdyFrame> req4( + scoped_ptr<SpdyFrame> req4( ConstructSpdyGet(NULL, 0, false, 5, HIGHEST)); - scoped_ptr<spdy::SpdyFrame> resp4(ConstructSpdyGetSynReply(NULL, 0, 5)); - scoped_ptr<spdy::SpdyFrame> fbody4(ConstructSpdyBodyFrame(5, true)); + scoped_ptr<SpdyFrame> resp4(ConstructSpdyGetSynReply(NULL, 0, 5)); + scoped_ptr<SpdyFrame> fbody4(ConstructSpdyBodyFrame(5, true)); - scoped_ptr<spdy::SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 7, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 7)); - scoped_ptr<spdy::SpdyFrame> body3(ConstructSpdyBodyFrame(7, false)); - scoped_ptr<spdy::SpdyFrame> fbody3(ConstructSpdyBodyFrame(7, true)); + scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 7, LOWEST)); + scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 7)); + scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(7, false)); + scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(7, true)); - spdy::SpdySettings settings; - spdy::SettingsFlagsAndId id(0, spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + SpdySettings settings; + SettingsFlagsAndId id(0, SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 1; - settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); - scoped_ptr<spdy::SpdyFrame> settings_frame(ConstructSpdySettings(settings)); + settings.push_back(SpdySetting(id, max_concurrent_streams)); + scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*req2), @@ -1207,22 +1207,22 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, FourGetsWithMaxConcurrentPriority) { // the spdy_session TEST_P(SpdyNetworkTransactionSpdy3Test, ThreeGetsWithMaxConcurrentDelete) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); - - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); - scoped_ptr<spdy::SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); - - spdy::SpdySettings settings; - spdy::SettingsFlagsAndId id(0, spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); + + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); + scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); + + SpdySettings settings; + SettingsFlagsAndId id(0, SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 1; - settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); - scoped_ptr<spdy::SpdyFrame> settings_frame(ConstructSpdySettings(settings)); + settings.push_back(SpdySetting(id, max_concurrent_streams)); + scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*req2), @@ -1344,20 +1344,20 @@ class KillerCallback : public TestCompletionCallbackBase { // a pending stream creation. http://crbug.com/52901 TEST_P(SpdyNetworkTransactionSpdy3Test, ThreeGetsWithMaxConcurrentSocketClose) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> fin_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> fin_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); - spdy::SpdySettings settings; - spdy::SettingsFlagsAndId id(0, spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + SpdySettings settings; + SettingsFlagsAndId id(0, SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 1; - settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); - scoped_ptr<spdy::SpdyFrame> settings_frame(ConstructSpdySettings(settings)); + settings.push_back(SpdySetting(id, max_concurrent_streams)); + scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*req2), @@ -1442,16 +1442,16 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, Put) { request.url = GURL("http://www.google.com/"); const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_STREAM, // Kind = Syn + SYN_STREAM, // Kind = Syn 1, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_FIN, // Control Flags + CONTROL_FLAG_FIN, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; const char* const kPutHeaders[] = { ":method", "PUT", @@ -1461,31 +1461,31 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, Put) { ":version", "HTTP/1.1", "content-length", "0" }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPacket(kSynStartHeader, NULL, 0, + scoped_ptr<SpdyFrame> req(ConstructSpdyPacket(kSynStartHeader, NULL, 0, kPutHeaders, arraysize(kPutHeaders) / 2)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); const SpdyHeaderInfo kSynReplyHeader = { - spdy::SYN_REPLY, // Kind = SynReply + SYN_REPLY, // Kind = SynReply 1, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; static const char* const kStandardGetHeaders[] = { "status", "200", "version", "HTTP/1.1" "content-length", "1234" }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPacket(kSynReplyHeader, + scoped_ptr<SpdyFrame> resp(ConstructSpdyPacket(kSynReplyHeader, NULL, 0, kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); MockRead reads[] = { CreateMockRead(*resp), @@ -1513,16 +1513,16 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, Head) { request.url = GURL("http://www.google.com/"); const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_STREAM, // Kind = Syn + SYN_STREAM, // Kind = Syn 1, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_FIN, // Control Flags + CONTROL_FLAG_FIN, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; const char* const kHeadHeaders[] = { ":method", "HEAD", @@ -1532,31 +1532,31 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, Head) { ":version", "HTTP/1.1", "content-length", "0" }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPacket(kSynStartHeader, NULL, 0, + scoped_ptr<SpdyFrame> req(ConstructSpdyPacket(kSynStartHeader, NULL, 0, kHeadHeaders, arraysize(kHeadHeaders) / 2)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); const SpdyHeaderInfo kSynReplyHeader = { - spdy::SYN_REPLY, // Kind = SynReply + SYN_REPLY, // Kind = SynReply 1, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; static const char* const kStandardGetHeaders[] = { "status", "200", "version", "HTTP/1.1" "content-length", "1234" }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPacket(kSynReplyHeader, + scoped_ptr<SpdyFrame> resp(ConstructSpdyPacket(kSynReplyHeader, NULL, 0, kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); MockRead reads[] = { CreateMockRead(*resp), @@ -1578,14 +1578,14 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, Head) { // Test that a simple POST works. TEST_P(SpdyNetworkTransactionSpdy3Test, Post) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPost(kUploadDataSize, NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyPost(kUploadDataSize, NULL, 0)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*body), // POST upload frame }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -1607,16 +1607,16 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, Post) { // Test that a chunked POST works. TEST_P(SpdyNetworkTransactionSpdy3Test, ChunkedPost) { UploadDataStream::set_merge_chunks(false); - scoped_ptr<spdy::SpdyFrame> req(ConstructChunkedSpdyPost(NULL, 0)); - scoped_ptr<spdy::SpdyFrame> chunk1(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> chunk2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructChunkedSpdyPost(NULL, 0)); + scoped_ptr<SpdyFrame> chunk1(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> chunk2(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*chunk1), CreateMockWrite(*chunk2), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*chunk1), @@ -1647,15 +1647,15 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, NullPost) { // When request.upload_data is NULL for post, content-length is // expected to be 0. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPost(0, NULL, 0)); + scoped_ptr<SpdyFrame> req(ConstructSpdyPost(0, NULL, 0)); // Set the FIN bit since there will be no body. - req->set_flags(spdy::CONTROL_FLAG_FIN); + req->set_flags(CONTROL_FLAG_FIN); MockWrite writes[] = { CreateMockWrite(*req), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -1692,17 +1692,17 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, EmptyPost) { ASSERT_EQ(request.upload_data->GetContentLengthSync(), stream->size()); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> req(ConstructSpdyPost( request.upload_data->GetContentLengthSync(), NULL, 0)); // Set the FIN bit since there will be no body. - req->set_flags(spdy::CONTROL_FLAG_FIN); + req->set_flags(CONTROL_FLAG_FIN); MockWrite writes[] = { CreateMockWrite(*req), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -1740,8 +1740,8 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, PostWithEarlySynReply) { ASSERT_EQ(OK, stream->Init()); ASSERT_EQ(request.upload_data->GetContentLengthSync(), stream->size()); - scoped_ptr<spdy::SpdyFrame> stream_reply(ConstructSpdyPostSynReply(NULL, 0)); - scoped_ptr<spdy::SpdyFrame> stream_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> stream_reply(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> stream_body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream_reply, 2), CreateMockRead(*stream_body, 3), @@ -1765,16 +1765,16 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, PostWithEarlySynReply) { // socket causes the TCP write to return zero. This test checks that the client // tries to queue up the RST_STREAM frame again. TEST_P(SpdyNetworkTransactionSpdy3Test, SocketWriteReturnsZero) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> rst( - ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(1, CANCEL)); MockWrite writes[] = { CreateMockWrite(*req.get(), 0, SYNCHRONOUS), MockWrite(SYNCHRONOUS, 0, 0, 2), CreateMockWrite(*rst.get(), 3, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp.get(), 1, ASYNC), MockRead(ASYNC, 0, 0, 4) // EOF @@ -1806,7 +1806,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SocketWriteReturnsZero) { // Test that the transaction doesn't crash when we don't have a reply. TEST_P(SpdyNetworkTransactionSpdy3Test, ResponseWithoutSynReply) { - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*body), MockRead(ASYNC, 0, 0) // EOF @@ -1824,11 +1824,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ResponseWithoutSynReply) { // Test that the transaction doesn't crash when we get two replies on the same // stream ID. See http://crbug.com/45639. TEST_P(SpdyNetworkTransactionSpdy3Test, ResponseWithTwoSynReplies) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*resp), @@ -1889,11 +1889,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, WindowUpdateReceived) { static int kFrameCount = 2; scoped_ptr<std::string> content( new std::string(kMaxSpdyFrameChunkSize, 'a')); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPost( + scoped_ptr<SpdyFrame> req(ConstructSpdyPost( kMaxSpdyFrameChunkSize * kFrameCount, NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body( + scoped_ptr<SpdyFrame> body( ConstructSpdyBodyFrame(1, content->c_str(), content->size(), false)); - scoped_ptr<spdy::SpdyFrame> body_end( + scoped_ptr<SpdyFrame> body_end( ConstructSpdyBodyFrame(1, content->c_str(), content->size(), true)); MockWrite writes[] = { @@ -1904,11 +1904,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, WindowUpdateReceived) { static const int32 kDeltaWindowSize = 0xff; static const int kDeltaCount = 4; - scoped_ptr<spdy::SpdyFrame> window_update( + scoped_ptr<SpdyFrame> window_update( ConstructSpdyWindowUpdate(1, kDeltaWindowSize)); - scoped_ptr<spdy::SpdyFrame> window_update_dummy( + scoped_ptr<SpdyFrame> window_update_dummy( ConstructSpdyWindowUpdate(2, kDeltaWindowSize)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); MockRead reads[] = { CreateMockRead(*window_update_dummy), CreateMockRead(*window_update_dummy), @@ -1950,7 +1950,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, WindowUpdateReceived) { SpdyHttpStream* stream = static_cast<SpdyHttpStream*>(trans->stream_.get()); ASSERT_TRUE(stream != NULL); ASSERT_TRUE(stream->stream() != NULL); - EXPECT_EQ(static_cast<int>(spdy::kSpdyStreamInitialWindowSize) + + EXPECT_EQ(static_cast<int>(kSpdyStreamInitialWindowSize) + kDeltaWindowSize * kDeltaCount - kMaxSpdyFrameChunkSize * kFrameCount, stream->stream()->send_window_size()); @@ -1960,8 +1960,8 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, WindowUpdateReceived) { // Test that received data frames and sent WINDOW_UPDATE frames change // the recv_window_size_ correctly. TEST_P(SpdyNetworkTransactionSpdy3Test, WindowUpdateSent) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> window_update( + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> window_update( ConstructSpdyWindowUpdate(1, kUploadDataSize)); MockWrite writes[] = { @@ -1969,11 +1969,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, WindowUpdateSent) { CreateMockWrite(*window_update), }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body_no_fin( + scoped_ptr<SpdyFrame> body_no_fin( ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> body_fin( + scoped_ptr<SpdyFrame> body_fin( ConstructSpdyBodyFrame(1, NULL, 0, true)); MockRead reads[] = { CreateMockRead(*resp), @@ -2007,7 +2007,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, WindowUpdateSent) { ASSERT_TRUE(stream->stream() != NULL); EXPECT_EQ( - static_cast<int>(spdy::kSpdyStreamInitialWindowSize) - kUploadDataSize, + static_cast<int>(kSpdyStreamInitialWindowSize) - kUploadDataSize, stream->stream()->recv_window_size()); const HttpResponseInfo* response = trans->GetResponseInfo(); @@ -2050,12 +2050,12 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, WindowUpdateOverflow) { scoped_ptr<std::string> content( new std::string(kMaxSpdyFrameChunkSize, 'a')); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPost( + scoped_ptr<SpdyFrame> req(ConstructSpdyPost( kMaxSpdyFrameChunkSize * kFrameCount, NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body( + scoped_ptr<SpdyFrame> body( ConstructSpdyBodyFrame(1, content->c_str(), content->size(), false)); - scoped_ptr<spdy::SpdyFrame> rst( - ConstructSpdyRstStream(1, spdy::FLOW_CONTROL_ERROR)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(1, FLOW_CONTROL_ERROR)); // We're not going to write a data frame with FIN, we'll receive a bad // WINDOW_UPDATE while sending a request and will send a RST_STREAM frame. @@ -2066,11 +2066,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, WindowUpdateOverflow) { }; static const int32 kDeltaWindowSize = 0x7fffffff; // cause an overflow - scoped_ptr<spdy::SpdyFrame> window_update( + scoped_ptr<SpdyFrame> window_update( ConstructSpdyWindowUpdate(1, kDeltaWindowSize)); - scoped_ptr<spdy::SpdyFrame> window_update2( + scoped_ptr<SpdyFrame> window_update2( ConstructSpdyWindowUpdate(2, kDeltaWindowSize)); - scoped_ptr<spdy::SpdyFrame> reply(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> reply(ConstructSpdyPostSynReply(NULL, 0)); MockRead reads[] = { CreateMockRead(*window_update2), @@ -2137,29 +2137,29 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, FlowControlStallResume) { // data frame that we will send once the WINDOW_UPDATE is received, // therefore +3. size_t nwrites = - spdy::kSpdyStreamInitialWindowSize / kMaxSpdyFrameChunkSize + 3; + kSpdyStreamInitialWindowSize / kMaxSpdyFrameChunkSize + 3; // Calculate last frame's size; 0 size data frame is legal. size_t last_frame_size = - spdy::kSpdyStreamInitialWindowSize % kMaxSpdyFrameChunkSize; + kSpdyStreamInitialWindowSize % kMaxSpdyFrameChunkSize; // Construct content for a data frame of maximum size. scoped_ptr<std::string> content( new std::string(kMaxSpdyFrameChunkSize, 'a')); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPost( - spdy::kSpdyStreamInitialWindowSize + kUploadDataSize, NULL, 0)); + scoped_ptr<SpdyFrame> req(ConstructSpdyPost( + kSpdyStreamInitialWindowSize + kUploadDataSize, NULL, 0)); // Full frames. - scoped_ptr<spdy::SpdyFrame> body1( + scoped_ptr<SpdyFrame> body1( ConstructSpdyBodyFrame(1, content->c_str(), content->size(), false)); // Last frame to zero out the window size. - scoped_ptr<spdy::SpdyFrame> body2( + scoped_ptr<SpdyFrame> body2( ConstructSpdyBodyFrame(1, content->c_str(), last_frame_size, false)); // Data frame to be sent once WINDOW_UPDATE frame is received. - scoped_ptr<spdy::SpdyFrame> body3(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(1, true)); // Fill in mock writes. scoped_array<MockWrite> writes(new MockWrite[nwrites]); @@ -2172,9 +2172,9 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, FlowControlStallResume) { // Construct read frame, give enough space to upload the rest of the // data. - scoped_ptr<spdy::SpdyFrame> window_update( + scoped_ptr<SpdyFrame> window_update( ConstructSpdyWindowUpdate(1, kUploadDataSize)); - scoped_ptr<spdy::SpdyFrame> reply(ConstructSpdyPostSynReply(NULL, 0)); + scoped_ptr<SpdyFrame> reply(ConstructSpdyPostSynReply(NULL, 0)); MockRead reads[] = { CreateMockRead(*window_update), CreateMockRead(*window_update), @@ -2195,7 +2195,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, FlowControlStallResume) { request.url = GURL("http://www.google.com/"); request.upload_data = new UploadData(); scoped_ptr<std::string> upload_data( - new std::string(spdy::kSpdyStreamInitialWindowSize, 'a')); + new std::string(kSpdyStreamInitialWindowSize, 'a')); upload_data->append(kUploadData, kUploadDataSize); request.upload_data->AppendBytes(upload_data->c_str(), upload_data->size()); NormalSpdyTransactionHelper helper(request, @@ -2229,12 +2229,12 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, FlowControlStallResume) { TEST_P(SpdyNetworkTransactionSpdy3Test, CancelledTransaction) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), // This following read isn't used by the test, except during the @@ -2267,15 +2267,15 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, CancelledTransaction) { // Verify that the client sends a Rst Frame upon cancelling the stream. TEST_P(SpdyNetworkTransactionSpdy3Test, CancelledTransactionSendRst) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> rst( - ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(1, CANCEL)); MockWrite writes[] = { CreateMockWrite(*req, 0, SYNCHRONOUS), CreateMockWrite(*rst, 2, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 0, 3) // EOF @@ -2312,7 +2312,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, CancelledTransactionSendRst) { // to start another transaction on a session that is closing down. See // http://crbug.com/47455 TEST_P(SpdyNetworkTransactionSpdy3Test, StartTransactionOnReadCallback) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; MockWrite writes2[] = { CreateMockWrite(*req) }; @@ -2325,7 +2325,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, StartTransactionOnReadCallback) { 'h', 'e', 'l', 'l', 'o', '!', }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp, 2), MockRead(ASYNC, ERR_IO_PENDING, 3), // Force a pause @@ -2376,11 +2376,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, StartTransactionOnReadCallback) { // transaction. Failures will usually be valgrind errors. See // http://crbug.com/46925 TEST_P(SpdyNetworkTransactionSpdy3Test, DeleteSessionOnReadCallback) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp.get(), 2), MockRead(ASYNC, ERR_IO_PENDING, 3), // Force a pause @@ -2427,7 +2427,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, RedirectGetRequest) { "accept-encoding", "gzip,deflate", }; - const SpdyHeaderInfo kSynStartHeader = MakeSpdyHeader(spdy::SYN_STREAM); + const SpdyHeaderInfo kSynStartHeader = MakeSpdyHeader(SYN_STREAM); const char* const kStandardGetHeaders[] = { ":host", "www.google.com", @@ -2458,13 +2458,13 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, RedirectGetRequest) { }; // Setup writes/reads to www.google.com - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyPacket( + scoped_ptr<SpdyFrame> req(ConstructSpdyPacket( kSynStartHeader, kExtraHeaders, arraysize(kExtraHeaders) / 2, kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyPacket( + scoped_ptr<SpdyFrame> req2(ConstructSpdyPacket( kSynStartHeader, kExtraHeaders, arraysize(kExtraHeaders) / 2, kStandardGetHeaders2, arraysize(kStandardGetHeaders2) / 2)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReplyRedirect(1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReplyRedirect(1)); MockWrite writes[] = { CreateMockWrite(*req, 1), }; @@ -2474,8 +2474,8 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, RedirectGetRequest) { }; // Setup writes/reads to www.foo.com - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); MockWrite writes2[] = { CreateMockWrite(*req2, 1), }; @@ -2527,17 +2527,17 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, RedirectGetRequest) { // Detect response with upper case headers and reset the stream. TEST_P(SpdyNetworkTransactionSpdy3Test, UpperCaseHeaders) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> - rst(ConstructSpdyRstStream(1, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + rst(ConstructSpdyRstStream(1, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*syn, 0), CreateMockWrite(*rst, 2), }; const char* const kExtraHeaders[] = {"X-UpperCase", "yes"}; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> reply(ConstructSpdyGetSynReply(kExtraHeaders, 1, 1)); MockRead reads[] = { CreateMockRead(*reply, 1), @@ -2561,10 +2561,10 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, UpperCaseHeaders) { // Detect response with upper case headers in a HEADERS frame and reset the // stream. TEST_P(SpdyNetworkTransactionSpdy3Test, UpperCaseHeadersInHeadersFrame) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> - rst(ConstructSpdyRstStream(1, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + rst(ConstructSpdyRstStream(1, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*syn, 0), CreateMockWrite(*rst, 2), @@ -2577,29 +2577,29 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, UpperCaseHeadersInHeadersFrame) { static const char* const kLateHeaders[] = { "X-UpperCase", "yes", }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 1, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream1_reply), CreateMockRead(*stream1_headers), @@ -2619,21 +2619,21 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, UpperCaseHeadersInHeadersFrame) { // Detect push stream with upper case headers and reset the stream. TEST_P(SpdyNetworkTransactionSpdy3Test, UpperCaseHeadersOnPush) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> - rst(ConstructSpdyRstStream(2, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*syn, 0), CreateMockWrite(*rst, 2), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> reply(ConstructSpdyGetSynReply(NULL, 0, 1)); const char* const extra_headers[] = {"X-UpperCase", "yes"}; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> push(ConstructSpdyPush(extra_headers, 1, 2, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*reply, 1), CreateMockRead(*push, 1), @@ -2663,7 +2663,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, RedirectServerPush) { "accept-encoding", "gzip,deflate", }; - const SpdyHeaderInfo kSynStartHeader = MakeSpdyHeader(spdy::SYN_STREAM); + const SpdyHeaderInfo kSynStartHeader = MakeSpdyHeader(SYN_STREAM); const char* const kStandardGetHeaders[] = { ":host", "www.google.com", @@ -2680,14 +2680,14 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, RedirectServerPush) { }; // Setup writes/reads to www.google.com - scoped_ptr<spdy::SpdyFrame> req( + scoped_ptr<SpdyFrame> req( ConstructSpdyPacket(kSynStartHeader, kExtraHeaders, arraysize(kExtraHeaders) / 2, kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> rep( + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> rep( ConstructSpdyPush(NULL, 0, 2, @@ -2695,8 +2695,8 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, RedirectServerPush) { "http://www.google.com/foo.dat", "301 Moved Permanently", "http://www.foo.com/index.php")); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> rst(ConstructSpdyRstStream(2, spdy::CANCEL)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(2, CANCEL)); MockWrite writes[] = { CreateMockWrite(*req, 1), CreateMockWrite(*rst, 6), @@ -2724,14 +2724,14 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, RedirectServerPush) { ":version", "HTTP/1.1" }; - scoped_ptr<spdy::SpdyFrame> req2( + scoped_ptr<SpdyFrame> req2( ConstructSpdyPacket(kSynStartHeader, kExtraHeaders, arraysize(kExtraHeaders) / 2, kStandardGetHeaders2, arraysize(kStandardGetHeaders2) / 2)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); MockWrite writes2[] = { CreateMockWrite(*req2, 1), }; @@ -2799,17 +2799,17 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushSingleDataFrame) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -2852,17 +2852,17 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushBeforeSynReply) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -2905,21 +2905,21 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushSingleDataFrame2) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, 1, "http://www.google.com/foo.dat")); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), @@ -2953,24 +2953,24 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushSingleDataFrame2) { } TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushServerAborted) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, 1, "http://www.google.com/foo.dat")); - scoped_ptr<spdy::SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + stream2_rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), CreateMockRead(*stream2_syn, 3), @@ -3023,26 +3023,26 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushDuplicate) { 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> - stream3_rst(ConstructSpdyRstStream(4, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + stream3_rst(ConstructSpdyRstStream(4, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream3_rst, 5), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, 1, "http://www.google.com/foo.dat")); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream3_syn(ConstructSpdyPush(NULL, 0, 4, @@ -3090,17 +3090,17 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushMultipleDataFrame) { static const char kPushBodyFrame3[] = " hello"; static const char kPushBodyFrame4[] = " my baby"; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -3154,17 +3154,17 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, static const char kPushBodyFrame3[] = " hello"; static const char kPushBodyFrame4[] = " my baby"; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -3209,20 +3209,20 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, } TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushInvalidAssociatedStreamID0) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, spdy::INVALID_STREAM)); + scoped_ptr<SpdyFrame> + stream2_rst(ConstructSpdyRstStream(2, INVALID_STREAM)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream2_rst, 4), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -3271,20 +3271,20 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushInvalidAssociatedStreamID0) { } TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushInvalidAssociatedStreamID9) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, spdy::INVALID_ASSOCIATED_STREAM)); + scoped_ptr<SpdyFrame> + stream2_rst(ConstructSpdyRstStream(2, INVALID_ASSOCIATED_STREAM)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream2_rst, 4), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, @@ -3333,20 +3333,20 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushInvalidAssociatedStreamID9) { } TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushNoURL) { - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> + stream2_rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream2_rst, 4), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, 1)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), @@ -3429,15 +3429,15 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SynReplyHeaders) { }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { - scoped_ptr<spdy::SpdyFrame> req( + scoped_ptr<SpdyFrame> req( ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdyGetSynReply(test_cases[i].extra_headers, test_cases[i].num_headers, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -3474,17 +3474,17 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SynReplyHeaders) { // through the HTTP layer, and the response matches the request. TEST_P(SpdyNetworkTransactionSpdy3Test, SynReplyHeadersVary) { static const SpdyHeaderInfo syn_reply_info = { - spdy::SYN_REPLY, // Syn Reply + SYN_REPLY, // Syn Reply 1, // Stream ID 0, // Associated Stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Data Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; // Modify the following data to change/add test cases: struct SynReplyTests { @@ -3559,7 +3559,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SynReplyHeadersVary) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> frame_req( + scoped_ptr<SpdyFrame> frame_req( ConstructSpdyGet(test_cases[i].extra_headers[0], test_cases[i].num_headers[0], false, 1, LOWEST)); @@ -3569,14 +3569,14 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SynReplyHeadersVary) { }; // Construct the reply. - scoped_ptr<spdy::SpdyFrame> frame_reply( + scoped_ptr<SpdyFrame> frame_reply( ConstructSpdyPacket(*test_cases[i].syn_reply, test_cases[i].extra_headers[1], test_cases[i].num_headers[1], NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*frame_reply), CreateMockRead(*body), @@ -3643,17 +3643,17 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SynReplyHeadersVary) { // Verify that we don't crash on invalid SynReply responses. TEST_P(SpdyNetworkTransactionSpdy3Test, InvalidSynReply) { const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_REPLY, // Kind = SynReply + SYN_REPLY, // Kind = SynReply 1, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; struct InvalidSynReplyTests { @@ -3681,18 +3681,18 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, InvalidSynReply) { }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { - scoped_ptr<spdy::SpdyFrame> req( + scoped_ptr<SpdyFrame> req( ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req), }; - scoped_ptr<spdy::SpdyFrame> resp( + scoped_ptr<SpdyFrame> resp( ConstructSpdyPacket(kSynStartHeader, NULL, 0, test_cases[i].headers, test_cases[i].num_headers)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -3713,25 +3713,25 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, InvalidSynReply) { // Verify that we don't crash on some corrupt frames. TEST_P(SpdyNetworkTransactionSpdy3Test, CorruptFrameSessionError) { // This is the length field that's too short. - scoped_ptr<spdy::SpdyFrame> syn_reply_wrong_length( + scoped_ptr<SpdyFrame> syn_reply_wrong_length( ConstructSpdyGetSynReply(NULL, 0, 1)); syn_reply_wrong_length->set_length(syn_reply_wrong_length->length() - 4); struct SynReplyTests { - const spdy::SpdyFrame* syn_reply; + const SpdyFrame* syn_reply; } test_cases[] = { { syn_reply_wrong_length.get(), }, }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { - scoped_ptr<spdy::SpdyFrame> req( + scoped_ptr<SpdyFrame> req( ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req), MockWrite(ASYNC, 0, 0) // EOF }; - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*test_cases[i].syn_reply), CreateMockRead(*body), @@ -3751,7 +3751,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, CorruptFrameSessionError) { // Test that we shutdown correctly on write errors. TEST_P(SpdyNetworkTransactionSpdy3Test, WriteError) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { // We'll write 10 bytes successfully MockWrite(ASYNC, req->data(), 10), @@ -3773,12 +3773,12 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, WriteError) { // Test that partial writes work. TEST_P(SpdyNetworkTransactionSpdy3Test, PartialWrite) { // Chop the SYN_STREAM frame into 5 chunks. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); const int kChunks = 5; scoped_array<MockWrite> writes(ChopWriteFrame(*req.get(), kChunks)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -3801,18 +3801,18 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, PartialWrite) { // the server. Verify that teardown is all clean. TEST_P(SpdyNetworkTransactionSpdy3Test, DecompressFailureOnSynReply) { // For this test, we turn on the normal compression. - spdy::SpdyFramer::set_enable_compression_default(true); + SpdyFramer::set_enable_compression_default(true); - scoped_ptr<spdy::SpdyFrame> compressed( + scoped_ptr<SpdyFrame> compressed( ConstructSpdyGet(NULL, 0, true, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> rst( - ConstructSpdyRstStream(1, spdy::PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(1, PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*compressed), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), }; @@ -3833,12 +3833,12 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, NetLog) { static const char* const kExtraHeaders[] = { "user-agent", "Chrome", }; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(kExtraHeaders, 1, false, 1, + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(kExtraHeaders, 1, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -3894,10 +3894,10 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, NetLog) { CapturingNetLog::Entry entry = entries[pos]; NetLogSpdySynParameter* request_params = static_cast<NetLogSpdySynParameter*>(entry.extra_parameters.get()); - spdy::SpdyHeaderBlock* headers = + SpdyHeaderBlock* headers = request_params->GetHeaders().get(); - spdy::SpdyHeaderBlock expected; + SpdyHeaderBlock expected; expected[":host"] = "www.google.com"; expected[":path"] = "/"; expected[":scheme"] = "http"; @@ -3905,8 +3905,8 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, NetLog) { expected[":method"] = "GET"; expected["user-agent"] = "Chrome"; EXPECT_EQ(expected.size(), headers->size()); - spdy::SpdyHeaderBlock::const_iterator end = expected.end(); - for (spdy::SpdyHeaderBlock::const_iterator it = expected.begin(); + SpdyHeaderBlock::const_iterator end = expected.end(); + for (SpdyHeaderBlock::const_iterator it = expected.begin(); it != end; ++it) { EXPECT_EQ(it->second, (*headers)[it->first]); @@ -3918,17 +3918,17 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, NetLog) { // on the network, but issued a Read for only 5 of those bytes) that the data // flow still works correctly. TEST_P(SpdyNetworkTransactionSpdy3Test, BufferFull) { - spdy::BufferedSpdyFramer framer(3); + BufferedSpdyFramer framer(3); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // 2 data frames in a single read. - scoped_ptr<spdy::SpdyFrame> data_frame_1( - framer.CreateDataFrame(1, "goodby", 6, spdy::DATA_FLAG_NONE)); - scoped_ptr<spdy::SpdyFrame> data_frame_2( - framer.CreateDataFrame(1, "e worl", 6, spdy::DATA_FLAG_NONE)); - const spdy::SpdyFrame* data_frames[2] = { + scoped_ptr<SpdyFrame> data_frame_1( + framer.CreateDataFrame(1, "goodby", 6, DATA_FLAG_NONE)); + scoped_ptr<SpdyFrame> data_frame_2( + framer.CreateDataFrame(1, "e worl", 6, DATA_FLAG_NONE)); + const SpdyFrame* data_frames[2] = { data_frame_1.get(), data_frame_2.get(), }; @@ -3936,10 +3936,10 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, BufferFull) { int combined_data_frames_len = CombineFrames(data_frames, arraysize(data_frames), combined_data_frames, arraysize(combined_data_frames)); - scoped_ptr<spdy::SpdyFrame> last_frame( - framer.CreateDataFrame(1, "d", 1, spdy::DATA_FLAG_FIN)); + scoped_ptr<SpdyFrame> last_frame( + framer.CreateDataFrame(1, "d", 1, DATA_FLAG_FIN)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), MockRead(ASYNC, ERR_IO_PENDING), // Force a pause @@ -4013,17 +4013,17 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, BufferFull) { // at the same time, ensure that we don't notify a read completion for // each data frame individually. TEST_P(SpdyNetworkTransactionSpdy3Test, Buffering) { - spdy::BufferedSpdyFramer framer(3); + BufferedSpdyFramer framer(3); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // 4 data frames in a single read. - scoped_ptr<spdy::SpdyFrame> data_frame( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_NONE)); - scoped_ptr<spdy::SpdyFrame> data_frame_fin( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_FIN)); - const spdy::SpdyFrame* data_frames[4] = { + scoped_ptr<SpdyFrame> data_frame( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_NONE)); + scoped_ptr<SpdyFrame> data_frame_fin( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_FIN)); + const SpdyFrame* data_frames[4] = { data_frame.get(), data_frame.get(), data_frame.get(), @@ -4034,7 +4034,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, Buffering) { CombineFrames(data_frames, arraysize(data_frames), combined_data_frames, arraysize(combined_data_frames)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), MockRead(ASYNC, ERR_IO_PENDING), // Force a pause @@ -4108,20 +4108,20 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, Buffering) { // Verify the case where we buffer data but read it after it has been buffered. TEST_P(SpdyNetworkTransactionSpdy3Test, BufferedAll) { - spdy::BufferedSpdyFramer framer(3); + BufferedSpdyFramer framer(3); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // 5 data frames in a single read. - scoped_ptr<spdy::SpdyFrame> syn_reply( + scoped_ptr<SpdyFrame> syn_reply( ConstructSpdyGetSynReply(NULL, 0, 1)); - syn_reply->set_flags(spdy::CONTROL_FLAG_NONE); // turn off FIN bit - scoped_ptr<spdy::SpdyFrame> data_frame( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_NONE)); - scoped_ptr<spdy::SpdyFrame> data_frame_fin( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_FIN)); - const spdy::SpdyFrame* frames[5] = { + syn_reply->set_flags(CONTROL_FLAG_NONE); // turn off FIN bit + scoped_ptr<SpdyFrame> data_frame( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_NONE)); + scoped_ptr<SpdyFrame> data_frame_fin( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_FIN)); + const SpdyFrame* frames[5] = { syn_reply.get(), data_frame.get(), data_frame.get(), @@ -4200,16 +4200,16 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, BufferedAll) { // Verify the case where we buffer data and close the connection. TEST_P(SpdyNetworkTransactionSpdy3Test, BufferedClosed) { - spdy::BufferedSpdyFramer framer(3); + BufferedSpdyFramer framer(3); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // All data frames in a single read. // NOTE: We don't FIN the stream. - scoped_ptr<spdy::SpdyFrame> data_frame( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_NONE)); - const spdy::SpdyFrame* data_frames[4] = { + scoped_ptr<SpdyFrame> data_frame( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_NONE)); + const SpdyFrame* data_frames[4] = { data_frame.get(), data_frame.get(), data_frame.get(), @@ -4219,7 +4219,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, BufferedClosed) { int combined_data_frames_len = CombineFrames(data_frames, arraysize(data_frames), combined_data_frames, arraysize(combined_data_frames)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), MockRead(ASYNC, ERR_IO_PENDING), // Force a wait @@ -4291,16 +4291,16 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, BufferedClosed) { // Verify the case where we buffer data and cancel the transaction. TEST_P(SpdyNetworkTransactionSpdy3Test, BufferedCancelled) { - spdy::BufferedSpdyFramer framer(3); + BufferedSpdyFramer framer(3); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // NOTE: We don't FIN the stream. - scoped_ptr<spdy::SpdyFrame> data_frame( - framer.CreateDataFrame(1, "message", 7, spdy::DATA_FLAG_NONE)); + scoped_ptr<SpdyFrame> data_frame( + framer.CreateDataFrame(1, "message", 7, DATA_FLAG_NONE)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), MockRead(ASYNC, ERR_IO_PENDING), // Force a wait @@ -4364,17 +4364,17 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, BufferedCancelled) { // the settings in the SpdySettingsStorage. TEST_P(SpdyNetworkTransactionSpdy3Test, SettingsSaved) { static const SpdyHeaderInfo kSynReplyInfo = { - spdy::SYN_REPLY, // Syn Reply + SYN_REPLY, // Syn Reply 1, // Stream ID 0, // Associated Stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Data Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; static const char* const kExtraHeaders[] = { "status", "200", @@ -4392,11 +4392,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SettingsSaved) { host_port_pair).empty()); // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; // Construct the reply. - scoped_ptr<spdy::SpdyFrame> reply( + scoped_ptr<SpdyFrame> reply( ConstructSpdyPacket(kSynReplyInfo, kExtraHeaders, arraysize(kExtraHeaders) / 2, @@ -4409,25 +4409,25 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SettingsSaved) { unsigned int kSampleValue2 = 0x0b0b0b0b; unsigned int kSampleId3 = 0x3; unsigned int kSampleValue3 = 0x0c0c0c0c; - scoped_ptr<spdy::SpdyFrame> settings_frame; + scoped_ptr<SpdyFrame> settings_frame; { // Construct the SETTINGS frame. - spdy::SpdySettings settings; + SpdySettings settings; // First add a persisted setting - spdy::SettingsFlagsAndId setting1(spdy::SETTINGS_FLAG_PLEASE_PERSIST, + SettingsFlagsAndId setting1(SETTINGS_FLAG_PLEASE_PERSIST, kSampleId1); settings.push_back(std::make_pair(setting1, kSampleValue1)); // Next add a non-persisted setting - spdy::SettingsFlagsAndId setting2(0, kSampleId2); + SettingsFlagsAndId setting2(0, kSampleId2); settings.push_back(std::make_pair(setting2, kSampleValue2)); // Next add another persisted setting - spdy::SettingsFlagsAndId setting3(spdy::SETTINGS_FLAG_PLEASE_PERSIST, + SettingsFlagsAndId setting3(SETTINGS_FLAG_PLEASE_PERSIST, kSampleId3); settings.push_back(std::make_pair(setting3, kSampleValue3)); settings_frame.reset(ConstructSpdySettings(settings)); } - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*reply), CreateMockRead(*body), @@ -4450,22 +4450,22 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SettingsSaved) { #ifdef PERSIST_SPDY_SETTINGS { // Verify we had two persisted settings. - spdy::SpdySettings saved_settings = + SpdySettings saved_settings = spdy_session_pool->http_server_properties()->GetSpdySettings( host_port_pair); ASSERT_EQ(2u, saved_settings.size()); // Verify the first persisted setting. - spdy::SpdySetting setting = saved_settings.front(); + SpdySetting setting = saved_settings.front(); saved_settings.pop_front(); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, setting.first.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, setting.first.flags()); EXPECT_EQ(kSampleId1, setting.first.id()); EXPECT_EQ(kSampleValue1, setting.second); // Verify the second persisted setting. setting = saved_settings.front(); saved_settings.pop_front(); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, setting.first.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, setting.first.flags()); EXPECT_EQ(kSampleId3, setting.first.id()); EXPECT_EQ(kSampleValue3, setting.second); } @@ -4476,17 +4476,17 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SettingsSaved) { // server upon session establishment. TEST_P(SpdyNetworkTransactionSpdy3Test, SettingsPlayback) { static const SpdyHeaderInfo kSynReplyInfo = { - spdy::SYN_REPLY, // Syn Reply + SYN_REPLY, // Syn Reply 1, // Stream ID 0, // Associated Stream ID net::ConvertRequestPriorityToSpdyPriority(LOWEST), // Priority - spdy::CONTROL_FLAG_NONE, // Control Flags + CONTROL_FLAG_NONE, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Data Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; static const char* kExtraHeaders[] = { "status", "200", @@ -4509,13 +4509,13 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SettingsPlayback) { unsigned int kSampleValue2 = 0x0c0c0c0c; // Manually insert settings into the SpdySettingsStorage here. { - spdy::SpdySettings settings; + SpdySettings settings; // First add a persisted setting - spdy::SettingsFlagsAndId setting1(spdy::SETTINGS_FLAG_PLEASE_PERSIST, + SettingsFlagsAndId setting1(SETTINGS_FLAG_PLEASE_PERSIST, kSampleId1); settings.push_back(std::make_pair(setting1, kSampleValue1)); // Next add another persisted setting - spdy::SettingsFlagsAndId setting2(spdy::SETTINGS_FLAG_PLEASE_PERSIST, + SettingsFlagsAndId setting2(SETTINGS_FLAG_PLEASE_PERSIST, kSampleId2); settings.push_back(std::make_pair(setting2, kSampleValue2)); @@ -4527,13 +4527,13 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SettingsPlayback) { host_port_pair).size()); // Construct the SETTINGS frame. - const spdy::SpdySettings& settings = + const SpdySettings& settings = spdy_session_pool->http_server_properties()->GetSpdySettings( host_port_pair); - scoped_ptr<spdy::SpdyFrame> settings_frame(ConstructSpdySettings(settings)); + scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*settings_frame), @@ -4541,14 +4541,14 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SettingsPlayback) { }; // Construct the reply. - scoped_ptr<spdy::SpdyFrame> reply( + scoped_ptr<SpdyFrame> reply( ConstructSpdyPacket(kSynReplyInfo, kExtraHeaders, arraysize(kExtraHeaders) / 2, NULL, 0)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*reply), CreateMockRead(*body), @@ -4568,32 +4568,32 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SettingsPlayback) { { // Verify we had two persisted settings. - spdy::SpdySettings saved_settings = + SpdySettings saved_settings = spdy_session_pool->http_server_properties()->GetSpdySettings( host_port_pair); ASSERT_EQ(2u, saved_settings.size()); // Verify the first persisted setting. - spdy::SpdySetting setting = saved_settings.front(); + SpdySetting setting = saved_settings.front(); saved_settings.pop_front(); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, setting.first.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, setting.first.flags()); EXPECT_EQ(kSampleId1, setting.first.id()); EXPECT_EQ(kSampleValue1, setting.second); // Verify the second persisted setting. setting = saved_settings.front(); saved_settings.pop_front(); - EXPECT_EQ(spdy::SETTINGS_FLAG_PERSISTED, setting.first.flags()); + EXPECT_EQ(SETTINGS_FLAG_PERSISTED, setting.first.flags()); EXPECT_EQ(kSampleId2, setting.first.id()); EXPECT_EQ(kSampleValue2, setting.second); } } TEST_P(SpdyNetworkTransactionSpdy3Test, GoAwayWithActiveStream) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> go_away(ConstructSpdyGoAway()); + scoped_ptr<SpdyFrame> go_away(ConstructSpdyGoAway()); MockRead reads[] = { CreateMockRead(*go_away), MockRead(ASYNC, 0, 0), // EOF @@ -4611,10 +4611,10 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, GoAwayWithActiveStream) { } TEST_P(SpdyNetworkTransactionSpdy3Test, CloseWithActiveStream) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*resp), MockRead(SYNCHRONOUS, 0, 0) // EOF @@ -4666,9 +4666,9 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ProxyConnect) { "Host: www.google.com\r\n" "Proxy-Connection: keep-alive\r\n\r\n"}; const char kHTTP200[] = {"HTTP/1.1 200 OK\r\n\r\n"}; - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockWrite writes_SPDYNPN[] = { MockWrite(SYNCHRONOUS, kConnect443, arraysize(kConnect443) - 1, 0), @@ -4769,13 +4769,13 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, DirectConnectProxyReconnect) { helper.RunPreTestSetup(); // Construct and send a simple GET request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req, 1), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp, 2), CreateMockRead(*body, 3), @@ -4824,10 +4824,10 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, DirectConnectProxyReconnect) { "Host: www.google.com\r\n" "Proxy-Connection: keep-alive\r\n\r\n"}; const char kHTTP200[] = {"HTTP/1.1 200 OK\r\n\r\n"}; - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet( + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet( "http://www.google.com/foo.dat", false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); MockWrite writes_SPDYNPN[] = { MockWrite(SYNCHRONOUS, kConnect443, arraysize(kConnect443) - 1, 0), @@ -4929,8 +4929,8 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, DirectConnectProxyReconnect) { // This can happen when a server reboots without saying goodbye, or when // we're behind a NAT that masked the RST. TEST_P(SpdyNetworkTransactionSpdy3Test, VerifyRetryOnConnectionReset) { - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -5012,11 +5012,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, VerifyRetryOnConnectionReset) { // Test that turning SPDY on and off works properly. TEST_P(SpdyNetworkTransactionSpdy3Test, SpdyOnOffToggle) { net::HttpStreamFactory::set_spdy_enabled(true); - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); MockRead spdy_reads[] = { CreateMockRead(*resp), CreateMockRead(*body), @@ -5062,13 +5062,13 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SpdyBasicAuth) { // The first request will be a bare GET, the second request will be a // GET with an Authorization header. - scoped_ptr<spdy::SpdyFrame> req_get( + scoped_ptr<SpdyFrame> req_get( ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); const char* const kExtraAuthorizationHeaders[] = { "authorization", "Basic Zm9vOmJhcg==", }; - scoped_ptr<spdy::SpdyFrame> req_get_authorization( + scoped_ptr<SpdyFrame> req_get_authorization( ConstructSpdyGet( kExtraAuthorizationHeaders, arraysize(kExtraAuthorizationHeaders) / 2, @@ -5085,16 +5085,16 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SpdyBasicAuth) { "www-authenticate", "Basic realm=\"MyRealm\"" }; - scoped_ptr<spdy::SpdyFrame> resp_authentication( + scoped_ptr<SpdyFrame> resp_authentication( ConstructSpdySynReplyError( "401 Authentication Required", kExtraAuthenticationHeaders, arraysize(kExtraAuthenticationHeaders) / 2, 1)); - scoped_ptr<spdy::SpdyFrame> body_authentication( + scoped_ptr<SpdyFrame> body_authentication( ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> resp_data(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body_data(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> resp_data(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body_data(ConstructSpdyBodyFrame(3, true)); MockRead spdy_reads[] = { CreateMockRead(*resp_authentication, 2), CreateMockRead(*body_authentication, 3), @@ -5154,9 +5154,9 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushWithHeaders) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), @@ -5174,30 +5174,30 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushWithHeaders) { "version", "HTTP/1.1" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 2, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 2, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), @@ -5238,9 +5238,9 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushClaimBeforeHeaders) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 0, SYNCHRONOUS), @@ -5258,30 +5258,30 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushClaimBeforeHeaders) { "version", "HTTP/1.1" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 2, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 2, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*stream1_reply, 1), @@ -5375,9 +5375,9 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushWithTwoHeaderFrames) { 0x01, 0x00, 0x00, 0x06, // FIN, length 'p', 'u', 's', 'h', 'e', 'd' // "pushed" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 0, SYNCHRONOUS), @@ -5397,41 +5397,41 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushWithTwoHeaderFrames) { "version", "HTTP/1.1" }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 2, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_headers1(ConstructSpdyControlFrame(kMiddleHeaders, arraysize(kMiddleHeaders) / 2, false, 2, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_headers2(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 2, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { CreateMockRead(*stream1_reply, 1), @@ -5528,7 +5528,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushWithTwoHeaderFrames) { } TEST_P(SpdyNetworkTransactionSpdy3Test, SynReplyWithHeaders) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; static const char* const kInitialHeaders[] = { @@ -5541,29 +5541,29 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SynReplyWithHeaders) { "hello", "bye", }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 1, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream1_reply), CreateMockRead(*stream1_headers), @@ -5584,7 +5584,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SynReplyWithHeaders) { } TEST_P(SpdyNetworkTransactionSpdy3Test, SynReplyWithLateHeaders) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; static const char* const kInitialHeaders[] = { @@ -5597,30 +5597,30 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SynReplyWithLateHeaders) { "hello", "bye", }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 1, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> stream1_body2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> stream1_body2(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream1_reply), CreateMockRead(*stream1_body), @@ -5642,7 +5642,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SynReplyWithLateHeaders) { } TEST_P(SpdyNetworkTransactionSpdy3Test, SynReplyWithDuplicateLateHeaders) { - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req) }; static const char* const kInitialHeaders[] = { @@ -5655,30 +5655,30 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SynReplyWithDuplicateLateHeaders) { "status", "500 Server Error", }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyControlFrame(kInitialHeaders, arraysize(kInitialHeaders) / 2, false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_headers(ConstructSpdyControlFrame(kLateHeaders, arraysize(kLateHeaders) / 2, false, 1, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, NULL, 0, 0)); - scoped_ptr<spdy::SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, false)); - scoped_ptr<spdy::SpdyFrame> stream1_body2(ConstructSpdyBodyFrame(1, true)); + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, false)); + scoped_ptr<SpdyFrame> stream1_body2(ConstructSpdyBodyFrame(1, true)); MockRead reads[] = { CreateMockRead(*stream1_reply), CreateMockRead(*stream1_body), @@ -5733,27 +5733,27 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushCrossOriginCorrectness) { const char* url_to_fetch = kTestCases[index]; const char* url_to_push = kTestCases[index + 1]; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_syn(ConstructSpdyGet(url_to_fetch, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<spdy::SpdyFrame> push_rst( - ConstructSpdyRstStream(2, spdy::REFUSED_STREAM)); + scoped_ptr<SpdyFrame> push_rst( + ConstructSpdyRstStream(2, REFUSED_STREAM)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*push_rst, 4), }; - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream1_reply(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> + scoped_ptr<SpdyFrame> stream2_syn(ConstructSpdyPush(NULL, 0, 2, 1, url_to_push)); - scoped_ptr<spdy::SpdyFrame> rst( - ConstructSpdyRstStream(2, spdy::CANCEL)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(2, CANCEL)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), @@ -5811,17 +5811,17 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushCrossOriginCorrectness) { TEST_P(SpdyNetworkTransactionSpdy3Test, RetryAfterRefused) { // Construct the request. - scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); + scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); + scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req, 1), CreateMockWrite(*req2, 3), }; - scoped_ptr<spdy::SpdyFrame> refused( - ConstructSpdyRstStream(1, spdy::REFUSED_STREAM)); - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 3)); - scoped_ptr<spdy::SpdyFrame> body(ConstructSpdyBodyFrame(3, true)); + scoped_ptr<SpdyFrame> refused( + ConstructSpdyRstStream(1, REFUSED_STREAM)); + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 3)); + scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(3, true)); MockRead reads[] = { CreateMockRead(*refused, 2), CreateMockRead(*resp, 4), diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h index c6649f7..fa00d54 100644 --- a/net/spdy/spdy_protocol.h +++ b/net/spdy/spdy_protocol.h @@ -142,7 +142,7 @@ // +----------------------------------+ <+ // -namespace spdy { +namespace net { // Initial window size for a Spdy stream const int32 kSpdyStreamInitialWindowSize = 64 * 1024; // 64 KBytes @@ -1048,6 +1048,6 @@ class SpdyWindowUpdateControlFrame : public SpdyControlFrame { DISALLOW_COPY_AND_ASSIGN(SpdyWindowUpdateControlFrame); }; -} // namespace spdy +} // namespace net #endif // NET_SPDY_SPDY_PROTOCOL_H_ diff --git a/net/spdy/spdy_protocol_test.cc b/net/spdy/spdy_protocol_test.cc index c739c90..8362be9 100644 --- a/net/spdy/spdy_protocol_test.cc +++ b/net/spdy/spdy_protocol_test.cc @@ -9,40 +9,6 @@ #include "net/spdy/spdy_framer.h" #include "testing/platform_test.h" -using spdy::CONTROL_FLAG_FIN; -using spdy::CONTROL_FLAG_NONE; -using spdy::FlagsAndLength; -using spdy::GOAWAY; -using spdy::GOAWAY_INTERNAL_ERROR; -using spdy::HEADERS; -using spdy::NOOP; -using spdy::NUM_CONTROL_FRAME_TYPES; -using spdy::PING; -using spdy::RST_STREAM; -using spdy::SETTINGS; -using spdy::SYN_REPLY; -using spdy::SYN_STREAM; -using spdy::SettingsFlagsAndId; -using spdy::SpdyControlFrame; -using spdy::SpdyControlType; -using spdy::SpdyDataFrame; -using spdy::SpdyFrame; -using spdy::SpdyFramer; -using spdy::SpdyGoAwayControlFrame; -using spdy::SpdyHeaderBlock; -using spdy::SpdyHeadersControlFrame; -using spdy::SpdyPingControlFrame; -using spdy::SpdyRstStreamControlFrame; -using spdy::SpdySettings; -using spdy::SpdySettingsControlFrame; -using spdy::SpdyStatusCodes; -using spdy::SpdySynReplyControlFrame; -using spdy::SpdySynStreamControlFrame; -using spdy::SpdyWindowUpdateControlFrame; -using spdy::WINDOW_UPDATE; -using spdy::kLengthMask; -using spdy::kStreamIdMask; - namespace { enum SpdyProtocolTestTypes { @@ -50,6 +16,10 @@ enum SpdyProtocolTestTypes { SPDY3, }; +} // namespace + +namespace net { + class SpdyProtocolTest : public ::testing::TestWithParam<SpdyProtocolTestTypes> { protected: @@ -146,14 +116,14 @@ TEST_P(SpdyProtocolTest, ControlFrameStructs) { EXPECT_EQ(0, syn_reply->flags()); scoped_ptr<SpdyRstStreamControlFrame> rst_frame( - framer.CreateRstStream(123, spdy::PROTOCOL_ERROR)); + framer.CreateRstStream(123, PROTOCOL_ERROR)); EXPECT_EQ(framer.protocol_version(), rst_frame->version()); EXPECT_TRUE(rst_frame->is_control_frame()); EXPECT_EQ(RST_STREAM, rst_frame->type()); EXPECT_EQ(123u, rst_frame->stream_id()); - EXPECT_EQ(spdy::PROTOCOL_ERROR, rst_frame->status()); - rst_frame->set_status(spdy::INVALID_STREAM); - EXPECT_EQ(spdy::INVALID_STREAM, rst_frame->status()); + EXPECT_EQ(PROTOCOL_ERROR, rst_frame->status()); + rst_frame->set_status(INVALID_STREAM); + EXPECT_EQ(INVALID_STREAM, rst_frame->status()); EXPECT_EQ(0, rst_frame->flags()); const uint32 kUniqueId = 1234567u; @@ -382,10 +352,10 @@ TEST_P(SpdyProtocolDeathTest, TestSpdyControlFrameType) { frame.set_version(spdy_version_); uint16 version = frame.version(); - for (int i = SYN_STREAM; i <= spdy::WINDOW_UPDATE; ++i) { + for (int i = SYN_STREAM; i <= WINDOW_UPDATE; ++i) { frame.set_type(static_cast<SpdyControlType>(i)); EXPECT_EQ(i, static_cast<int>(frame.type())); - if (!IsSpdy2() && i == spdy::NOOP) { + if (!IsSpdy2() && i == NOOP) { // NOOP frames aren't 'valid'. EXPECT_FALSE(frame.AppearsToBeAValidControlFrame()); } else { @@ -401,18 +371,18 @@ TEST_P(SpdyProtocolDeathTest, TestRstStreamStatusBounds) { SpdyFramer framer(spdy_version_); scoped_ptr<SpdyRstStreamControlFrame> rst_frame; - rst_frame.reset(framer.CreateRstStream(123, spdy::PROTOCOL_ERROR)); - EXPECT_EQ(spdy::PROTOCOL_ERROR, rst_frame->status()); + rst_frame.reset(framer.CreateRstStream(123, PROTOCOL_ERROR)); + EXPECT_EQ(PROTOCOL_ERROR, rst_frame->status()); - rst_frame->set_status(spdy::INVALID); - EXPECT_EQ(spdy::INVALID, rst_frame->status()); + rst_frame->set_status(INVALID); + EXPECT_EQ(INVALID, rst_frame->status()); rst_frame->set_status( - static_cast<spdy::SpdyStatusCodes>(spdy::INVALID - 1)); - EXPECT_EQ(spdy::INVALID, rst_frame->status()); + static_cast<SpdyStatusCodes>(INVALID - 1)); + EXPECT_EQ(INVALID, rst_frame->status()); - rst_frame->set_status(spdy::NUM_STATUS_CODES); - EXPECT_EQ(spdy::INVALID, rst_frame->status()); + rst_frame->set_status(NUM_STATUS_CODES); + EXPECT_EQ(INVALID, rst_frame->status()); } -} // namespace +} // namespace net diff --git a/net/spdy/spdy_proxy_client_socket.cc b/net/spdy/spdy_proxy_client_socket.cc index 0575bb0..e5026db 100644 --- a/net/spdy/spdy_proxy_client_socket.cc +++ b/net/spdy/spdy_proxy_client_socket.cc @@ -230,7 +230,7 @@ int SpdyProxyClientSocket::Write(IOBuffer* buf, int buf_len, DCHECK(spdy_stream_); write_bytes_outstanding_= buf_len; if (buf_len <= kMaxSpdyFrameChunkSize) { - int rv = spdy_stream_->WriteStreamData(buf, buf_len, spdy::DATA_FLAG_NONE); + int rv = spdy_stream_->WriteStreamData(buf, buf_len, DATA_FLAG_NONE); if (rv == ERR_IO_PENDING) { write_callback_ = callback; write_buffer_len_ = buf_len; @@ -244,7 +244,7 @@ int SpdyProxyClientSocket::Write(IOBuffer* buf, int buf_len, int len = std::min(kMaxSpdyFrameChunkSize, buf_len - i); scoped_refptr<DrainableIOBuffer> iobuf(new DrainableIOBuffer(buf, i + len)); iobuf->SetOffset(i); - int rv = spdy_stream_->WriteStreamData(iobuf, len, spdy::DATA_FLAG_NONE); + int rv = spdy_stream_->WriteStreamData(iobuf, len, DATA_FLAG_NONE); if (rv > 0) { write_bytes_outstanding_ -= rv; } else if (rv != ERR_IO_PENDING) { @@ -370,7 +370,7 @@ int SpdyProxyClientSocket::DoSendRequest() { } request_.extra_headers.MergeFrom(request_headers); - linked_ptr<spdy::SpdyHeaderBlock> headers(new spdy::SpdyHeaderBlock()); + linked_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock()); CreateSpdyHeadersFromHttpRequest(request_, request_headers, headers.get(), spdy_stream_->GetProtocolVersion(), true); // Reset the URL to be the endpoint of the connection @@ -459,7 +459,7 @@ int SpdyProxyClientSocket::OnSendBodyComplete(int /*status*/, bool* /*eof*/) { } int SpdyProxyClientSocket::OnResponseReceived( - const spdy::SpdyHeaderBlock& response, + const SpdyHeaderBlock& response, base::Time response_time, int status) { // If we've already received the reply, existing headers are too late. diff --git a/net/spdy/spdy_proxy_client_socket.h b/net/spdy/spdy_proxy_client_socket.h index e7fd2c3..effdda3 100644 --- a/net/spdy/spdy_proxy_client_socket.h +++ b/net/spdy/spdy_proxy_client_socket.h @@ -92,7 +92,7 @@ class NET_EXPORT_PRIVATE SpdyProxyClientSocket : public ProxyClientSocket, virtual bool OnSendHeadersComplete(int status) OVERRIDE; virtual int OnSendBody() OVERRIDE; virtual int OnSendBodyComplete(int status, bool* eof) OVERRIDE; - virtual int OnResponseReceived(const spdy::SpdyHeaderBlock& response, + virtual int OnResponseReceived(const SpdyHeaderBlock& response, base::Time response_time, int status) OVERRIDE; virtual void OnDataReceived(const char* data, int length) OVERRIDE; diff --git a/net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc b/net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc index ce3adc7..702d2ca 100644 --- a/net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc +++ b/net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc @@ -32,7 +32,7 @@ using namespace net::test_spdy2; namespace { -static const char kUrl[] = "https://www.google.com/"; +static const char kRequestUrl[] = "https://www.google.com/"; static const char kOriginHost[] = "www.google.com"; static const int kOriginPort = 443; static const char kOriginHostPort[] = "www.google.com:443"; @@ -71,12 +71,12 @@ class SpdyProxyClientSocketSpdy2Test : public PlatformTest { void Initialize(MockRead* reads, size_t reads_count, MockWrite* writes, size_t writes_count); - spdy::SpdyFrame* ConstructConnectRequestFrame(); - spdy::SpdyFrame* ConstructConnectAuthRequestFrame(); - spdy::SpdyFrame* ConstructConnectReplyFrame(); - spdy::SpdyFrame* ConstructConnectAuthReplyFrame(); - spdy::SpdyFrame* ConstructConnectErrorReplyFrame(); - spdy::SpdyFrame* ConstructBodyFrame(const char* data, int length); + SpdyFrame* ConstructConnectRequestFrame(); + SpdyFrame* ConstructConnectAuthRequestFrame(); + SpdyFrame* ConstructConnectReplyFrame(); + SpdyFrame* ConstructConnectAuthReplyFrame(); + SpdyFrame* ConstructConnectErrorReplyFrame(); + SpdyFrame* ConstructBodyFrame(const char* data, int length); scoped_refptr<IOBufferWithSize> CreateBuffer(const char* data, int size); void AssertConnectSucceeds(); void AssertConnectFails(int result); @@ -119,7 +119,7 @@ class SpdyProxyClientSocketSpdy2Test : public PlatformTest { MockConnect connect_data_; scoped_refptr<SpdySession> spdy_session_; scoped_refptr<SpdyStream> spdy_stream_; - spdy::BufferedSpdyFramer framer_; + BufferedSpdyFramer framer_; std::string user_agent_; GURL url_; @@ -144,7 +144,7 @@ SpdyProxyClientSocketSpdy2Test::SpdyProxyClientSocketSpdy2Test() spdy_stream_(NULL), framer_(2), user_agent_(kUserAgent), - url_(kUrl), + url_(kRequestUrl), proxy_host_port_(kProxyHost, kProxyPort), endpoint_host_port_pair_(kOriginHost, kOriginPort), proxy_(ProxyServer::SCHEME_HTTPS, proxy_host_port_), @@ -312,19 +312,19 @@ void SpdyProxyClientSocketSpdy2Test::AssertAsyncWriteWithReadsSucceeds( } // Constructs a standard SPDY SYN_STREAM frame for a CONNECT request. -spdy::SpdyFrame* +SpdyFrame* SpdyProxyClientSocketSpdy2Test::ConstructConnectRequestFrame() { const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_STREAM, + SYN_STREAM, kStreamId, 0, net::ConvertRequestPriorityToSpdyPriority(LOWEST), - spdy::CONTROL_FLAG_NONE, + CONTROL_FLAG_NONE, false, - spdy::INVALID, + INVALID, NULL, 0, - spdy::DATA_FLAG_NONE + DATA_FLAG_NONE }; const char* const kConnectHeaders[] = { "method", "CONNECT", @@ -339,19 +339,19 @@ SpdyProxyClientSocketSpdy2Test::ConstructConnectRequestFrame() { // Constructs a SPDY SYN_STREAM frame for a CONNECT request which includes // Proxy-Authorization headers. -spdy::SpdyFrame* +SpdyFrame* SpdyProxyClientSocketSpdy2Test::ConstructConnectAuthRequestFrame() { const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_STREAM, + SYN_STREAM, kStreamId, 0, net::ConvertRequestPriorityToSpdyPriority(LOWEST), - spdy::CONTROL_FLAG_NONE, + CONTROL_FLAG_NONE, false, - spdy::INVALID, + INVALID, NULL, 0, - spdy::DATA_FLAG_NONE + DATA_FLAG_NONE }; const char* const kConnectHeaders[] = { "method", "CONNECT", @@ -366,7 +366,7 @@ SpdyProxyClientSocketSpdy2Test::ConstructConnectAuthRequestFrame() { } // Constructs a standard SPDY SYN_REPLY frame to match the SPDY CONNECT. -spdy::SpdyFrame* SpdyProxyClientSocketSpdy2Test::ConstructConnectReplyFrame() { +SpdyFrame* SpdyProxyClientSocketSpdy2Test::ConstructConnectReplyFrame() { const char* const kStandardReplyHeaders[] = { "status", "200 Connection Established", "version", "HTTP/1.1" @@ -376,14 +376,14 @@ spdy::SpdyFrame* SpdyProxyClientSocketSpdy2Test::ConstructConnectReplyFrame() { false, kStreamId, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kStandardReplyHeaders, arraysize(kStandardReplyHeaders)); } // Constructs a standard SPDY SYN_REPLY frame to match the SPDY CONNECT. -spdy::SpdyFrame* +SpdyFrame* SpdyProxyClientSocketSpdy2Test::ConstructConnectAuthReplyFrame() { const char* const kStandardReplyHeaders[] = { "status", "407 Proxy Authentication Required", @@ -396,14 +396,14 @@ SpdyProxyClientSocketSpdy2Test::ConstructConnectAuthReplyFrame() { false, kStreamId, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kStandardReplyHeaders, arraysize(kStandardReplyHeaders)); } // Constructs a SPDY SYN_REPLY frame with an HTTP 500 error. -spdy::SpdyFrame* +SpdyFrame* SpdyProxyClientSocketSpdy2Test::ConstructConnectErrorReplyFrame() { const char* const kStandardReplyHeaders[] = { "status", "500 Internal Server Error", @@ -415,26 +415,26 @@ SpdyProxyClientSocketSpdy2Test::ConstructConnectErrorReplyFrame() { false, kStreamId, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kStandardReplyHeaders, arraysize(kStandardReplyHeaders)); } -spdy::SpdyFrame* SpdyProxyClientSocketSpdy2Test::ConstructBodyFrame( +SpdyFrame* SpdyProxyClientSocketSpdy2Test::ConstructBodyFrame( const char* data, int length) { - return framer_.CreateDataFrame(kStreamId, data, length, spdy::DATA_FLAG_NONE); + return framer_.CreateDataFrame(kStreamId, data, length, DATA_FLAG_NONE); } // ----------- Connect TEST_F(SpdyProxyClientSocketSpdy2Test, ConnectSendsCorrectRequest) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 3), // EOF @@ -450,12 +450,12 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, ConnectSendsCorrectRequest) { } TEST_F(SpdyProxyClientSocketSpdy2Test, ConnectWithAuthRequested) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectAuthReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectAuthReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 3), // EOF @@ -473,12 +473,12 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, ConnectWithAuthRequested) { } TEST_F(SpdyProxyClientSocketSpdy2Test, ConnectWithAuthCredentials) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectAuthRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectAuthRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 3), // EOF @@ -493,12 +493,12 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, ConnectWithAuthCredentials) { } TEST_F(SpdyProxyClientSocketSpdy2Test, ConnectFails) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { MockRead(ASYNC, 0, 1), // EOF }; @@ -515,12 +515,12 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, ConnectFails) { // ----------- WasEverUsed TEST_F(SpdyProxyClientSocketSpdy2Test, WasEverUsedReturnsCorrectValues) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2), // EOF @@ -538,12 +538,12 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, WasEverUsedReturnsCorrectValues) { // ----------- GetPeerAddress TEST_F(SpdyProxyClientSocketSpdy2Test, GetPeerAddressReturnsCorrectValues) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2), // EOF @@ -571,16 +571,16 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, GetPeerAddressReturnsCorrectValues) { // ----------- Write TEST_F(SpdyProxyClientSocketSpdy2Test, WriteSendsDataInDataFrame) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), CreateMockWrite(*msg1, 2, SYNCHRONOUS), CreateMockWrite(*msg2, 3, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 4), // EOF @@ -596,8 +596,8 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, WriteSendsDataInDataFrame) { TEST_F(SpdyProxyClientSocketSpdy2Test, WriteSplitsLargeDataIntoMultipleFrames) { std::string chunk_data(kMaxSpdyFrameChunkSize, 'x'); - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); - scoped_ptr<spdy::SpdyFrame> chunk(ConstructBodyFrame(chunk_data.data(), + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> chunk(ConstructBodyFrame(chunk_data.data(), chunk_data.length())); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), @@ -606,7 +606,7 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, WriteSplitsLargeDataIntoMultipleFrames) { CreateMockWrite(*chunk, 4, SYNCHRONOUS) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 5), // EOF @@ -630,13 +630,13 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, WriteSplitsLargeDataIntoMultipleFrames) { // ----------- Read TEST_F(SpdyProxyClientSocketSpdy2Test, ReadReadsDataInDataFrame) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -653,14 +653,14 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, ReadReadsDataInDataFrame) { } TEST_F(SpdyProxyClientSocketSpdy2Test, ReadDataFromBufferedFrames) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -681,14 +681,14 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, ReadDataFromBufferedFrames) { } TEST_F(SpdyProxyClientSocketSpdy2Test, ReadDataMultipleBufferedFrames) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -708,14 +708,14 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, ReadDataMultipleBufferedFrames) { TEST_F(SpdyProxyClientSocketSpdy2Test, LargeReadWillMergeDataFromDifferentFrames) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg3(ConstructBodyFrame(kMsg3, kLen3)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg3(ConstructBodyFrame(kMsg3, kLen3)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg3, 2, ASYNC), @@ -735,15 +735,15 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, } TEST_F(SpdyProxyClientSocketSpdy2Test, MultipleShortReadsThenMoreRead) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg3(ConstructBodyFrame(kMsg3, kLen3)); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg3(ConstructBodyFrame(kMsg3, kLen3)); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -767,15 +767,15 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, MultipleShortReadsThenMoreRead) { } TEST_F(SpdyProxyClientSocketSpdy2Test, ReadWillSplitDataFromLargeFrame) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg33(ConstructBodyFrame(kMsg33, kLen33)); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg33(ConstructBodyFrame(kMsg33, kLen33)); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -797,13 +797,13 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, ReadWillSplitDataFromLargeFrame) { } TEST_F(SpdyProxyClientSocketSpdy2Test, MultipleReadsFromSameLargeFrame) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg333(ConstructBodyFrame(kMsg333, kLen333)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg333(ConstructBodyFrame(kMsg333, kLen333)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg333, 2, ASYNC), @@ -828,14 +828,14 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, MultipleReadsFromSameLargeFrame) { } TEST_F(SpdyProxyClientSocketSpdy2Test, ReadAuthResponseBody) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectAuthReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> resp(ConstructConnectAuthReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -854,14 +854,14 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, ReadAuthResponseBody) { } TEST_F(SpdyProxyClientSocketSpdy2Test, ReadErrorResponseBody) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectErrorReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> resp(ConstructConnectErrorReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -885,16 +885,16 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, ReadErrorResponseBody) { // ----------- Reads and Writes TEST_F(SpdyProxyClientSocketSpdy2Test, AsyncReadAroundWrite) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), CreateMockWrite(*msg2, 3, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg3(ConstructBodyFrame(kMsg3, kLen3)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg3(ConstructBodyFrame(kMsg3, kLen3)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), // sync read @@ -921,16 +921,16 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, AsyncReadAroundWrite) { } TEST_F(SpdyProxyClientSocketSpdy2Test, AsyncWriteAroundReads) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), CreateMockWrite(*msg2, 4, ASYNC), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg3(ConstructBodyFrame(kMsg3, kLen3)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg3(ConstructBodyFrame(kMsg3, kLen3)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -960,12 +960,12 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, AsyncWriteAroundReads) { // Reading from an already closed socket should return 0 TEST_F(SpdyProxyClientSocketSpdy2Test, ReadOnClosedSocketReturnsZero) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2), // EOF @@ -986,12 +986,12 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, ReadOnClosedSocketReturnsZero) { // Read pending when socket is closed should return 0 TEST_F(SpdyProxyClientSocketSpdy2Test, PendingReadOnCloseReturnsZero) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2), // EOF @@ -1011,12 +1011,12 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, PendingReadOnCloseReturnsZero) { // Reading from a disconnected socket is an error TEST_F(SpdyProxyClientSocketSpdy2Test, ReadOnDisconnectSocketReturnsNotConnected) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2), // EOF @@ -1035,13 +1035,13 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, // Reading buffered data from an already closed socket should return // buffered data, then 0. TEST_F(SpdyProxyClientSocketSpdy2Test, ReadOnClosedSocketReturnsBufferedData) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -1068,13 +1068,13 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, ReadOnClosedSocketReturnsBufferedData) { // Calling Write() on a closed socket is an error TEST_F(SpdyProxyClientSocketSpdy2Test, WriteOnClosedStream) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2), // EOF @@ -1092,13 +1092,13 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, WriteOnClosedStream) { // Calling Write() on a disconnected socket is an error TEST_F(SpdyProxyClientSocketSpdy2Test, WriteOnDisconnectedSocket) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2), // EOF @@ -1118,13 +1118,13 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, WriteOnDisconnectedSocket) { // If the socket is closed with a pending Write(), the callback // should be called with ERR_CONNECTION_CLOSED. TEST_F(SpdyProxyClientSocketSpdy2Test, WritePendingOnClose) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), MockWrite(ASYNC, ERR_IO_PENDING, 2), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 3), // EOF @@ -1148,13 +1148,13 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, WritePendingOnClose) { // If the socket is Disconnected with a pending Write(), the callback // should not be called. TEST_F(SpdyProxyClientSocketSpdy2Test, DisconnectWithWritePending) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), MockWrite(SYNCHRONOUS, 0, 2), // EOF }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 3), // EOF @@ -1179,12 +1179,12 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, DisconnectWithWritePending) { // If the socket is Disconnected with a pending Read(), the callback // should not be called. TEST_F(SpdyProxyClientSocketSpdy2Test, DisconnectWithReadPending) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2), // EOF @@ -1209,14 +1209,14 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, DisconnectWithReadPending) { // If the socket is Reset when both a read and write are pending, // both should be called back. TEST_F(SpdyProxyClientSocketSpdy2Test, RstWithReadAndWritePending) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), MockWrite(ASYNC, ERR_IO_PENDING, 2), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> rst(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*rst, 3, ASYNC), @@ -1276,14 +1276,14 @@ class DeleteSockCallback : public TestCompletionCallbackBase { // read callback causes the socket to be deleted, the write callback should // not be called. TEST_F(SpdyProxyClientSocketSpdy2Test, RstWithReadAndWritePendingDelete) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), MockWrite(ASYNC, ERR_IO_PENDING, 2), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> rst(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*rst, 3, ASYNC), diff --git a/net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc b/net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc index 023b022..76dfc77 100644 --- a/net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc +++ b/net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc @@ -32,7 +32,7 @@ using namespace net::test_spdy3; namespace { -static const char kUrl[] = "https://www.google.com/"; +static const char kRequestUrl[] = "https://www.google.com/"; static const char kOriginHost[] = "www.google.com"; static const int kOriginPort = 443; static const char kOriginHostPort[] = "www.google.com:443"; @@ -71,12 +71,12 @@ class SpdyProxyClientSocketSpdy3Test : public PlatformTest { void Initialize(MockRead* reads, size_t reads_count, MockWrite* writes, size_t writes_count); - spdy::SpdyFrame* ConstructConnectRequestFrame(); - spdy::SpdyFrame* ConstructConnectAuthRequestFrame(); - spdy::SpdyFrame* ConstructConnectReplyFrame(); - spdy::SpdyFrame* ConstructConnectAuthReplyFrame(); - spdy::SpdyFrame* ConstructConnectErrorReplyFrame(); - spdy::SpdyFrame* ConstructBodyFrame(const char* data, int length); + SpdyFrame* ConstructConnectRequestFrame(); + SpdyFrame* ConstructConnectAuthRequestFrame(); + SpdyFrame* ConstructConnectReplyFrame(); + SpdyFrame* ConstructConnectAuthReplyFrame(); + SpdyFrame* ConstructConnectErrorReplyFrame(); + SpdyFrame* ConstructBodyFrame(const char* data, int length); scoped_refptr<IOBufferWithSize> CreateBuffer(const char* data, int size); void AssertConnectSucceeds(); void AssertConnectFails(int result); @@ -119,7 +119,7 @@ class SpdyProxyClientSocketSpdy3Test : public PlatformTest { MockConnect connect_data_; scoped_refptr<SpdySession> spdy_session_; scoped_refptr<SpdyStream> spdy_stream_; - spdy::BufferedSpdyFramer framer_; + BufferedSpdyFramer framer_; std::string user_agent_; GURL url_; @@ -144,7 +144,7 @@ SpdyProxyClientSocketSpdy3Test::SpdyProxyClientSocketSpdy3Test() spdy_stream_(NULL), framer_(3), user_agent_(kUserAgent), - url_(kUrl), + url_(kRequestUrl), proxy_host_port_(kProxyHost, kProxyPort), endpoint_host_port_pair_(kOriginHost, kOriginPort), proxy_(ProxyServer::SCHEME_HTTPS, proxy_host_port_), @@ -312,19 +312,19 @@ void SpdyProxyClientSocketSpdy3Test::AssertAsyncWriteWithReadsSucceeds( } // Constructs a standard SPDY SYN_STREAM frame for a CONNECT request. -spdy::SpdyFrame* +SpdyFrame* SpdyProxyClientSocketSpdy3Test::ConstructConnectRequestFrame() { const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_STREAM, + SYN_STREAM, kStreamId, 0, net::ConvertRequestPriorityToSpdyPriority(LOWEST), - spdy::CONTROL_FLAG_NONE, + CONTROL_FLAG_NONE, false, - spdy::INVALID, + INVALID, NULL, 0, - spdy::DATA_FLAG_NONE + DATA_FLAG_NONE }; const char* const kConnectHeaders[] = { ":method", "CONNECT", @@ -339,19 +339,19 @@ SpdyProxyClientSocketSpdy3Test::ConstructConnectRequestFrame() { // Constructs a SPDY SYN_STREAM frame for a CONNECT request which includes // Proxy-Authorization headers. -spdy::SpdyFrame* +SpdyFrame* SpdyProxyClientSocketSpdy3Test::ConstructConnectAuthRequestFrame() { const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_STREAM, + SYN_STREAM, kStreamId, 0, net::ConvertRequestPriorityToSpdyPriority(LOWEST), - spdy::CONTROL_FLAG_NONE, + CONTROL_FLAG_NONE, false, - spdy::INVALID, + INVALID, NULL, 0, - spdy::DATA_FLAG_NONE + DATA_FLAG_NONE }; const char* const kConnectHeaders[] = { ":method", "CONNECT", @@ -366,7 +366,7 @@ SpdyProxyClientSocketSpdy3Test::ConstructConnectAuthRequestFrame() { } // Constructs a standard SPDY SYN_REPLY frame to match the SPDY CONNECT. -spdy::SpdyFrame* SpdyProxyClientSocketSpdy3Test::ConstructConnectReplyFrame() { +SpdyFrame* SpdyProxyClientSocketSpdy3Test::ConstructConnectReplyFrame() { const char* const kStandardReplyHeaders[] = { "status", "200 Connection Established", "version", "HTTP/1.1" @@ -376,14 +376,14 @@ spdy::SpdyFrame* SpdyProxyClientSocketSpdy3Test::ConstructConnectReplyFrame() { false, kStreamId, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kStandardReplyHeaders, arraysize(kStandardReplyHeaders)); } // Constructs a standard SPDY SYN_REPLY frame to match the SPDY CONNECT. -spdy::SpdyFrame* +SpdyFrame* SpdyProxyClientSocketSpdy3Test::ConstructConnectAuthReplyFrame() { const char* const kStandardReplyHeaders[] = { "status", "407 Proxy Authentication Required", @@ -396,14 +396,14 @@ SpdyProxyClientSocketSpdy3Test::ConstructConnectAuthReplyFrame() { false, kStreamId, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kStandardReplyHeaders, arraysize(kStandardReplyHeaders)); } // Constructs a SPDY SYN_REPLY frame with an HTTP 500 error. -spdy::SpdyFrame* +SpdyFrame* SpdyProxyClientSocketSpdy3Test::ConstructConnectErrorReplyFrame() { const char* const kStandardReplyHeaders[] = { "status", "500 Internal Server Error", @@ -415,27 +415,27 @@ SpdyProxyClientSocketSpdy3Test::ConstructConnectErrorReplyFrame() { false, kStreamId, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kStandardReplyHeaders, arraysize(kStandardReplyHeaders)); } -spdy::SpdyFrame* SpdyProxyClientSocketSpdy3Test::ConstructBodyFrame( +SpdyFrame* SpdyProxyClientSocketSpdy3Test::ConstructBodyFrame( const char* data, int length) { - return framer_.CreateDataFrame(kStreamId, data, length, spdy::DATA_FLAG_NONE); + return framer_.CreateDataFrame(kStreamId, data, length, DATA_FLAG_NONE); } // ----------- Connect TEST_F(SpdyProxyClientSocketSpdy3Test, ConnectSendsCorrectRequest) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 3), // EOF @@ -451,12 +451,12 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, ConnectSendsCorrectRequest) { } TEST_F(SpdyProxyClientSocketSpdy3Test, ConnectWithAuthRequested) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectAuthReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectAuthReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 3), // EOF @@ -474,12 +474,12 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, ConnectWithAuthRequested) { } TEST_F(SpdyProxyClientSocketSpdy3Test, ConnectWithAuthCredentials) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectAuthRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectAuthRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 3), // EOF @@ -494,12 +494,12 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, ConnectWithAuthCredentials) { } TEST_F(SpdyProxyClientSocketSpdy3Test, ConnectFails) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { MockRead(ASYNC, 0, 1), // EOF }; @@ -516,12 +516,12 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, ConnectFails) { // ----------- WasEverUsed TEST_F(SpdyProxyClientSocketSpdy3Test, WasEverUsedReturnsCorrectValues) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2), // EOF @@ -539,12 +539,12 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, WasEverUsedReturnsCorrectValues) { // ----------- GetPeerAddress TEST_F(SpdyProxyClientSocketSpdy3Test, GetPeerAddressReturnsCorrectValues) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2), // EOF @@ -572,16 +572,16 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, GetPeerAddressReturnsCorrectValues) { // ----------- Write TEST_F(SpdyProxyClientSocketSpdy3Test, WriteSendsDataInDataFrame) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), CreateMockWrite(*msg1, 2, SYNCHRONOUS), CreateMockWrite(*msg2, 3, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 4), // EOF @@ -597,8 +597,8 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, WriteSendsDataInDataFrame) { TEST_F(SpdyProxyClientSocketSpdy3Test, WriteSplitsLargeDataIntoMultipleFrames) { std::string chunk_data(kMaxSpdyFrameChunkSize, 'x'); - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); - scoped_ptr<spdy::SpdyFrame> chunk(ConstructBodyFrame(chunk_data.data(), + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> chunk(ConstructBodyFrame(chunk_data.data(), chunk_data.length())); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), @@ -607,7 +607,7 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, WriteSplitsLargeDataIntoMultipleFrames) { CreateMockWrite(*chunk, 4, SYNCHRONOUS) }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 5), // EOF @@ -631,13 +631,13 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, WriteSplitsLargeDataIntoMultipleFrames) { // ----------- Read TEST_F(SpdyProxyClientSocketSpdy3Test, ReadReadsDataInDataFrame) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -654,14 +654,14 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, ReadReadsDataInDataFrame) { } TEST_F(SpdyProxyClientSocketSpdy3Test, ReadDataFromBufferedFrames) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -682,14 +682,14 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, ReadDataFromBufferedFrames) { } TEST_F(SpdyProxyClientSocketSpdy3Test, ReadDataMultipleBufferedFrames) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -709,14 +709,14 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, ReadDataMultipleBufferedFrames) { TEST_F(SpdyProxyClientSocketSpdy3Test, LargeReadWillMergeDataFromDifferentFrames) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg3(ConstructBodyFrame(kMsg3, kLen3)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg3(ConstructBodyFrame(kMsg3, kLen3)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg3, 2, ASYNC), @@ -736,15 +736,15 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, } TEST_F(SpdyProxyClientSocketSpdy3Test, MultipleShortReadsThenMoreRead) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg3(ConstructBodyFrame(kMsg3, kLen3)); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg3(ConstructBodyFrame(kMsg3, kLen3)); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -768,15 +768,15 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, MultipleShortReadsThenMoreRead) { } TEST_F(SpdyProxyClientSocketSpdy3Test, ReadWillSplitDataFromLargeFrame) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg33(ConstructBodyFrame(kMsg33, kLen33)); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg33(ConstructBodyFrame(kMsg33, kLen33)); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -798,13 +798,13 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, ReadWillSplitDataFromLargeFrame) { } TEST_F(SpdyProxyClientSocketSpdy3Test, MultipleReadsFromSameLargeFrame) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg333(ConstructBodyFrame(kMsg333, kLen333)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg333(ConstructBodyFrame(kMsg333, kLen333)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg333, 2, ASYNC), @@ -829,14 +829,14 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, MultipleReadsFromSameLargeFrame) { } TEST_F(SpdyProxyClientSocketSpdy3Test, ReadAuthResponseBody) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectAuthReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> resp(ConstructConnectAuthReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -855,14 +855,14 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, ReadAuthResponseBody) { } TEST_F(SpdyProxyClientSocketSpdy3Test, ReadErrorResponseBody) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectErrorReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> resp(ConstructConnectErrorReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -886,16 +886,16 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, ReadErrorResponseBody) { // ----------- Reads and Writes TEST_F(SpdyProxyClientSocketSpdy3Test, AsyncReadAroundWrite) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), CreateMockWrite(*msg2, 3, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg3(ConstructBodyFrame(kMsg3, kLen3)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg3(ConstructBodyFrame(kMsg3, kLen3)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), // sync read @@ -922,16 +922,16 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, AsyncReadAroundWrite) { } TEST_F(SpdyProxyClientSocketSpdy3Test, AsyncWriteAroundReads) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); - scoped_ptr<spdy::SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> msg2(ConstructBodyFrame(kMsg2, kLen2)); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), CreateMockWrite(*msg2, 4, ASYNC), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); - scoped_ptr<spdy::SpdyFrame> msg3(ConstructBodyFrame(kMsg3, kLen3)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> msg3(ConstructBodyFrame(kMsg3, kLen3)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -961,12 +961,12 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, AsyncWriteAroundReads) { // Reading from an already closed socket should return 0 TEST_F(SpdyProxyClientSocketSpdy3Test, ReadOnClosedSocketReturnsZero) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2), // EOF @@ -987,12 +987,12 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, ReadOnClosedSocketReturnsZero) { // Read pending when socket is closed should return 0 TEST_F(SpdyProxyClientSocketSpdy3Test, PendingReadOnCloseReturnsZero) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2), // EOF @@ -1012,12 +1012,12 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, PendingReadOnCloseReturnsZero) { // Reading from a disconnected socket is an error TEST_F(SpdyProxyClientSocketSpdy3Test, ReadOnDisconnectSocketReturnsNotConnected) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2), // EOF @@ -1036,13 +1036,13 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, // Reading buffered data from an already closed socket should return // buffered data, then 0. TEST_F(SpdyProxyClientSocketSpdy3Test, ReadOnClosedSocketReturnsBufferedData) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*msg1, 2, ASYNC), @@ -1069,13 +1069,13 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, ReadOnClosedSocketReturnsBufferedData) { // Calling Write() on a closed socket is an error TEST_F(SpdyProxyClientSocketSpdy3Test, WriteOnClosedStream) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2), // EOF @@ -1093,13 +1093,13 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, WriteOnClosedStream) { // Calling Write() on a disconnected socket is an error TEST_F(SpdyProxyClientSocketSpdy3Test, WriteOnDisconnectedSocket) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> msg1(ConstructBodyFrame(kMsg1, kLen1)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2), // EOF @@ -1119,13 +1119,13 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, WriteOnDisconnectedSocket) { // If the socket is closed with a pending Write(), the callback // should be called with ERR_CONNECTION_CLOSED. TEST_F(SpdyProxyClientSocketSpdy3Test, WritePendingOnClose) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), MockWrite(ASYNC, ERR_IO_PENDING, 2), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 3), // EOF @@ -1149,13 +1149,13 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, WritePendingOnClose) { // If the socket is Disconnected with a pending Write(), the callback // should not be called. TEST_F(SpdyProxyClientSocketSpdy3Test, DisconnectWithWritePending) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), MockWrite(SYNCHRONOUS, 0, 2), // EOF }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 3), // EOF @@ -1180,12 +1180,12 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, DisconnectWithWritePending) { // If the socket is Disconnected with a pending Read(), the callback // should not be called. TEST_F(SpdyProxyClientSocketSpdy3Test, DisconnectWithReadPending) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 2), // EOF @@ -1210,14 +1210,14 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, DisconnectWithReadPending) { // If the socket is Reset when both a read and write are pending, // both should be called back. TEST_F(SpdyProxyClientSocketSpdy3Test, RstWithReadAndWritePending) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), MockWrite(ASYNC, ERR_IO_PENDING, 2), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> rst(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*rst, 3, ASYNC), @@ -1277,14 +1277,14 @@ class DeleteSockCallback : public TestCompletionCallbackBase { // read callback causes the socket to be deleted, the write callback should // not be called. TEST_F(SpdyProxyClientSocketSpdy3Test, RstWithReadAndWritePendingDelete) { - scoped_ptr<spdy::SpdyFrame> conn(ConstructConnectRequestFrame()); + scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame()); MockWrite writes[] = { CreateMockWrite(*conn, 0, SYNCHRONOUS), MockWrite(ASYNC, ERR_IO_PENDING, 2), }; - scoped_ptr<spdy::SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<spdy::SpdyFrame> rst(ConstructSpdyRstStream(1, spdy::CANCEL)); + scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*rst, 3, ASYNC), diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index e621070..0fdc5ef 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -39,10 +39,10 @@ namespace net { NetLogSpdySynParameter::NetLogSpdySynParameter( - const linked_ptr<spdy::SpdyHeaderBlock>& headers, - spdy::SpdyControlFlags flags, - spdy::SpdyStreamId id, - spdy::SpdyStreamId associated_stream) + const linked_ptr<SpdyHeaderBlock>& headers, + SpdyControlFlags flags, + SpdyStreamId id, + SpdyStreamId associated_stream) : headers_(headers), flags_(flags), id_(id), @@ -55,7 +55,7 @@ NetLogSpdySynParameter::~NetLogSpdySynParameter() { Value* NetLogSpdySynParameter::ToValue() const { DictionaryValue* dict = new DictionaryValue(); ListValue* headers_list = new ListValue(); - for (spdy::SpdyHeaderBlock::const_iterator it = headers_->begin(); + for (SpdyHeaderBlock::const_iterator it = headers_->begin(); it != headers_->end(); ++it) { headers_list->Append(new StringValue(base::StringPrintf( "%s: %s", it->first.c_str(), it->second.c_str()))); @@ -125,13 +125,13 @@ class NetLogSpdySessionParameter : public NetLog::EventParameters { class NetLogSpdySettingsParameter : public NetLog::EventParameters { public: - explicit NetLogSpdySettingsParameter(const spdy::SpdySettings& settings) + explicit NetLogSpdySettingsParameter(const SpdySettings& settings) : settings_(settings) {} virtual Value* ToValue() const { DictionaryValue* dict = new DictionaryValue(); ListValue* settings = new ListValue(); - for (spdy::SpdySettings::const_iterator it = settings_.begin(); + for (SpdySettings::const_iterator it = settings_.begin(); it != settings_.end(); ++it) { settings->Append(new StringValue( base::StringPrintf("[%u:%u]", it->first.id(), it->second))); @@ -142,14 +142,14 @@ class NetLogSpdySettingsParameter : public NetLog::EventParameters { private: ~NetLogSpdySettingsParameter() {} - const spdy::SpdySettings settings_; + const SpdySettings settings_; DISALLOW_COPY_AND_ASSIGN(NetLogSpdySettingsParameter); }; class NetLogSpdyWindowUpdateParameter : public NetLog::EventParameters { public: - NetLogSpdyWindowUpdateParameter(spdy::SpdyStreamId stream_id, int32 delta) + NetLogSpdyWindowUpdateParameter(SpdyStreamId stream_id, int32 delta) : stream_id_(stream_id), delta_(delta) {} virtual Value* ToValue() const { @@ -161,7 +161,7 @@ class NetLogSpdyWindowUpdateParameter : public NetLog::EventParameters { private: ~NetLogSpdyWindowUpdateParameter() {} - const spdy::SpdyStreamId stream_id_; + const SpdyStreamId stream_id_; const int32 delta_; DISALLOW_COPY_AND_ASSIGN(NetLogSpdyWindowUpdateParameter); @@ -169,9 +169,9 @@ class NetLogSpdyWindowUpdateParameter : public NetLog::EventParameters { class NetLogSpdyDataParameter : public NetLog::EventParameters { public: - NetLogSpdyDataParameter(spdy::SpdyStreamId stream_id, + NetLogSpdyDataParameter(SpdyStreamId stream_id, int size, - spdy::SpdyDataFlags flags) + SpdyDataFlags flags) : stream_id_(stream_id), size_(size), flags_(flags) {} virtual Value* ToValue() const { @@ -184,16 +184,16 @@ class NetLogSpdyDataParameter : public NetLog::EventParameters { private: ~NetLogSpdyDataParameter() {} - const spdy::SpdyStreamId stream_id_; + const SpdyStreamId stream_id_; const int size_; - const spdy::SpdyDataFlags flags_; + const SpdyDataFlags flags_; DISALLOW_COPY_AND_ASSIGN(NetLogSpdyDataParameter); }; class NetLogSpdyRstParameter : public NetLog::EventParameters { public: - NetLogSpdyRstParameter(spdy::SpdyStreamId stream_id, + NetLogSpdyRstParameter(SpdyStreamId stream_id, int status, const std::string& description) : stream_id_(stream_id), @@ -210,7 +210,7 @@ class NetLogSpdyRstParameter : public NetLog::EventParameters { private: ~NetLogSpdyRstParameter() {} - const spdy::SpdyStreamId stream_id_; + const SpdyStreamId stream_id_; const int status_; const std::string description_; @@ -240,7 +240,7 @@ class NetLogSpdyPingParameter : public NetLog::EventParameters { class NetLogSpdyGoAwayParameter : public NetLog::EventParameters { public: - NetLogSpdyGoAwayParameter(spdy::SpdyStreamId last_stream_id, + NetLogSpdyGoAwayParameter(SpdyStreamId last_stream_id, int active_streams, int unclaimed_streams) : last_stream_id_(last_stream_id), @@ -258,7 +258,7 @@ class NetLogSpdyGoAwayParameter : public NetLog::EventParameters { private: ~NetLogSpdyGoAwayParameter() {} - const spdy::SpdyStreamId last_stream_id_; + const SpdyStreamId last_stream_id_; const int active_streams_; const int unclaimed_streams_; @@ -338,8 +338,8 @@ SpdySession::SpdySession(const HostPortProxyPair& host_port_proxy_pair, check_ping_status_pending_(false), need_to_send_ping_(false), flow_control_(false), - initial_send_window_size_(spdy::kSpdyStreamInitialWindowSize), - initial_recv_window_size_(spdy::kSpdyStreamInitialWindowSize), + initial_send_window_size_(kSpdyStreamInitialWindowSize), + initial_recv_window_size_(kSpdyStreamInitialWindowSize), net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_SPDY_SESSION)), verify_domain_authentication_(verify_domain_authentication), credential_state_(SpdyCredentialState::kDefaultNumSlots), @@ -420,7 +420,7 @@ net::Error SpdySession::InitializeWithSocket( int version = (protocol == SSLClientSocket::kProtoSPDY3) ? 3 : 2; flow_control_ = (protocol >= SSLClientSocket::kProtoSPDY21); - buffered_spdy_framer_.reset(new spdy::BufferedSpdyFramer(version)); + buffered_spdy_framer_.reset(new BufferedSpdyFramer(version)); buffered_spdy_framer_->set_visitor(this); SendSettings(); @@ -570,7 +570,7 @@ int SpdySession::CreateStreamImpl( const std::string& path = url.PathForRequest(); - const spdy::SpdyStreamId stream_id = GetNewStreamId(); + const SpdyStreamId stream_id = GetNewStreamId(); *spdy_stream = new SpdyStream(this, stream_id, @@ -615,10 +615,10 @@ int SpdySession::GetProtocolVersion() const { } int SpdySession::WriteSynStream( - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, RequestPriority priority, - spdy::SpdyControlFlags flags, - const linked_ptr<spdy::SpdyHeaderBlock>& headers) { + SpdyControlFlags flags, + const linked_ptr<SpdyHeaderBlock>& headers) { // Find our stream if (!IsStreamActive(stream_id)) return ERR_INVALID_SPDY_STREAM; @@ -628,7 +628,7 @@ int SpdySession::WriteSynStream( SendPrefacePingIfNoneInFlight(); DCHECK(buffered_spdy_framer_.get()); - scoped_ptr<spdy::SpdySynStreamControlFrame> syn_frame( + scoped_ptr<SpdySynStreamControlFrame> syn_frame( buffered_spdy_framer_->CreateSynStream( stream_id, 0, ConvertRequestPriorityToSpdyPriority(priority), @@ -692,7 +692,7 @@ int SpdySession::WriteCredentialFrame(const std::string& origin, NOTREACHED(); } - spdy::SpdyCredential credential; + SpdyCredential credential; GURL origin_url(origin); credential.slot = credential_state_.SetHasCredential(HostPortPair::FromURL(origin_url)); @@ -700,7 +700,7 @@ int SpdySession::WriteCredentialFrame(const std::string& origin, credential.proof.assign(proof.begin(), proof.end()); DCHECK(buffered_spdy_framer_.get()); - scoped_ptr<spdy::SpdyCredentialControlFrame> credential_frame( + scoped_ptr<SpdyCredentialControlFrame> credential_frame( buffered_spdy_framer_->CreateCredentialFrame(credential)); QueueFrame(credential_frame.get(), priority, NULL); @@ -714,9 +714,9 @@ int SpdySession::WriteCredentialFrame(const std::string& origin, return ERR_IO_PENDING; } -int SpdySession::WriteStreamData(spdy::SpdyStreamId stream_id, +int SpdySession::WriteStreamData(SpdyStreamId stream_id, net::IOBuffer* data, int len, - spdy::SpdyDataFlags flags) { + SpdyDataFlags flags) { // Find our stream DCHECK(IsStreamActive(stream_id)); scoped_refptr<SpdyStream> stream = active_streams_[stream_id]; @@ -726,7 +726,7 @@ int SpdySession::WriteStreamData(spdy::SpdyStreamId stream_id, if (len > kMaxSpdyFrameChunkSize) { len = kMaxSpdyFrameChunkSize; - flags = static_cast<spdy::SpdyDataFlags>(flags & ~spdy::DATA_FLAG_FIN); + flags = static_cast<SpdyDataFlags>(flags & ~DATA_FLAG_FIN); } // Obey send window size of the stream if flow control is enabled. @@ -748,7 +748,7 @@ int SpdySession::WriteStreamData(spdy::SpdyStreamId stream_id, int new_len = std::min(len, stream->send_window_size()); if (new_len < len) { len = new_len; - flags = static_cast<spdy::SpdyDataFlags>(flags & ~spdy::DATA_FLAG_FIN); + flags = static_cast<SpdyDataFlags>(flags & ~DATA_FLAG_FIN); } stream->DecreaseSendWindowSize(len); } @@ -765,7 +765,7 @@ int SpdySession::WriteStreamData(spdy::SpdyStreamId stream_id, // TODO(mbelshe): reduce memory copies here. DCHECK(buffered_spdy_framer_.get()); - scoped_ptr<spdy::SpdyDataFrame> frame( + scoped_ptr<SpdyDataFrame> frame( buffered_spdy_framer_->CreateDataFrame( stream_id, data->data(), len, flags)); QueueFrame(frame.get(), stream->priority(), stream); @@ -781,15 +781,15 @@ int SpdySession::WriteStreamData(spdy::SpdyStreamId stream_id, return ERR_IO_PENDING; } -void SpdySession::CloseStream(spdy::SpdyStreamId stream_id, int status) { +void SpdySession::CloseStream(SpdyStreamId stream_id, int status) { // TODO(mbelshe): We should send a RST_STREAM control frame here // so that the server can cancel a large send. DeleteStream(stream_id, status); } -void SpdySession::ResetStream(spdy::SpdyStreamId stream_id, - spdy::SpdyStatusCodes status, +void SpdySession::ResetStream(SpdyStreamId stream_id, + SpdyStatusCodes status, const std::string& description) { net_log().AddEvent( @@ -798,7 +798,7 @@ void SpdySession::ResetStream(spdy::SpdyStreamId stream_id, description))); DCHECK(buffered_spdy_framer_.get()); - scoped_ptr<spdy::SpdyRstStreamControlFrame> rst_frame( + scoped_ptr<SpdyRstStreamControlFrame> rst_frame( buffered_spdy_framer_->CreateRstStream(stream_id, status)); // Default to lowest priority unless we know otherwise. @@ -811,7 +811,7 @@ void SpdySession::ResetStream(spdy::SpdyStreamId stream_id, DeleteStream(stream_id, ERR_SPDY_PROTOCOL_ERROR); } -bool SpdySession::IsStreamActive(spdy::SpdyStreamId stream_id) const { +bool SpdySession::IsStreamActive(SpdyStreamId stream_id) const { return ContainsKey(active_streams_, stream_id); } @@ -860,12 +860,12 @@ void SpdySession::OnReadComplete(int bytes_read) { char *data = read_buffer_->data(); while (bytes_read && buffered_spdy_framer_->error_code() == - spdy::SpdyFramer::SPDY_NO_ERROR) { + SpdyFramer::SPDY_NO_ERROR) { uint32 bytes_processed = buffered_spdy_framer_->ProcessInput(data, bytes_read); bytes_read -= bytes_processed; data += bytes_processed; - if (buffered_spdy_framer_->state() == spdy::SpdyFramer::SPDY_DONE) + if (buffered_spdy_framer_->state() == SpdyFramer::SPDY_DONE) buffered_spdy_framer_->Reset(); } @@ -897,8 +897,8 @@ void SpdySession::OnWriteComplete(int result) { // size. if (result > 0) { result = in_flight_write_.buffer()->size(); - DCHECK_GE(result, static_cast<int>(spdy::SpdyFrame::kHeaderSize)); - result -= static_cast<int>(spdy::SpdyFrame::kHeaderSize); + DCHECK_GE(result, static_cast<int>(SpdyFrame::kHeaderSize)); + result -= static_cast<int>(SpdyFrame::kHeaderSize); } // It is possible that the stream was cancelled while we were writing @@ -1000,10 +1000,10 @@ void SpdySession::WriteSocket() { // We've deferred compression until just before we write it to the socket, // which is now. At this time, we don't compress our data frames. - spdy::SpdyFrame uncompressed_frame(next_buffer.buffer()->data(), false); + SpdyFrame uncompressed_frame(next_buffer.buffer()->data(), false); size_t size; if (buffered_spdy_framer_->IsCompressible(uncompressed_frame)) { - scoped_ptr<spdy::SpdyFrame> compressed_frame( + scoped_ptr<SpdyFrame> compressed_frame( buffered_spdy_framer_->CompressFrame(uncompressed_frame)); if (!compressed_frame.get()) { CloseSessionOnError( @@ -1011,7 +1011,7 @@ void SpdySession::WriteSocket() { return; } - size = compressed_frame->length() + spdy::SpdyFrame::kHeaderSize; + size = compressed_frame->length() + SpdyFrame::kHeaderSize; DCHECK_GT(size, 0u); @@ -1022,7 +1022,7 @@ void SpdySession::WriteSocket() { // Attempt to send the frame. in_flight_write_ = SpdyIOBuffer(buffer, size, 0, next_buffer.stream()); } else { - size = uncompressed_frame.length() + spdy::SpdyFrame::kHeaderSize; + size = uncompressed_frame.length() + SpdyFrame::kHeaderSize; in_flight_write_ = next_buffer; } } else { @@ -1091,10 +1091,10 @@ int SpdySession::GetNewStreamId() { return id; } -void SpdySession::QueueFrame(spdy::SpdyFrame* frame, - spdy::SpdyPriority priority, +void SpdySession::QueueFrame(SpdyFrame* frame, + SpdyPriority priority, SpdyStream* stream) { - int length = spdy::SpdyFrame::kHeaderSize + frame->length(); + int length = SpdyFrame::kHeaderSize + frame->length(); IOBuffer* buffer = new IOBuffer(length); memcpy(buffer->data(), frame->data(), length); queue_.push(SpdyIOBuffer(buffer, length, priority, stream)); @@ -1205,13 +1205,13 @@ bool SpdySession::CloseOneIdleConnection() { } void SpdySession::ActivateStream(SpdyStream* stream) { - const spdy::SpdyStreamId id = stream->stream_id(); + const SpdyStreamId id = stream->stream_id(); DCHECK(!IsStreamActive(id)); active_streams_[id] = stream; } -void SpdySession::DeleteStream(spdy::SpdyStreamId id, int status) { +void SpdySession::DeleteStream(SpdyStreamId id, int status) { // For push streams, if they are being deleted normally, we leave // the stream in the unclaimed_pushed_streams_ list. However, if // the stream is errored out, clean it up entirely. @@ -1303,20 +1303,20 @@ void SpdySession::OnError(int error_code) { CloseSessionOnError(net::ERR_SPDY_PROTOCOL_ERROR, true, description); } -void SpdySession::OnStreamError(spdy::SpdyStreamId stream_id, +void SpdySession::OnStreamError(SpdyStreamId stream_id, const std::string& description) { if (IsStreamActive(stream_id)) - ResetStream(stream_id, spdy::PROTOCOL_ERROR, description); + ResetStream(stream_id, PROTOCOL_ERROR, description); } -void SpdySession::OnStreamFrameData(spdy::SpdyStreamId stream_id, +void SpdySession::OnStreamFrameData(SpdyStreamId stream_id, const char* data, size_t len) { if (net_log().IsLoggingAllEvents()) { net_log().AddEvent( NetLog::TYPE_SPDY_SESSION_RECV_DATA, make_scoped_refptr(new NetLogSpdyDataParameter( - stream_id, len, spdy::SpdyDataFlags()))); + stream_id, len, SpdyDataFlags()))); } if (!IsStreamActive(stream_id)) { @@ -1328,11 +1328,11 @@ void SpdySession::OnStreamFrameData(spdy::SpdyStreamId stream_id, stream->OnDataReceived(data, len); } -void SpdySession::OnSetting(spdy::SpdySettingsIds id, +void SpdySession::OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) { HandleSetting(id, value); - spdy::SettingsFlagsAndId flags_and_id(flags, id); + SettingsFlagsAndId flags_and_id(flags, id); // TODO(rtenneti): persist SpdySetting. // http_server_properties_->SetSpdySetting( // host_port_pair(), std::make_pair(flags_and_id, value)); @@ -1340,20 +1340,20 @@ void SpdySession::OnSetting(spdy::SpdySettingsIds id, received_settings_ = true; // Log the settings. - spdy::SpdySettings settings; + SpdySettings settings; settings.insert(settings.end(), std::make_pair(flags_and_id, value)); net_log_.AddEvent( NetLog::TYPE_SPDY_SESSION_RECV_SETTINGS, make_scoped_refptr(new NetLogSpdySettingsParameter(settings))); } -bool SpdySession::Respond(const spdy::SpdyHeaderBlock& headers, +bool SpdySession::Respond(const SpdyHeaderBlock& headers, const scoped_refptr<SpdyStream> stream) { int rv = OK; rv = stream->OnResponseReceived(headers); if (rv < 0) { DCHECK_NE(rv, ERR_IO_PENDING); - const spdy::SpdyStreamId stream_id = stream->stream_id(); + const SpdyStreamId stream_id = stream->stream_id(); DeleteStream(stream_id, rv); return false; } @@ -1361,16 +1361,16 @@ bool SpdySession::Respond(const spdy::SpdyHeaderBlock& headers, } void SpdySession::OnSynStream( - const spdy::SpdySynStreamControlFrame& frame, - const linked_ptr<spdy::SpdyHeaderBlock>& headers) { - spdy::SpdyStreamId stream_id = frame.stream_id(); - spdy::SpdyStreamId associated_stream_id = frame.associated_stream_id(); + const SpdySynStreamControlFrame& frame, + const linked_ptr<SpdyHeaderBlock>& headers) { + SpdyStreamId stream_id = frame.stream_id(); + SpdyStreamId associated_stream_id = frame.associated_stream_id(); if (net_log_.IsLoggingAllEvents()) { net_log_.AddEvent( NetLog::TYPE_SPDY_SESSION_PUSHED_SYN_STREAM, make_scoped_refptr(new NetLogSpdySynParameter( - headers, static_cast<spdy::SpdyControlFlags>(frame.flags()), + headers, static_cast<SpdyControlFlags>(frame.flags()), stream_id, associated_stream_id))); } @@ -1389,7 +1389,7 @@ void SpdySession::OnSynStream( std::string description = base::StringPrintf( "Received invalid OnSyn associated stream id %d for stream %d", associated_stream_id, stream_id); - ResetStream(stream_id, spdy::INVALID_STREAM, description); + ResetStream(stream_id, INVALID_STREAM, description); return; } @@ -1401,21 +1401,21 @@ void SpdySession::OnSynStream( const std::string& url = ContainsKey(*headers, "url") ? headers->find("url")->second : ""; if (url.empty()) { - ResetStream(stream_id, spdy::PROTOCOL_ERROR, + ResetStream(stream_id, PROTOCOL_ERROR, "Pushed stream did not contain a url."); return; } GURL gurl(url); if (!gurl.is_valid()) { - ResetStream(stream_id, spdy::PROTOCOL_ERROR, + ResetStream(stream_id, PROTOCOL_ERROR, "Pushed stream url was invalid: " + url); return; } // Verify we have a valid stream association. if (!IsStreamActive(associated_stream_id)) { - ResetStream(stream_id, spdy::INVALID_ASSOCIATED_STREAM, + ResetStream(stream_id, INVALID_ASSOCIATED_STREAM, base::StringPrintf( "Received OnSyn with inactive associated stream %d", associated_stream_id)); @@ -1426,7 +1426,7 @@ void SpdySession::OnSynStream( active_streams_[associated_stream_id]; GURL associated_url(associated_stream->GetUrl()); if (associated_url.GetOrigin() != gurl.GetOrigin()) { - ResetStream(stream_id, spdy::REFUSED_STREAM, + ResetStream(stream_id, REFUSED_STREAM, base::StringPrintf( "Rejected Cross Origin Push Stream %d", associated_stream_id)); @@ -1436,7 +1436,7 @@ void SpdySession::OnSynStream( // There should not be an existing pushed stream with the same path. PushedStreamMap::iterator it = unclaimed_pushed_streams_.find(url); if (it != unclaimed_pushed_streams_.end()) { - ResetStream(stream_id, spdy::PROTOCOL_ERROR, + ResetStream(stream_id, PROTOCOL_ERROR, "Received duplicate pushed stream with url: " + url); return; } @@ -1461,15 +1461,15 @@ void SpdySession::OnSynStream( push_requests.Increment(); } -void SpdySession::OnSynReply(const spdy::SpdySynReplyControlFrame& frame, - const linked_ptr<spdy::SpdyHeaderBlock>& headers) { - spdy::SpdyStreamId stream_id = frame.stream_id(); +void SpdySession::OnSynReply(const SpdySynReplyControlFrame& frame, + const linked_ptr<SpdyHeaderBlock>& headers) { + SpdyStreamId stream_id = frame.stream_id(); if (net_log().IsLoggingAllEvents()) { net_log().AddEvent( NetLog::TYPE_SPDY_SESSION_SYN_REPLY, make_scoped_refptr(new NetLogSpdySynParameter( - headers, static_cast<spdy::SpdyControlFlags>(frame.flags()), + headers, static_cast<SpdyControlFlags>(frame.flags()), stream_id, 0))); } @@ -1495,15 +1495,15 @@ void SpdySession::OnSynReply(const spdy::SpdySynReplyControlFrame& frame, Respond(*headers, stream); } -void SpdySession::OnHeaders(const spdy::SpdyHeadersControlFrame& frame, - const linked_ptr<spdy::SpdyHeaderBlock>& headers) { - spdy::SpdyStreamId stream_id = frame.stream_id(); +void SpdySession::OnHeaders(const SpdyHeadersControlFrame& frame, + const linked_ptr<SpdyHeaderBlock>& headers) { + SpdyStreamId stream_id = frame.stream_id(); if (net_log().IsLoggingAllEvents()) { net_log().AddEvent( NetLog::TYPE_SPDY_SESSION_HEADERS, make_scoped_refptr(new NetLogSpdySynParameter( - headers, static_cast<spdy::SpdyControlFlags>(frame.flags()), + headers, static_cast<SpdyControlFlags>(frame.flags()), stream_id, 0))); } @@ -1521,13 +1521,13 @@ void SpdySession::OnHeaders(const spdy::SpdyHeadersControlFrame& frame, int rv = stream->OnHeaders(*headers); if (rv < 0) { DCHECK_NE(rv, ERR_IO_PENDING); - const spdy::SpdyStreamId stream_id = stream->stream_id(); + const SpdyStreamId stream_id = stream->stream_id(); DeleteStream(stream_id, rv); } } -void SpdySession::OnRstStream(const spdy::SpdyRstStreamControlFrame& frame) { - spdy::SpdyStreamId stream_id = frame.stream_id(); +void SpdySession::OnRstStream(const SpdyRstStreamControlFrame& frame) { + SpdyStreamId stream_id = frame.stream_id(); net_log().AddEvent( NetLog::TYPE_SPDY_SESSION_RST_STREAM, @@ -1546,7 +1546,7 @@ void SpdySession::OnRstStream(const spdy::SpdyRstStreamControlFrame& frame) { if (frame.status() == 0) { stream->OnDataReceived(NULL, 0); - } else if (frame.status() == spdy::REFUSED_STREAM) { + } else if (frame.status() == REFUSED_STREAM) { DeleteStream(stream_id, ERR_SPDY_SERVER_REFUSED_STREAM); } else { stream->LogStreamError(ERR_SPDY_PROTOCOL_ERROR, @@ -1558,7 +1558,7 @@ void SpdySession::OnRstStream(const spdy::SpdyRstStreamControlFrame& frame) { } } -void SpdySession::OnGoAway(const spdy::SpdyGoAwayControlFrame& frame) { +void SpdySession::OnGoAway(const SpdyGoAwayControlFrame& frame) { net_log_.AddEvent( NetLog::TYPE_SPDY_SESSION_GOAWAY, make_scoped_refptr( @@ -1576,7 +1576,7 @@ void SpdySession::OnGoAway(const spdy::SpdyGoAwayControlFrame& frame) { // closed. } -void SpdySession::OnPing(const spdy::SpdyPingControlFrame& frame) { +void SpdySession::OnPing(const SpdyPingControlFrame& frame) { net_log_.AddEvent( NetLog::TYPE_SPDY_SESSION_PING, make_scoped_refptr( @@ -1609,8 +1609,8 @@ void SpdySession::OnPing(const spdy::SpdyPingControlFrame& frame) { } void SpdySession::OnWindowUpdate( - const spdy::SpdyWindowUpdateControlFrame& frame) { - spdy::SpdyStreamId stream_id = frame.stream_id(); + const SpdyWindowUpdateControlFrame& frame) { + SpdyStreamId stream_id = frame.stream_id(); int32 delta_window_size = static_cast<int32>(frame.delta_window_size()); net_log_.AddEvent( NetLog::TYPE_SPDY_SESSION_RECEIVED_WINDOW_UPDATE, @@ -1623,7 +1623,7 @@ void SpdySession::OnWindowUpdate( } if (delta_window_size < 1) { - ResetStream(stream_id, spdy::FLOW_CONTROL_ERROR, + ResetStream(stream_id, FLOW_CONTROL_ERROR, base::StringPrintf( "Received WINDOW_UPDATE with an invalid " "delta_window_size %d", delta_window_size)); @@ -1638,7 +1638,7 @@ void SpdySession::OnWindowUpdate( stream->IncreaseSendWindowSize(delta_window_size); } -void SpdySession::SendWindowUpdate(spdy::SpdyStreamId stream_id, +void SpdySession::SendWindowUpdate(SpdyStreamId stream_id, int32 delta_window_size) { DCHECK(IsStreamActive(stream_id)); scoped_refptr<SpdyStream> stream = active_streams_[stream_id]; @@ -1650,7 +1650,7 @@ void SpdySession::SendWindowUpdate(spdy::SpdyStreamId stream_id, stream_id, delta_window_size))); DCHECK(buffered_spdy_framer_.get()); - scoped_ptr<spdy::SpdyWindowUpdateControlFrame> window_update_frame( + scoped_ptr<SpdyWindowUpdateControlFrame> window_update_frame( buffered_spdy_framer_->CreateWindowUpdate(stream_id, delta_window_size)); QueueFrame(window_update_frame.get(), stream->priority(), NULL); } @@ -1681,32 +1681,32 @@ void SpdySession::SendSettings() { // Note: we're copying the settings here, so that we can potentially modify // the settings for the field trial. When removing the field trial, make // this a reference to the const SpdySettings again. - spdy::SpdySettings settings = + SpdySettings settings = http_server_properties_->GetSpdySettings(host_port_pair()); if (settings.empty()) return; - typedef std::map<uint32, spdy::SpdySetting> SpdySettingsMap; + typedef std::map<uint32, SpdySetting> SpdySettingsMap; SpdySettingsMap unique_settings; // Record Histogram Data and Apply the SpdyCwnd FieldTrial if applicable. - for (spdy::SpdySettings::iterator i = settings.begin(), + for (SpdySettings::iterator i = settings.begin(), end = settings.end(); i != end; ++i) { const uint32 id = i->first.id(); const uint32 val = i->second; switch (id) { - case spdy::SETTINGS_CURRENT_CWND: + case SETTINGS_CURRENT_CWND: uint32 cwnd = 0; cwnd = ApplyCwndFieldTrialPolicy(val); UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsCwndSent", cwnd, 1, 200, 100); if (cwnd != val) { - spdy::SettingsFlagsAndId new_id(spdy::SETTINGS_FLAG_PLEASE_PERSIST, + SettingsFlagsAndId new_id(SETTINGS_FLAG_PLEASE_PERSIST, id); i->second = cwnd; i->first = new_id; - spdy::SpdySetting setting(new_id, val); + SpdySetting setting(new_id, val); // TODO(rtenneti): Persist SpdySetting. // http_server_properties_->SetSpdySetting(host_port_pair(), setting); unique_settings[id] = setting; @@ -1722,7 +1722,7 @@ void SpdySession::SendSettings() { NetLog::TYPE_SPDY_SESSION_SEND_SETTINGS, make_scoped_refptr(new NetLogSpdySettingsParameter(settings))); - spdy::SpdySettings sorted_settings; + SpdySettings sorted_settings; for (SpdySettingsMap::iterator it = unique_settings.begin(); unique_settings.end() != it; ++it) { @@ -1731,14 +1731,14 @@ void SpdySession::SendSettings() { // Create the SETTINGS frame and send it. DCHECK(buffered_spdy_framer_.get()); - scoped_ptr<spdy::SpdySettingsControlFrame> settings_frame( + scoped_ptr<SpdySettingsControlFrame> settings_frame( buffered_spdy_framer_->CreateSettings(sorted_settings)); sent_settings_ = true; QueueFrame(settings_frame.get(), 0, NULL); } -void SpdySession::HandleSettings(const spdy::SpdySettings& settings) { - for (spdy::SpdySettings::const_iterator i = settings.begin(), +void SpdySession::HandleSettings(const SpdySettings& settings) { + for (SpdySettings::const_iterator i = settings.begin(), end = settings.end(); i != end; ++i) { HandleSetting(i->first.id(), i->second); } @@ -1746,12 +1746,12 @@ void SpdySession::HandleSettings(const spdy::SpdySettings& settings) { void SpdySession::HandleSetting(uint32 id, uint32 value) { switch (id) { - case spdy::SETTINGS_MAX_CONCURRENT_STREAMS: + case SETTINGS_MAX_CONCURRENT_STREAMS: max_concurrent_streams_ = std::min(static_cast<size_t>(value), g_max_concurrent_stream_limit); ProcessPendingCreateStreams(); break; - case spdy::SETTINGS_INITIAL_WINDOW_SIZE: + case SETTINGS_INITIAL_WINDOW_SIZE: // INITIAL_WINDOW_SIZE updates initial_send_window_size_ only. // TODO(rtenneti): discuss with the server team about // initial_recv_window_size_. @@ -1809,7 +1809,7 @@ void SpdySession::SendTrailingPing() { void SpdySession::WritePingFrame(uint32 unique_id) { DCHECK(buffered_spdy_framer_.get()); - scoped_ptr<spdy::SpdyPingControlFrame> ping_frame( + scoped_ptr<SpdyPingControlFrame> ping_frame( buffered_spdy_framer_->CreatePingFrame(next_ping_id_)); QueueFrame( ping_frame.get(), buffered_spdy_framer_->GetHighestPriority(), NULL); @@ -1897,14 +1897,14 @@ void SpdySession::RecordHistograms() { if (received_settings_) { // Enumerate the saved settings, and set histograms for it. - const spdy::SpdySettings& settings = + const SpdySettings& settings = http_server_properties_->GetSpdySettings(host_port_pair()); - spdy::SpdySettings::const_iterator it; + SpdySettings::const_iterator it; for (it = settings.begin(); it != settings.end(); ++it) { - const spdy::SpdySetting setting = *it; + const SpdySetting setting = *it; switch (setting.first.id()) { - case spdy::SETTINGS_CURRENT_CWND: + case SETTINGS_CURRENT_CWND: // Record several different histograms to see if cwnd converges // for larger volumes of data being sent. UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsCwnd", @@ -1931,12 +1931,12 @@ void SpdySession::RecordHistograms() { } } break; - case spdy::SETTINGS_ROUND_TRIP_TIME: + case SETTINGS_ROUND_TRIP_TIME: UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsRTT", setting.second, 1, 1200, 100); break; - case spdy::SETTINGS_DOWNLOAD_RETRANS_RATE: + case SETTINGS_DOWNLOAD_RETRANS_RATE: UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsRetransRate", setting.second, 1, 100, 50); diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h index 1091298..37a9126 100644 --- a/net/spdy/spdy_session.h +++ b/net/spdy/spdy_session.h @@ -43,14 +43,14 @@ namespace net { // somewhat arbitrary, but is reasonably small and ensures that we elicit // ACKs quickly from TCP (because TCP tries to only ACK every other packet). const int kMss = 1430; -const int kMaxSpdyFrameChunkSize = (2 * kMss) - spdy::SpdyFrame::kHeaderSize; +const int kMaxSpdyFrameChunkSize = (2 * kMss) - SpdyFrame::kHeaderSize; class BoundNetLog; class SpdyStream; class SSLInfo; class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, - public spdy::BufferedSpdyFramerVisitorInterface, + public BufferedSpdyFramerVisitorInterface, public LayeredPool { public: // Create a new SpdySession. @@ -117,10 +117,10 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, // Send the SYN frame for |stream_id|. This also sends PING message to check // the status of the connection. int WriteSynStream( - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, RequestPriority priority, - spdy::SpdyControlFlags flags, - const linked_ptr<spdy::SpdyHeaderBlock>& headers); + SpdyControlFlags flags, + const linked_ptr<SpdyHeaderBlock>& headers); // Write a CREDENTIAL frame to the session. int WriteCredentialFrame(const std::string& origin, @@ -131,22 +131,22 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, // Write a data frame to the stream. // Used to create and queue a data frame for the given stream. - int WriteStreamData(spdy::SpdyStreamId stream_id, net::IOBuffer* data, + int WriteStreamData(SpdyStreamId stream_id, net::IOBuffer* data, int len, - spdy::SpdyDataFlags flags); + SpdyDataFlags flags); // Close a stream. - void CloseStream(spdy::SpdyStreamId stream_id, int status); + void CloseStream(SpdyStreamId stream_id, int status); // Reset a stream by sending a RST_STREAM frame with given status code. // Also closes the stream. Was not piggybacked to CloseStream since not // all of the calls to CloseStream necessitate sending a RST_STREAM. - void ResetStream(spdy::SpdyStreamId stream_id, - spdy::SpdyStatusCodes status, + void ResetStream(SpdyStreamId stream_id, + SpdyStatusCodes status, const std::string& description); // Check if a stream is active. - bool IsStreamActive(spdy::SpdyStreamId stream_id) const; + bool IsStreamActive(SpdyStreamId stream_id) const; // The LoadState is used for informing the user of the current network // status, such as "resolving host", "connecting", etc. @@ -189,7 +189,7 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, // Send WINDOW_UPDATE frame, called by a stream whenever receive window // size is increased. - void SendWindowUpdate(spdy::SpdyStreamId stream_id, int32 delta_window_size); + void SendWindowUpdate(SpdyStreamId stream_id, int32 delta_window_size); // If session is closed, no new streams/transactions should be created. bool IsClosed() const { return state_ == CLOSED; } @@ -347,7 +347,7 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, // Handle SETTINGS. Either when we send settings, or when we receive a // SETTINGS control frame, update our SpdySession accordingly. - void HandleSettings(const spdy::SpdySettings& settings); + void HandleSettings(const SpdySettings& settings); void HandleSetting(uint32 id, uint32 value); // Adjust the send window size of all ActiveStreams and PendingCreateStreams. @@ -393,12 +393,12 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, // |frame| is the frame to send. // |priority| is the priority for insertion into the queue. // |stream| is the stream which this IO is associated with (or NULL). - void QueueFrame(spdy::SpdyFrame* frame, spdy::SpdyPriority priority, + void QueueFrame(SpdyFrame* frame, SpdyPriority priority, SpdyStream* stream); // Track active streams in the active stream list. void ActivateStream(SpdyStream* stream); - void DeleteStream(spdy::SpdyStreamId id, int status); + void DeleteStream(SpdyStreamId id, int status); // Removes this session from the session pool. void RemoveFromPool(); @@ -410,7 +410,7 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, // Calls OnResponseReceived(). // Returns true if successful. - bool Respond(const spdy::SpdyHeaderBlock& headers, + bool Respond(const SpdyHeaderBlock& headers, const scoped_refptr<SpdyStream> stream); @@ -426,28 +426,28 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, // BufferedSpdyFramerVisitorInterface: virtual void OnError(int error_code) OVERRIDE; - virtual void OnStreamError(spdy::SpdyStreamId stream_id, + virtual void OnStreamError(SpdyStreamId stream_id, const std::string& description) OVERRIDE; virtual void OnRstStream( - const spdy::SpdyRstStreamControlFrame& frame) OVERRIDE; - virtual void OnGoAway(const spdy::SpdyGoAwayControlFrame& frame) OVERRIDE; - virtual void OnPing(const spdy::SpdyPingControlFrame& frame) OVERRIDE; + const SpdyRstStreamControlFrame& frame) OVERRIDE; + virtual void OnGoAway(const SpdyGoAwayControlFrame& frame) OVERRIDE; + virtual void OnPing(const SpdyPingControlFrame& frame) OVERRIDE; virtual void OnWindowUpdate( - const spdy::SpdyWindowUpdateControlFrame& frame) OVERRIDE; - virtual void OnStreamFrameData(spdy::SpdyStreamId stream_id, + const SpdyWindowUpdateControlFrame& frame) OVERRIDE; + virtual void OnStreamFrameData(SpdyStreamId stream_id, const char* data, size_t len) OVERRIDE; virtual void OnSetting( - spdy::SpdySettingsIds id, uint8 flags, uint32 value) OVERRIDE; + SpdySettingsIds id, uint8 flags, uint32 value) OVERRIDE; virtual void OnSynStream( - const spdy::SpdySynStreamControlFrame& frame, - const linked_ptr<spdy::SpdyHeaderBlock>& headers) OVERRIDE; + const SpdySynStreamControlFrame& frame, + const linked_ptr<SpdyHeaderBlock>& headers) OVERRIDE; virtual void OnSynReply( - const spdy::SpdySynReplyControlFrame& frame, - const linked_ptr<spdy::SpdyHeaderBlock>& headers) OVERRIDE; + const SpdySynReplyControlFrame& frame, + const linked_ptr<SpdyHeaderBlock>& headers) OVERRIDE; virtual void OnHeaders( - const spdy::SpdyHeadersControlFrame& frame, - const linked_ptr<spdy::SpdyHeaderBlock>& headers) OVERRIDE; + const SpdyHeadersControlFrame& frame, + const linked_ptr<SpdyHeaderBlock>& headers) OVERRIDE; // -------------------------- // Helper methods for testing @@ -544,7 +544,7 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, int certificate_error_code_; // Spdy Frame state. - scoped_ptr<spdy::BufferedSpdyFramer> buffered_spdy_framer_; + scoped_ptr<BufferedSpdyFramer> buffered_spdy_framer_; // If an error has occurred on the session, the session is effectively // dead. Record this error here. When no error has occurred, |error_| will @@ -642,12 +642,12 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, class NetLogSpdySynParameter : public NetLog::EventParameters { public: - NetLogSpdySynParameter(const linked_ptr<spdy::SpdyHeaderBlock>& headers, - spdy::SpdyControlFlags flags, - spdy::SpdyStreamId id, - spdy::SpdyStreamId associated_stream); + NetLogSpdySynParameter(const linked_ptr<SpdyHeaderBlock>& headers, + SpdyControlFlags flags, + SpdyStreamId id, + SpdyStreamId associated_stream); - const linked_ptr<spdy::SpdyHeaderBlock>& GetHeaders() const { + const linked_ptr<SpdyHeaderBlock>& GetHeaders() const { return headers_; } @@ -656,10 +656,10 @@ class NetLogSpdySynParameter : public NetLog::EventParameters { private: virtual ~NetLogSpdySynParameter(); - const linked_ptr<spdy::SpdyHeaderBlock> headers_; - const spdy::SpdyControlFlags flags_; - const spdy::SpdyStreamId id_; - const spdy::SpdyStreamId associated_stream_; + const linked_ptr<SpdyHeaderBlock> headers_; + const SpdyControlFlags flags_; + const SpdyStreamId id_; + const SpdyStreamId associated_stream_; DISALLOW_COPY_AND_ASSIGN(NetLogSpdySynParameter); }; diff --git a/net/spdy/spdy_session_spdy2_unittest.cc b/net/spdy/spdy_session_spdy2_unittest.cc index 8d87ca7..7e6b7cc 100644 --- a/net/spdy/spdy_session_spdy2_unittest.cc +++ b/net/spdy/spdy_session_spdy2_unittest.cc @@ -45,7 +45,7 @@ class TestSpdyStreamDelegate : public net::SpdyStream::Delegate { return ERR_UNEXPECTED; } - virtual int OnResponseReceived(const spdy::SpdyHeaderBlock& response, + virtual int OnResponseReceived(const SpdyHeaderBlock& response, base::Time response_time, int status) { return status; @@ -111,7 +111,7 @@ TEST_F(SpdySessionSpdy2Test, GoAway) { session_deps.host_resolver->set_synchronous_mode(true); MockConnect connect_data(SYNCHRONOUS, OK); - scoped_ptr<spdy::SpdyFrame> goaway(ConstructSpdyGoAway()); + scoped_ptr<SpdyFrame> goaway(ConstructSpdyGoAway()); MockRead reads[] = { CreateMockRead(*goaway), MockRead(SYNCHRONOUS, 0, 0) // EOF @@ -173,13 +173,13 @@ TEST_F(SpdySessionSpdy2Test, Ping) { session_deps.host_resolver->set_synchronous_mode(true); MockConnect connect_data(SYNCHRONOUS, OK); - scoped_ptr<spdy::SpdyFrame> read_ping(ConstructSpdyPing()); + scoped_ptr<SpdyFrame> read_ping(ConstructSpdyPing()); MockRead reads[] = { CreateMockRead(*read_ping), CreateMockRead(*read_ping), MockRead(SYNCHRONOUS, 0, 0) // EOF }; - scoped_ptr<spdy::SpdyFrame> write_ping(ConstructSpdyPing()); + scoped_ptr<SpdyFrame> write_ping(ConstructSpdyPing()); MockRead writes[] = { CreateMockRead(*write_ping), CreateMockRead(*write_ping), @@ -265,12 +265,12 @@ TEST_F(SpdySessionSpdy2Test, FailedPing) { session_deps.host_resolver->set_synchronous_mode(true); MockConnect connect_data(SYNCHRONOUS, OK); - scoped_ptr<spdy::SpdyFrame> read_ping(ConstructSpdyPing()); + scoped_ptr<SpdyFrame> read_ping(ConstructSpdyPing()); MockRead reads[] = { CreateMockRead(*read_ping), MockRead(SYNCHRONOUS, 0, 0) // EOF }; - scoped_ptr<spdy::SpdyFrame> write_ping(ConstructSpdyPing()); + scoped_ptr<SpdyFrame> write_ping(ConstructSpdyPing()); MockRead writes[] = { CreateMockRead(*write_ping), }; @@ -500,15 +500,15 @@ TEST_F(SpdySessionSpdy2Test, OnSettings) { SpdySessionDependencies session_deps; session_deps.host_resolver->set_synchronous_mode(true); - spdy::SpdySettings new_settings; - spdy::SettingsFlagsAndId id(0, spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + SpdySettings new_settings; + SettingsFlagsAndId id(0, SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 2; - new_settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); + new_settings.push_back(SpdySetting(id, max_concurrent_streams)); // Set up the socket so we read a SETTINGS frame that raises max concurrent // streams to 2. MockConnect connect_data(SYNCHRONOUS, OK); - scoped_ptr<spdy::SpdyFrame> settings_frame( + scoped_ptr<SpdyFrame> settings_frame( ConstructSpdySettings(new_settings)); MockRead reads[] = { CreateMockRead(*settings_frame), @@ -532,9 +532,9 @@ TEST_F(SpdySessionSpdy2Test, OnSettings) { // Initialize the SpdySettingsStorage with 1 max concurrent streams. SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool()); - spdy::SpdySettings old_settings; - spdy::SettingsFlagsAndId id1(spdy::SETTINGS_FLAG_PLEASE_PERSIST, id.id()); - old_settings.push_back(spdy::SpdySetting(id1, 1)); + SpdySettings old_settings; + SettingsFlagsAndId id1(SETTINGS_FLAG_PLEASE_PERSIST, id.id()); + old_settings.push_back(SpdySetting(id1, 1)); spdy_session_pool->http_server_properties()->SetSpdySettings( test_host_port_pair, old_settings); @@ -615,10 +615,10 @@ TEST_F(SpdySessionSpdy2Test, CancelPendingCreateStream) { // Initialize the SpdySettingsStorage with 1 max concurrent streams. SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool()); - spdy::SpdySettings settings; - spdy::SettingsFlagsAndId id(spdy::SETTINGS_FLAG_PLEASE_PERSIST, - spdy::SETTINGS_MAX_CONCURRENT_STREAMS); - settings.push_back(spdy::SpdySetting(id, 1)); + SpdySettings settings; + SettingsFlagsAndId id(SETTINGS_FLAG_PLEASE_PERSIST, + SETTINGS_MAX_CONCURRENT_STREAMS); + settings.push_back(SpdySetting(id, 1)); spdy_session_pool->http_server_properties()->SetSpdySettings( test_host_port_pair, settings); @@ -686,13 +686,13 @@ TEST_F(SpdySessionSpdy2Test, SendSettingsOnNewSession) { // Note that it will be marked as SETTINGS_FLAG_PERSISTED when sent out. But // to set it into the SpdySettingsStorage, we need to mark as // SETTINGS_FLAG_PLEASE_PERSIST. - spdy::SpdySettings settings; + SpdySettings settings; const uint32 kBogusSettingId = 0xABAB; const uint32 kBogusSettingValue = 0xCDCD; - spdy::SettingsFlagsAndId id(spdy::SETTINGS_FLAG_PERSISTED, kBogusSettingId); - settings.push_back(spdy::SpdySetting(id, kBogusSettingValue)); + SettingsFlagsAndId id(SETTINGS_FLAG_PERSISTED, kBogusSettingId); + settings.push_back(SpdySetting(id, kBogusSettingValue)); MockConnect connect_data(SYNCHRONOUS, OK); - scoped_ptr<spdy::SpdyFrame> settings_frame( + scoped_ptr<SpdyFrame> settings_frame( ConstructSpdySettings(settings)); MockWrite writes[] = { CreateMockWrite(*settings_frame), @@ -714,9 +714,9 @@ TEST_F(SpdySessionSpdy2Test, SendSettingsOnNewSession) { HostPortPair test_host_port_pair(kTestHost, kTestPort); HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct()); - spdy::SettingsFlagsAndId id1(spdy::SETTINGS_FLAG_PLEASE_PERSIST, id.id()); + SettingsFlagsAndId id1(SETTINGS_FLAG_PLEASE_PERSIST, id.id()); settings.clear(); - settings.push_back(spdy::SpdySetting(id1, kBogusSettingValue)); + settings.push_back(SpdySetting(id1, kBogusSettingValue)); SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool()); spdy_session_pool->http_server_properties()->SetSpdySettings( test_host_port_pair, settings); @@ -892,11 +892,11 @@ TEST_F(SpdySessionSpdy2Test, ClearSettingsStorage) { const std::string kTestHost("www.foo.com"); const int kTestPort = 80; HostPortPair test_host_port_pair(kTestHost, kTestPort); - spdy::SpdySettings test_settings; - spdy::SettingsFlagsAndId id(spdy::SETTINGS_FLAG_PLEASE_PERSIST, - spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + SpdySettings test_settings; + SettingsFlagsAndId id(SETTINGS_FLAG_PLEASE_PERSIST, + SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 2; - test_settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); + test_settings.push_back(SpdySetting(id, max_concurrent_streams)); settings_storage.Set(test_host_port_pair, test_settings); EXPECT_NE(0u, settings_storage.Get(test_host_port_pair).size()); @@ -916,11 +916,11 @@ TEST_F(SpdySessionSpdy2Test, ClearSettingsStorageOnIPAddressChanged) { HttpServerProperties* test_http_server_properties = spdy_session_pool->http_server_properties(); - spdy::SettingsFlagsAndId id(spdy::SETTINGS_FLAG_PLEASE_PERSIST, - spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + SettingsFlagsAndId id(SETTINGS_FLAG_PLEASE_PERSIST, + SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 2; - spdy::SpdySettings test_settings; - test_settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); + SpdySettings test_settings; + test_settings.push_back(SpdySetting(id, max_concurrent_streams)); test_http_server_properties->SetSpdySettings(test_host_port_pair, test_settings); @@ -1005,7 +1005,7 @@ TEST_F(SpdySessionSpdy2Test, CloseSessionOnError) { session_deps.host_resolver->set_synchronous_mode(true); MockConnect connect_data(SYNCHRONOUS, OK); - scoped_ptr<spdy::SpdyFrame> goaway(ConstructSpdyGoAway()); + scoped_ptr<SpdyFrame> goaway(ConstructSpdyGoAway()); MockRead reads[] = { CreateMockRead(*goaway), MockRead(SYNCHRONOUS, 0, 0) // EOF diff --git a/net/spdy/spdy_session_spdy3_unittest.cc b/net/spdy/spdy_session_spdy3_unittest.cc index 8386a95..af69cc9 100644 --- a/net/spdy/spdy_session_spdy3_unittest.cc +++ b/net/spdy/spdy_session_spdy3_unittest.cc @@ -45,7 +45,7 @@ class TestSpdyStreamDelegate : public net::SpdyStream::Delegate { return ERR_UNEXPECTED; } - virtual int OnResponseReceived(const spdy::SpdyHeaderBlock& response, + virtual int OnResponseReceived(const SpdyHeaderBlock& response, base::Time response_time, int status) { return status; @@ -111,7 +111,7 @@ TEST_F(SpdySessionSpdy3Test, GoAway) { session_deps.host_resolver->set_synchronous_mode(true); MockConnect connect_data(SYNCHRONOUS, OK); - scoped_ptr<spdy::SpdyFrame> goaway(ConstructSpdyGoAway()); + scoped_ptr<SpdyFrame> goaway(ConstructSpdyGoAway()); MockRead reads[] = { CreateMockRead(*goaway), MockRead(SYNCHRONOUS, 0, 0) // EOF @@ -173,13 +173,13 @@ TEST_F(SpdySessionSpdy3Test, Ping) { session_deps.host_resolver->set_synchronous_mode(true); MockConnect connect_data(SYNCHRONOUS, OK); - scoped_ptr<spdy::SpdyFrame> read_ping(ConstructSpdyPing()); + scoped_ptr<SpdyFrame> read_ping(ConstructSpdyPing()); MockRead reads[] = { CreateMockRead(*read_ping), CreateMockRead(*read_ping), MockRead(SYNCHRONOUS, 0, 0) // EOF }; - scoped_ptr<spdy::SpdyFrame> write_ping(ConstructSpdyPing()); + scoped_ptr<SpdyFrame> write_ping(ConstructSpdyPing()); MockRead writes[] = { CreateMockRead(*write_ping), CreateMockRead(*write_ping), @@ -265,12 +265,12 @@ TEST_F(SpdySessionSpdy3Test, FailedPing) { session_deps.host_resolver->set_synchronous_mode(true); MockConnect connect_data(SYNCHRONOUS, OK); - scoped_ptr<spdy::SpdyFrame> read_ping(ConstructSpdyPing()); + scoped_ptr<SpdyFrame> read_ping(ConstructSpdyPing()); MockRead reads[] = { CreateMockRead(*read_ping), MockRead(SYNCHRONOUS, 0, 0) // EOF }; - scoped_ptr<spdy::SpdyFrame> write_ping(ConstructSpdyPing()); + scoped_ptr<SpdyFrame> write_ping(ConstructSpdyPing()); MockRead writes[] = { CreateMockRead(*write_ping), }; @@ -500,15 +500,15 @@ TEST_F(SpdySessionSpdy3Test, OnSettings) { SpdySessionDependencies session_deps; session_deps.host_resolver->set_synchronous_mode(true); - spdy::SpdySettings new_settings; - spdy::SettingsFlagsAndId id(0, spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + SpdySettings new_settings; + SettingsFlagsAndId id(0, SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 2; - new_settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); + new_settings.push_back(SpdySetting(id, max_concurrent_streams)); // Set up the socket so we read a SETTINGS frame that raises max concurrent // streams to 2. MockConnect connect_data(SYNCHRONOUS, OK); - scoped_ptr<spdy::SpdyFrame> settings_frame( + scoped_ptr<SpdyFrame> settings_frame( ConstructSpdySettings(new_settings)); MockRead reads[] = { CreateMockRead(*settings_frame), @@ -532,9 +532,9 @@ TEST_F(SpdySessionSpdy3Test, OnSettings) { // Initialize the SpdySettingsStorage with 1 max concurrent streams. SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool()); - spdy::SpdySettings old_settings; - spdy::SettingsFlagsAndId id1(spdy::SETTINGS_FLAG_PLEASE_PERSIST, id.id()); - old_settings.push_back(spdy::SpdySetting(id1, 1)); + SpdySettings old_settings; + SettingsFlagsAndId id1(SETTINGS_FLAG_PLEASE_PERSIST, id.id()); + old_settings.push_back(SpdySetting(id1, 1)); spdy_session_pool->http_server_properties()->SetSpdySettings( test_host_port_pair, old_settings); @@ -615,10 +615,10 @@ TEST_F(SpdySessionSpdy3Test, CancelPendingCreateStream) { // Initialize the SpdySettingsStorage with 1 max concurrent streams. SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool()); - spdy::SpdySettings settings; - spdy::SettingsFlagsAndId id(spdy::SETTINGS_FLAG_PLEASE_PERSIST, - spdy::SETTINGS_MAX_CONCURRENT_STREAMS); - settings.push_back(spdy::SpdySetting(id, 1)); + SpdySettings settings; + SettingsFlagsAndId id(SETTINGS_FLAG_PLEASE_PERSIST, + SETTINGS_MAX_CONCURRENT_STREAMS); + settings.push_back(SpdySetting(id, 1)); spdy_session_pool->http_server_properties()->SetSpdySettings( test_host_port_pair, settings); @@ -686,13 +686,13 @@ TEST_F(SpdySessionSpdy3Test, SendSettingsOnNewSession) { // Note that it will be marked as SETTINGS_FLAG_PERSISTED when sent out. But // to set it into the SpdySettingsStorage, we need to mark as // SETTINGS_FLAG_PLEASE_PERSIST. - spdy::SpdySettings settings; + SpdySettings settings; const uint32 kBogusSettingId = 0xABAB; const uint32 kBogusSettingValue = 0xCDCD; - spdy::SettingsFlagsAndId id(spdy::SETTINGS_FLAG_PERSISTED, kBogusSettingId); - settings.push_back(spdy::SpdySetting(id, kBogusSettingValue)); + SettingsFlagsAndId id(SETTINGS_FLAG_PERSISTED, kBogusSettingId); + settings.push_back(SpdySetting(id, kBogusSettingValue)); MockConnect connect_data(SYNCHRONOUS, OK); - scoped_ptr<spdy::SpdyFrame> settings_frame( + scoped_ptr<SpdyFrame> settings_frame( ConstructSpdySettings(settings)); MockWrite writes[] = { CreateMockWrite(*settings_frame), @@ -714,9 +714,9 @@ TEST_F(SpdySessionSpdy3Test, SendSettingsOnNewSession) { HostPortPair test_host_port_pair(kTestHost, kTestPort); HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct()); - spdy::SettingsFlagsAndId id1(spdy::SETTINGS_FLAG_PLEASE_PERSIST, id.id()); + SettingsFlagsAndId id1(SETTINGS_FLAG_PLEASE_PERSIST, id.id()); settings.clear(); - settings.push_back(spdy::SpdySetting(id1, kBogusSettingValue)); + settings.push_back(SpdySetting(id1, kBogusSettingValue)); SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool()); spdy_session_pool->http_server_properties()->SetSpdySettings( test_host_port_pair, settings); @@ -892,11 +892,11 @@ TEST_F(SpdySessionSpdy3Test, ClearSettingsStorage) { const std::string kTestHost("www.foo.com"); const int kTestPort = 80; HostPortPair test_host_port_pair(kTestHost, kTestPort); - spdy::SpdySettings test_settings; - spdy::SettingsFlagsAndId id(spdy::SETTINGS_FLAG_PLEASE_PERSIST, - spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + SpdySettings test_settings; + SettingsFlagsAndId id(SETTINGS_FLAG_PLEASE_PERSIST, + SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 2; - test_settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); + test_settings.push_back(SpdySetting(id, max_concurrent_streams)); settings_storage.Set(test_host_port_pair, test_settings); EXPECT_NE(0u, settings_storage.Get(test_host_port_pair).size()); @@ -916,11 +916,11 @@ TEST_F(SpdySessionSpdy3Test, ClearSettingsStorageOnIPAddressChanged) { HttpServerProperties* test_http_server_properties = spdy_session_pool->http_server_properties(); - spdy::SettingsFlagsAndId id(spdy::SETTINGS_FLAG_PLEASE_PERSIST, - spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + SettingsFlagsAndId id(SETTINGS_FLAG_PLEASE_PERSIST, + SETTINGS_MAX_CONCURRENT_STREAMS); const size_t max_concurrent_streams = 2; - spdy::SpdySettings test_settings; - test_settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); + SpdySettings test_settings; + test_settings.push_back(SpdySetting(id, max_concurrent_streams)); test_http_server_properties->SetSpdySettings(test_host_port_pair, test_settings); @@ -1007,8 +1007,8 @@ TEST_F(SpdySessionSpdy3Test, SendCredentials) { MockRead reads[] = { MockRead(SYNCHRONOUS, ERR_IO_PENDING) // Stall forever. }; - spdy::SpdySettings settings; - scoped_ptr<spdy::SpdyFrame> settings_frame( + SpdySettings settings; + scoped_ptr<SpdyFrame> settings_frame( ConstructSpdySettings(settings)); MockWrite writes[] = { CreateMockWrite(*settings_frame), @@ -1081,7 +1081,7 @@ TEST_F(SpdySessionSpdy3Test, CloseSessionOnError) { session_deps.host_resolver->set_synchronous_mode(true); MockConnect connect_data(SYNCHRONOUS, OK); - scoped_ptr<spdy::SpdyFrame> goaway(ConstructSpdyGoAway()); + scoped_ptr<SpdyFrame> goaway(ConstructSpdyGoAway()); MockRead reads[] = { CreateMockRead(*goaway), MockRead(SYNCHRONOUS, 0, 0) // EOF diff --git a/net/spdy/spdy_settings_storage.cc b/net/spdy/spdy_settings_storage.cc index 19df996..7d187d6 100644 --- a/net/spdy/spdy_settings_storage.cc +++ b/net/spdy/spdy_settings_storage.cc @@ -14,27 +14,27 @@ SpdySettingsStorage::SpdySettingsStorage() { SpdySettingsStorage::~SpdySettingsStorage() { } -const spdy::SpdySettings& SpdySettingsStorage::Get( +const SpdySettings& SpdySettingsStorage::Get( const HostPortPair& host_port_pair) const { SettingsMap::const_iterator it = settings_map_.find(host_port_pair); if (it == settings_map_.end()) { - CR_DEFINE_STATIC_LOCAL(spdy::SpdySettings, kEmpty, ()); + CR_DEFINE_STATIC_LOCAL(SpdySettings, kEmpty, ()); return kEmpty; } return it->second; } void SpdySettingsStorage::Set(const HostPortPair& host_port_pair, - const spdy::SpdySettings& settings) { - spdy::SpdySettings persistent_settings; + const SpdySettings& settings) { + SpdySettings persistent_settings; // Iterate through the list, and only copy those settings which are marked // for persistence. - spdy::SpdySettings::const_iterator it; + SpdySettings::const_iterator it; for (it = settings.begin(); it != settings.end(); ++it) { - spdy::SettingsFlagsAndId id = it->first; - if (id.flags() & spdy::SETTINGS_FLAG_PLEASE_PERSIST) { - spdy::SettingsFlagsAndId new_id(spdy::SETTINGS_FLAG_PERSISTED, id.id()); + SettingsFlagsAndId id = it->first; + if (id.flags() & SETTINGS_FLAG_PLEASE_PERSIST) { + SettingsFlagsAndId new_id(SETTINGS_FLAG_PERSISTED, id.id()); persistent_settings.push_back(std::make_pair(new_id, it->second)); } } diff --git a/net/spdy/spdy_settings_storage.h b/net/spdy/spdy_settings_storage.h index cf0f9ab..f576cd4 100644 --- a/net/spdy/spdy_settings_storage.h +++ b/net/spdy/spdy_settings_storage.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -25,17 +25,17 @@ class NET_EXPORT_PRIVATE SpdySettingsStorage { // If no settings are stored, returns an empty set of settings. // NOTE: Since settings_map_ may be cleared, don't store the address of the // return value. - const spdy::SpdySettings& Get(const HostPortPair& host_port_pair) const; + const SpdySettings& Get(const HostPortPair& host_port_pair) const; // Saves settings for a host. void Set(const HostPortPair& host_port_pair, - const spdy::SpdySettings& settings); + const SpdySettings& settings); // Clears out the settings_map_ object. void Clear(); private: - typedef std::map<HostPortPair, spdy::SpdySettings> SettingsMap; + typedef std::map<HostPortPair, SpdySettings> SettingsMap; SettingsMap settings_map_; diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc index 29967e9..d0b00e7 100644 --- a/net/spdy/spdy_stream.cc +++ b/net/spdy/spdy_stream.cc @@ -14,7 +14,7 @@ namespace net { NetLogSpdyStreamErrorParameter::NetLogSpdyStreamErrorParameter( - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, int status, const std::string& description) : stream_id_(stream_id), @@ -37,7 +37,7 @@ namespace { class NetLogSpdyStreamWindowUpdateParameter : public NetLog::EventParameters { public: - NetLogSpdyStreamWindowUpdateParameter(spdy::SpdyStreamId stream_id, + NetLogSpdyStreamWindowUpdateParameter(SpdyStreamId stream_id, int32 delta, int32 window_size) : stream_id_(stream_id), delta_(delta), window_size_(window_size) {} @@ -49,7 +49,7 @@ class NetLogSpdyStreamWindowUpdateParameter : public NetLog::EventParameters { return dict; } private: - const spdy::SpdyStreamId stream_id_; + const SpdyStreamId stream_id_; const int32 delta_; const int32 window_size_; DISALLOW_COPY_AND_ASSIGN(NetLogSpdyStreamWindowUpdateParameter); @@ -67,22 +67,22 @@ bool ContainsUpperAscii(const std::string& str) { } // namespace SpdyStream::SpdyStream(SpdySession* session, - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, bool pushed, const BoundNetLog& net_log) : continue_buffering_data_(true), stream_id_(stream_id), priority_(0), stalled_by_flow_control_(false), - send_window_size_(spdy::kSpdyStreamInitialWindowSize), - recv_window_size_(spdy::kSpdyStreamInitialWindowSize), + send_window_size_(kSpdyStreamInitialWindowSize), + recv_window_size_(kSpdyStreamInitialWindowSize), unacked_recv_window_bytes_(0), pushed_(pushed), response_received_(false), session_(session), delegate_(NULL), request_time_(base::Time::Now()), - response_(new spdy::SpdyHeaderBlock), + response_(new SpdyHeaderBlock), io_state_(STATE_NONE), response_status_(OK), cancelled_(false), @@ -151,12 +151,12 @@ void SpdyStream::DetachDelegate() { Cancel(); } -const linked_ptr<spdy::SpdyHeaderBlock>& SpdyStream::spdy_headers() const { +const linked_ptr<SpdyHeaderBlock>& SpdyStream::spdy_headers() const { return request_; } void SpdyStream::set_spdy_headers( - const linked_ptr<spdy::SpdyHeaderBlock>& headers) { + const linked_ptr<SpdyHeaderBlock>& headers) { request_ = headers; } @@ -189,7 +189,7 @@ void SpdyStream::IncreaseSendWindowSize(int32 delta_window_size) { "Received WINDOW_UPDATE [delta: %d] for stream %d overflows " "send_window_size_ [current: %d]", delta_window_size, stream_id_, send_window_size_); - session_->ResetStream(stream_id_, spdy::FLOW_CONTROL_ERROR, desc); + session_->ResetStream(stream_id_, FLOW_CONTROL_ERROR, desc); return; } @@ -267,7 +267,7 @@ void SpdyStream::DecreaseRecvWindowSize(int32 delta_window_size) { // a negative |recv_window_size_|, if we do, it's a client side bug, so we use // PROTOCOL_ERROR for lack of a better error code. if (recv_window_size_ < 0) { - session_->ResetStream(stream_id_, spdy::PROTOCOL_ERROR, + session_->ResetStream(stream_id_, PROTOCOL_ERROR, "Negative recv window size"); NOTREACHED(); } @@ -293,7 +293,7 @@ void SpdyStream::SetRequestTime(base::Time t) { request_time_ = t; } -int SpdyStream::OnResponseReceived(const spdy::SpdyHeaderBlock& response) { +int SpdyStream::OnResponseReceived(const SpdyHeaderBlock& response) { int rv = OK; metrics_.StartStream(); @@ -313,11 +313,11 @@ int SpdyStream::OnResponseReceived(const spdy::SpdyHeaderBlock& response) { io_state_ = STATE_OPEN; // Append all the headers into the response header block. - for (spdy::SpdyHeaderBlock::const_iterator it = response.begin(); + for (SpdyHeaderBlock::const_iterator it = response.begin(); it != response.end(); ++it) { // Disallow uppercase headers. if (ContainsUpperAscii(it->first)) { - session_->ResetStream(stream_id_, spdy::PROTOCOL_ERROR, + session_->ResetStream(stream_id_, PROTOCOL_ERROR, "Upper case characters in header: " + it->first); response_status_ = ERR_SPDY_PROTOCOL_ERROR; return ERR_SPDY_PROTOCOL_ERROR; @@ -332,11 +332,11 @@ int SpdyStream::OnResponseReceived(const spdy::SpdyHeaderBlock& response) { return rv; } -int SpdyStream::OnHeaders(const spdy::SpdyHeaderBlock& headers) { +int SpdyStream::OnHeaders(const SpdyHeaderBlock& headers) { DCHECK(!response_->empty()); // Append all the headers into the response header block. - for (spdy::SpdyHeaderBlock::const_iterator it = headers.begin(); + for (SpdyHeaderBlock::const_iterator it = headers.begin(); it != headers.end(); ++it) { // Disallow duplicate headers. This is just to be conservative. if ((*response_).find(it->first) != (*response_).end()) { @@ -347,7 +347,7 @@ int SpdyStream::OnHeaders(const spdy::SpdyHeaderBlock& headers) { // Disallow uppercase headers. if (ContainsUpperAscii(it->first)) { - session_->ResetStream(stream_id_, spdy::PROTOCOL_ERROR, + session_->ResetStream(stream_id_, PROTOCOL_ERROR, "Upper case characters in header: " + it->first); response_status_ = ERR_SPDY_PROTOCOL_ERROR; return ERR_SPDY_PROTOCOL_ERROR; @@ -468,7 +468,7 @@ void SpdyStream::Cancel() { cancelled_ = true; if (session_->IsStreamActive(stream_id_)) - session_->ResetStream(stream_id_, spdy::CANCEL, ""); + session_->ResetStream(stream_id_, CANCEL, ""); } void SpdyStream::Close() { @@ -495,7 +495,7 @@ int SpdyStream::SendRequest(bool has_upload_data) { } int SpdyStream::WriteStreamData(IOBuffer* data, int length, - spdy::SpdyDataFlags flags) { + SpdyDataFlags flags) { return session_->WriteStreamData(stream_id_, data, length, flags); } @@ -525,7 +525,7 @@ GURL SpdyStream::GetUrl() const { } else { // assemble from the response std::string url; - spdy::SpdyHeaderBlock::const_iterator it; + SpdyHeaderBlock::const_iterator it; it = response_->find("url"); if (it != (*response_).end()) url = it->second; @@ -537,7 +537,7 @@ GURL SpdyStream::GetUrl() const { } GURL SpdyStream::GetUrlFromHeaderBlock( - const linked_ptr<spdy::SpdyHeaderBlock>& headers) const { + const linked_ptr<SpdyHeaderBlock>& headers) const { const char* scheme_header = GetProtocolVersion() >= 3 ? ":scheme" : "scheme"; const char* host_header = GetProtocolVersion() >= 3 ? ":host" : "host"; const char* path_header = GetProtocolVersion() >= 3 ? ":path" : "path"; @@ -545,7 +545,7 @@ GURL SpdyStream::GetUrlFromHeaderBlock( std::string scheme; std::string host_port; std::string path; - spdy::SpdyHeaderBlock::const_iterator it; + SpdyHeaderBlock::const_iterator it; it = headers->find(scheme_header); if (it != (*headers).end()) scheme = it->second; @@ -690,9 +690,9 @@ int SpdyStream::DoSendDomainBoundCertComplete(int result) { int SpdyStream::DoSendHeaders() { CHECK(!cancelled_); - spdy::SpdyControlFlags flags = spdy::CONTROL_FLAG_NONE; + SpdyControlFlags flags = CONTROL_FLAG_NONE; if (!has_upload_data_) - flags = spdy::CONTROL_FLAG_FIN; + flags = CONTROL_FLAG_FIN; CHECK(request_.get()); int result = session_->WriteSynStream( diff --git a/net/spdy/spdy_stream.h b/net/spdy/spdy_stream.h index 131137d..4741ad4 100644 --- a/net/spdy/spdy_stream.h +++ b/net/spdy/spdy_stream.h @@ -69,7 +69,7 @@ class NET_EXPORT_PRIVATE SpdyStream // Because a stream may have a SYN_* frame and multiple HEADERS frames, // this callback may be called multiple times. // |status| indicates network error. Returns network error code. - virtual int OnResponseReceived(const spdy::SpdyHeaderBlock& response, + virtual int OnResponseReceived(const SpdyHeaderBlock& response, base::Time response_time, int status) = 0; @@ -95,7 +95,7 @@ class NET_EXPORT_PRIVATE SpdyStream // SpdyStream constructor SpdyStream(SpdySession* session, - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, bool pushed, const BoundNetLog& net_log); @@ -112,8 +112,8 @@ class NET_EXPORT_PRIVATE SpdyStream // Is this stream a pushed stream from the server. bool pushed() const { return pushed_; } - spdy::SpdyStreamId stream_id() const { return stream_id_; } - void set_stream_id(spdy::SpdyStreamId stream_id) { stream_id_ = stream_id; } + SpdyStreamId stream_id() const { return stream_id_; } + void set_stream_id(SpdyStreamId stream_id) { stream_id_ = stream_id; } bool response_received() const { return response_received_; } void set_response_received() { response_received_ = true; } @@ -172,18 +172,18 @@ class NET_EXPORT_PRIVATE SpdyStream const BoundNetLog& net_log() const { return net_log_; } - const linked_ptr<spdy::SpdyHeaderBlock>& spdy_headers() const; - void set_spdy_headers(const linked_ptr<spdy::SpdyHeaderBlock>& headers); + const linked_ptr<SpdyHeaderBlock>& spdy_headers() const; + void set_spdy_headers(const linked_ptr<SpdyHeaderBlock>& headers); base::Time GetRequestTime() const; void SetRequestTime(base::Time t); // Called by the SpdySession when a response (e.g. a SYN_STREAM or SYN_REPLY) // has been received for this stream. Returns a status code. - int OnResponseReceived(const spdy::SpdyHeaderBlock& response); + int OnResponseReceived(const SpdyHeaderBlock& response); // Called by the SpdySession when late-bound headers are received for a // stream. Returns a status code. - int OnHeaders(const spdy::SpdyHeaderBlock& headers); + int OnHeaders(const SpdyHeaderBlock& headers); // Called by the SpdySession when response data has been received for this // stream. This callback may be called multiple times as data arrives @@ -226,7 +226,7 @@ class NET_EXPORT_PRIVATE SpdyStream // Sends DATA frame. int WriteStreamData(IOBuffer* data, int length, - spdy::SpdyDataFlags flags); + SpdyDataFlags flags); // Fills SSL info in |ssl_info| and returns true when SSL is in use. bool GetSSLInfo(SSLInfo* ssl_info, @@ -302,14 +302,14 @@ class NET_EXPORT_PRIVATE SpdyStream // Extracts the URL from the various fields in |headers|. GURL GetUrlFromHeaderBlock( - const linked_ptr<spdy::SpdyHeaderBlock>& headers) const; + const linked_ptr<SpdyHeaderBlock>& headers) const; // There is a small period of time between when a server pushed stream is // first created, and the pushed data is replayed. Any data received during // this time should continue to be buffered. bool continue_buffering_data_; - spdy::SpdyStreamId stream_id_; + SpdyStreamId stream_id_; std::string path_; int priority_; @@ -329,13 +329,13 @@ class NET_EXPORT_PRIVATE SpdyStream SpdyStream::Delegate* delegate_; // The request to send. - linked_ptr<spdy::SpdyHeaderBlock> request_; + linked_ptr<SpdyHeaderBlock> request_; // The time at which the request was made that resulted in this response. // For cached responses, this time could be "far" in the past. base::Time request_time_; - linked_ptr<spdy::SpdyHeaderBlock> response_; + linked_ptr<SpdyHeaderBlock> response_; base::Time response_time_; State io_state_; @@ -367,17 +367,17 @@ class NET_EXPORT_PRIVATE SpdyStream class NetLogSpdyStreamErrorParameter : public NetLog::EventParameters { public: - NetLogSpdyStreamErrorParameter(spdy::SpdyStreamId stream_id, + NetLogSpdyStreamErrorParameter(SpdyStreamId stream_id, int status, const std::string& description); - spdy::SpdyStreamId stream_id() const { return stream_id_; } + SpdyStreamId stream_id() const { return stream_id_; } virtual base::Value* ToValue() const OVERRIDE; private: virtual ~NetLogSpdyStreamErrorParameter(); - const spdy::SpdyStreamId stream_id_; + const SpdyStreamId stream_id_; const int status_; const std::string description_; diff --git a/net/spdy/spdy_stream_spdy2_unittest.cc b/net/spdy/spdy_stream_spdy2_unittest.cc index b2a7a13..2707c89 100644 --- a/net/spdy/spdy_stream_spdy2_unittest.cc +++ b/net/spdy/spdy_stream_spdy2_unittest.cc @@ -29,7 +29,7 @@ class TestSpdyStreamDelegate : public SpdyStream::Delegate { buf_(buf), callback_(callback), send_headers_completed_(false), - response_(new spdy::SpdyHeaderBlock), + response_(new SpdyHeaderBlock), data_sent_(0), closed_(false) {} virtual ~TestSpdyStreamDelegate() {} @@ -47,7 +47,7 @@ class TestSpdyStreamDelegate : public SpdyStream::Delegate { return ERR_UNEXPECTED; } - virtual int OnResponseReceived(const spdy::SpdyHeaderBlock& response, + virtual int OnResponseReceived(const SpdyHeaderBlock& response, base::Time response_time, int status) { EXPECT_TRUE(send_headers_completed_); @@ -55,7 +55,7 @@ class TestSpdyStreamDelegate : public SpdyStream::Delegate { if (buf_) { EXPECT_EQ(ERR_IO_PENDING, stream_->WriteStreamData(buf_.get(), buf_->size(), - spdy::DATA_FLAG_NONE)); + DATA_FLAG_NONE)); } return status; } @@ -74,7 +74,7 @@ class TestSpdyStreamDelegate : public SpdyStream::Delegate { virtual void set_chunk_callback(net::ChunkCallback *) {} bool send_headers_completed() const { return send_headers_completed_; } - const linked_ptr<spdy::SpdyHeaderBlock>& response() const { + const linked_ptr<SpdyHeaderBlock>& response() const { return response_; } const std::string& received_data() const { return received_data_; } @@ -86,15 +86,15 @@ class TestSpdyStreamDelegate : public SpdyStream::Delegate { scoped_refptr<IOBufferWithSize> buf_; CompletionCallback callback_; bool send_headers_completed_; - linked_ptr<spdy::SpdyHeaderBlock> response_; + linked_ptr<SpdyHeaderBlock> response_; std::string received_data_; int data_sent_; bool closed_; }; -spdy::SpdyFrame* ConstructSpdyBodyFrame(const char* data, int length) { - spdy::BufferedSpdyFramer framer(2); - return framer.CreateDataFrame(1, data, length, spdy::DATA_FLAG_NONE); +SpdyFrame* ConstructSpdyBodyFrame(const char* data, int length) { + BufferedSpdyFramer framer(2); + return framer.CreateDataFrame(1, data, length, DATA_FLAG_NONE); } } // anonymous namespace @@ -133,16 +133,16 @@ TEST_F(SpdyStreamSpdy2Test, SendDataAfterOpen) { SpdySessionPoolPeer pool_peer_(session_->spdy_session_pool()); const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_STREAM, + SYN_STREAM, 1, 0, net::ConvertRequestPriorityToSpdyPriority(LOWEST), - spdy::CONTROL_FLAG_NONE, + CONTROL_FLAG_NONE, false, - spdy::INVALID, + INVALID, NULL, 0, - spdy::DATA_FLAG_NONE + DATA_FLAG_NONE }; static const char* const kGetHeaders[] = { "method", @@ -156,10 +156,10 @@ TEST_F(SpdyStreamSpdy2Test, SendDataAfterOpen) { "version", "HTTP/1.1", }; - scoped_ptr<spdy::SpdyFrame> req( + scoped_ptr<SpdyFrame> req( ConstructSpdyPacket( kSynStartHeader, NULL, 0, kGetHeaders, arraysize(kGetHeaders) / 2)); - scoped_ptr<spdy::SpdyFrame> msg( + scoped_ptr<SpdyFrame> msg( ConstructSpdyBodyFrame("\0hello!\xff", 8)); MockWrite writes[] = { CreateMockWrite(*req), @@ -168,8 +168,8 @@ TEST_F(SpdyStreamSpdy2Test, SendDataAfterOpen) { writes[0].sequence_number = 0; writes[1].sequence_number = 2; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> echo( + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> echo( ConstructSpdyBodyFrame("\0hello!\xff", 8)); MockRead reads[] = { CreateMockRead(*resp), @@ -219,7 +219,7 @@ TEST_F(SpdyStreamSpdy2Test, SendDataAfterOpen) { EXPECT_FALSE(stream->HasUrl()); - linked_ptr<spdy::SpdyHeaderBlock> headers(new spdy::SpdyHeaderBlock); + linked_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock); (*headers)["method"] = "GET"; (*headers)["scheme"] = url.scheme(); (*headers)["host"] = url.host(); @@ -281,12 +281,12 @@ TEST_F(SpdyStreamSpdy2Test, PushedStream) { EXPECT_FALSE(stream->HasUrl()); // Set a couple of headers. - spdy::SpdyHeaderBlock response; + SpdyHeaderBlock response; response["url"] = kStreamUrl; stream->OnResponseReceived(response); // Send some basic headers. - spdy::SpdyHeaderBlock headers; + SpdyHeaderBlock headers; response["status"] = "200"; response["version"] = "OK"; stream->OnHeaders(headers); @@ -304,16 +304,16 @@ TEST_F(SpdyStreamSpdy2Test, StreamError) { SpdySessionPoolPeer pool_peer_(session_->spdy_session_pool()); const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_STREAM, + SYN_STREAM, 1, 0, net::ConvertRequestPriorityToSpdyPriority(LOWEST), - spdy::CONTROL_FLAG_NONE, + CONTROL_FLAG_NONE, false, - spdy::INVALID, + INVALID, NULL, 0, - spdy::DATA_FLAG_NONE + DATA_FLAG_NONE }; static const char* const kGetHeaders[] = { "method", @@ -327,10 +327,10 @@ TEST_F(SpdyStreamSpdy2Test, StreamError) { "version", "HTTP/1.1", }; - scoped_ptr<spdy::SpdyFrame> req( + scoped_ptr<SpdyFrame> req( ConstructSpdyPacket( kSynStartHeader, NULL, 0, kGetHeaders, arraysize(kGetHeaders) / 2)); - scoped_ptr<spdy::SpdyFrame> msg( + scoped_ptr<SpdyFrame> msg( ConstructSpdyBodyFrame("\0hello!\xff", 8)); MockWrite writes[] = { CreateMockWrite(*req), @@ -339,8 +339,8 @@ TEST_F(SpdyStreamSpdy2Test, StreamError) { writes[0].sequence_number = 0; writes[1].sequence_number = 2; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> echo( + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> echo( ConstructSpdyBodyFrame("\0hello!\xff", 8)); MockRead reads[] = { CreateMockRead(*resp), @@ -392,7 +392,7 @@ TEST_F(SpdyStreamSpdy2Test, StreamError) { EXPECT_FALSE(stream->HasUrl()); - linked_ptr<spdy::SpdyHeaderBlock> headers(new spdy::SpdyHeaderBlock); + linked_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock); (*headers)["method"] = "GET"; (*headers)["scheme"] = url.scheme(); (*headers)["host"] = url.host(); @@ -404,7 +404,7 @@ TEST_F(SpdyStreamSpdy2Test, StreamError) { EXPECT_EQ(ERR_IO_PENDING, stream->SendRequest(true)); - const spdy::SpdyStreamId stream_id = stream->stream_id(); + const SpdyStreamId stream_id = stream->stream_id(); EXPECT_EQ(OK, callback.WaitForResult()); diff --git a/net/spdy/spdy_stream_spdy3_unittest.cc b/net/spdy/spdy_stream_spdy3_unittest.cc index 9545284..fe03e3f 100644 --- a/net/spdy/spdy_stream_spdy3_unittest.cc +++ b/net/spdy/spdy_stream_spdy3_unittest.cc @@ -29,7 +29,7 @@ class TestSpdyStreamDelegate : public SpdyStream::Delegate { buf_(buf), callback_(callback), send_headers_completed_(false), - response_(new spdy::SpdyHeaderBlock), + response_(new SpdyHeaderBlock), data_sent_(0), closed_(false) {} virtual ~TestSpdyStreamDelegate() {} @@ -47,7 +47,7 @@ class TestSpdyStreamDelegate : public SpdyStream::Delegate { return ERR_UNEXPECTED; } - virtual int OnResponseReceived(const spdy::SpdyHeaderBlock& response, + virtual int OnResponseReceived(const SpdyHeaderBlock& response, base::Time response_time, int status) { EXPECT_TRUE(send_headers_completed_); @@ -55,7 +55,7 @@ class TestSpdyStreamDelegate : public SpdyStream::Delegate { if (buf_) { EXPECT_EQ(ERR_IO_PENDING, stream_->WriteStreamData(buf_.get(), buf_->size(), - spdy::DATA_FLAG_NONE)); + DATA_FLAG_NONE)); } return status; } @@ -74,7 +74,7 @@ class TestSpdyStreamDelegate : public SpdyStream::Delegate { virtual void set_chunk_callback(net::ChunkCallback *) {} bool send_headers_completed() const { return send_headers_completed_; } - const linked_ptr<spdy::SpdyHeaderBlock>& response() const { + const linked_ptr<SpdyHeaderBlock>& response() const { return response_; } const std::string& received_data() const { return received_data_; } @@ -86,15 +86,15 @@ class TestSpdyStreamDelegate : public SpdyStream::Delegate { scoped_refptr<IOBufferWithSize> buf_; CompletionCallback callback_; bool send_headers_completed_; - linked_ptr<spdy::SpdyHeaderBlock> response_; + linked_ptr<SpdyHeaderBlock> response_; std::string received_data_; int data_sent_; bool closed_; }; -spdy::SpdyFrame* ConstructSpdyBodyFrame(const char* data, int length) { - spdy::BufferedSpdyFramer framer(3); - return framer.CreateDataFrame(1, data, length, spdy::DATA_FLAG_NONE); +SpdyFrame* ConstructSpdyBodyFrame(const char* data, int length) { + BufferedSpdyFramer framer(3); + return framer.CreateDataFrame(1, data, length, DATA_FLAG_NONE); } } // anonymous namespace @@ -133,16 +133,16 @@ TEST_F(SpdyStreamSpdy3Test, SendDataAfterOpen) { SpdySessionPoolPeer pool_peer_(session_->spdy_session_pool()); const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_STREAM, + SYN_STREAM, 1, 0, net::ConvertRequestPriorityToSpdyPriority(LOWEST), - spdy::CONTROL_FLAG_NONE, + CONTROL_FLAG_NONE, false, - spdy::INVALID, + INVALID, NULL, 0, - spdy::DATA_FLAG_NONE + DATA_FLAG_NONE }; static const char* const kGetHeaders[] = { ":method", @@ -156,10 +156,10 @@ TEST_F(SpdyStreamSpdy3Test, SendDataAfterOpen) { ":version", "HTTP/1.1", }; - scoped_ptr<spdy::SpdyFrame> req( + scoped_ptr<SpdyFrame> req( ConstructSpdyPacket( kSynStartHeader, NULL, 0, kGetHeaders, arraysize(kGetHeaders) / 2)); - scoped_ptr<spdy::SpdyFrame> msg( + scoped_ptr<SpdyFrame> msg( ConstructSpdyBodyFrame("\0hello!\xff", 8)); MockWrite writes[] = { CreateMockWrite(*req), @@ -168,8 +168,8 @@ TEST_F(SpdyStreamSpdy3Test, SendDataAfterOpen) { writes[0].sequence_number = 0; writes[1].sequence_number = 2; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> echo( + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> echo( ConstructSpdyBodyFrame("\0hello!\xff", 8)); MockRead reads[] = { CreateMockRead(*resp), @@ -219,7 +219,7 @@ TEST_F(SpdyStreamSpdy3Test, SendDataAfterOpen) { EXPECT_FALSE(stream->HasUrl()); - linked_ptr<spdy::SpdyHeaderBlock> headers(new spdy::SpdyHeaderBlock); + linked_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock); (*headers)[":method"] = "GET"; (*headers)[":scheme"] = url.scheme(); (*headers)[":host"] = url.host(); @@ -281,7 +281,7 @@ TEST_F(SpdyStreamSpdy3Test, PushedStream) { EXPECT_FALSE(stream->HasUrl()); // Set a couple of headers. - spdy::SpdyHeaderBlock response; + SpdyHeaderBlock response; GURL url(kStreamUrl); response[":host"] = url.host(); response[":scheme"] = url.scheme(); @@ -289,7 +289,7 @@ TEST_F(SpdyStreamSpdy3Test, PushedStream) { stream->OnResponseReceived(response); // Send some basic headers. - spdy::SpdyHeaderBlock headers; + SpdyHeaderBlock headers; response["status"] = "200"; response["version"] = "OK"; stream->OnHeaders(headers); @@ -307,16 +307,16 @@ TEST_F(SpdyStreamSpdy3Test, StreamError) { SpdySessionPoolPeer pool_peer_(session_->spdy_session_pool()); const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_STREAM, + SYN_STREAM, 1, 0, net::ConvertRequestPriorityToSpdyPriority(LOWEST), - spdy::CONTROL_FLAG_NONE, + CONTROL_FLAG_NONE, false, - spdy::INVALID, + INVALID, NULL, 0, - spdy::DATA_FLAG_NONE + DATA_FLAG_NONE }; static const char* const kGetHeaders[] = { ":method", @@ -330,10 +330,10 @@ TEST_F(SpdyStreamSpdy3Test, StreamError) { ":version", "HTTP/1.1", }; - scoped_ptr<spdy::SpdyFrame> req( + scoped_ptr<SpdyFrame> req( ConstructSpdyPacket( kSynStartHeader, NULL, 0, kGetHeaders, arraysize(kGetHeaders) / 2)); - scoped_ptr<spdy::SpdyFrame> msg( + scoped_ptr<SpdyFrame> msg( ConstructSpdyBodyFrame("\0hello!\xff", 8)); MockWrite writes[] = { CreateMockWrite(*req), @@ -342,8 +342,8 @@ TEST_F(SpdyStreamSpdy3Test, StreamError) { writes[0].sequence_number = 0; writes[1].sequence_number = 2; - scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); - scoped_ptr<spdy::SpdyFrame> echo( + scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); + scoped_ptr<SpdyFrame> echo( ConstructSpdyBodyFrame("\0hello!\xff", 8)); MockRead reads[] = { CreateMockRead(*resp), @@ -395,7 +395,7 @@ TEST_F(SpdyStreamSpdy3Test, StreamError) { EXPECT_FALSE(stream->HasUrl()); - linked_ptr<spdy::SpdyHeaderBlock> headers(new spdy::SpdyHeaderBlock); + linked_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock); (*headers)[":method"] = "GET"; (*headers)[":scheme"] = url.scheme(); (*headers)[":host"] = url.host(); @@ -407,7 +407,7 @@ TEST_F(SpdyStreamSpdy3Test, StreamError) { EXPECT_EQ(ERR_IO_PENDING, stream->SendRequest(true)); - const spdy::SpdyStreamId stream_id = stream->stream_id(); + const SpdyStreamId stream_id = stream->stream_id(); EXPECT_EQ(OK, callback.WaitForResult()); diff --git a/net/spdy/spdy_test_util_spdy2.cc b/net/spdy/spdy_test_util_spdy2.cc index 1f6dbfd..a4706a7 100644 --- a/net/spdy/spdy_test_util_spdy2.cc +++ b/net/spdy/spdy_test_util_spdy2.cc @@ -40,9 +40,9 @@ MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks) { // Chop a SpdyFrame into an array of MockWrites. // |frame| is the frame to chop. // |num_chunks| is the number of chunks to create. -MockWrite* ChopWriteFrame(const spdy::SpdyFrame& frame, int num_chunks) { +MockWrite* ChopWriteFrame(const SpdyFrame& frame, int num_chunks) { return ChopWriteFrame(frame.data(), - frame.length() + spdy::SpdyFrame::kHeaderSize, + frame.length() + SpdyFrame::kHeaderSize, num_chunks); } @@ -65,9 +65,9 @@ MockRead* ChopReadFrame(const char* data, int length, int num_chunks) { // Chop a SpdyFrame into an array of MockReads. // |frame| is the frame to chop. // |num_chunks| is the number of chunks to create. -MockRead* ChopReadFrame(const spdy::SpdyFrame& frame, int num_chunks) { +MockRead* ChopReadFrame(const SpdyFrame& frame, int num_chunks) { return ChopReadFrame(frame.data(), - frame.length() + spdy::SpdyFrame::kHeaderSize, + frame.length() + SpdyFrame::kHeaderSize, num_chunks); } @@ -78,7 +78,7 @@ MockRead* ChopReadFrame(const spdy::SpdyFrame& frame, int num_chunks) { // |headers| gets filled in from |extra_headers|. void AppendHeadersToSpdyFrame(const char* const extra_headers[], int extra_header_count, - spdy::SpdyHeaderBlock* headers) { + SpdyHeaderBlock* headers) { std::string this_header; std::string this_value; @@ -151,34 +151,34 @@ int AppendToBuffer(int val, // |tail| is any (relatively constant) header-value pairs to add. // |buffer| is the buffer we're filling in. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyPacket(const SpdyHeaderInfo& header_info, +SpdyFrame* ConstructSpdyPacket(const SpdyHeaderInfo& header_info, const char* const extra_headers[], int extra_header_count, const char* const tail[], int tail_header_count) { - spdy::BufferedSpdyFramer framer(2); - spdy::SpdyHeaderBlock headers; + BufferedSpdyFramer framer(2); + SpdyHeaderBlock headers; // Copy in the extra headers to our map. AppendHeadersToSpdyFrame(extra_headers, extra_header_count, &headers); // Copy in the tail headers to our map. if (tail && tail_header_count) AppendHeadersToSpdyFrame(tail, tail_header_count, &headers); - spdy::SpdyFrame* frame = NULL; + SpdyFrame* frame = NULL; switch (header_info.kind) { - case spdy::SYN_STREAM: + case SYN_STREAM: frame = framer.CreateSynStream(header_info.id, header_info.assoc_id, header_info.priority, header_info.control_flags, header_info.compressed, &headers); break; - case spdy::SYN_REPLY: + case SYN_REPLY: frame = framer.CreateSynReply(header_info.id, header_info.control_flags, header_info.compressed, &headers); break; - case spdy::RST_STREAM: + case RST_STREAM: frame = framer.CreateRstStream(header_info.id, header_info.status); break; - case spdy::HEADERS: + case HEADERS: frame = framer.CreateHeaders(header_info.id, header_info.control_flags, header_info.compressed, &headers); break; @@ -194,48 +194,48 @@ spdy::SpdyFrame* ConstructSpdyPacket(const SpdyHeaderInfo& header_info, // Construct an expected SPDY SETTINGS frame. // |settings| are the settings to set. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdySettings( - const spdy::SpdySettings& settings) { - spdy::BufferedSpdyFramer framer(2); +SpdyFrame* ConstructSpdySettings( + const SpdySettings& settings) { + BufferedSpdyFramer framer(2); return framer.CreateSettings(settings); } // Construct an expected SPDY CREDENTIAL frame. // |credential| is the credential to sen. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyCredential( - const spdy::SpdyCredential& credential) { - spdy::BufferedSpdyFramer framer(2); +SpdyFrame* ConstructSpdyCredential( + const SpdyCredential& credential) { + BufferedSpdyFramer framer(2); return framer.CreateCredentialFrame(credential); } // Construct a SPDY PING frame. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyPing() { - spdy::BufferedSpdyFramer framer(2); +SpdyFrame* ConstructSpdyPing() { + BufferedSpdyFramer framer(2); return framer.CreatePingFrame(1); } // Construct a SPDY GOAWAY frame. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyGoAway() { - spdy::BufferedSpdyFramer framer(2); - return framer.CreateGoAway(0, spdy::GOAWAY_OK); +SpdyFrame* ConstructSpdyGoAway() { + BufferedSpdyFramer framer(2); + return framer.CreateGoAway(0, GOAWAY_OK); } // Construct a SPDY WINDOW_UPDATE frame. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyWindowUpdate( - const spdy::SpdyStreamId stream_id, uint32 delta_window_size) { - spdy::BufferedSpdyFramer framer(2); +SpdyFrame* ConstructSpdyWindowUpdate( + const SpdyStreamId stream_id, uint32 delta_window_size) { + BufferedSpdyFramer framer(2); return framer.CreateWindowUpdate(stream_id, delta_window_size); } // Construct a SPDY RST_STREAM frame. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyRstStream(spdy::SpdyStreamId stream_id, - spdy::SpdyStatusCodes status) { - spdy::BufferedSpdyFramer framer(2); +SpdyFrame* ConstructSpdyRstStream(SpdyStreamId stream_id, + SpdyStatusCodes status) { + BufferedSpdyFramer framer(2); return framer.CreateRstStream(stream_id, status); } @@ -279,13 +279,13 @@ int ConstructSpdyHeader(const char* const extra_headers[], return n; } -spdy::SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], +SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], int extra_header_count, bool compressed, int stream_id, RequestPriority request_priority, - spdy::SpdyControlType type, - spdy::SpdyControlFlags flags, + SpdyControlType type, + SpdyControlFlags flags, const char* const* kHeaders, int kHeadersSize) { return ConstructSpdyControlFrame(extra_headers, @@ -300,13 +300,13 @@ spdy::SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], 0); } -spdy::SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], +SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], int extra_header_count, bool compressed, int stream_id, RequestPriority request_priority, - spdy::SpdyControlType type, - spdy::SpdyControlFlags flags, + SpdyControlType type, + SpdyControlFlags flags, const char* const* kHeaders, int kHeadersSize, int associated_stream_id) { @@ -318,10 +318,10 @@ spdy::SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], // Priority flags, // Control Flags compressed, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; return ConstructSpdyPacket(kSynStartHeader, extra_headers, @@ -335,22 +335,22 @@ spdy::SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGet(const char* const url, +SpdyFrame* ConstructSpdyGet(const char* const url, bool compressed, int stream_id, RequestPriority request_priority) { const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_STREAM, // Kind = Syn + SYN_STREAM, // Kind = Syn stream_id, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(request_priority), // Priority - spdy::CONTROL_FLAG_FIN, // Control Flags + CONTROL_FLAG_FIN, // Control Flags compressed, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; GURL gurl(url); @@ -397,7 +397,7 @@ spdy::SpdyFrame* ConstructSpdyGet(const char* const url, // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], +SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], int extra_header_count, bool compressed, int stream_id, @@ -410,7 +410,7 @@ spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], +SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], int extra_header_count, bool compressed, int stream_id, @@ -433,14 +433,14 @@ spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], compressed, stream_id, request_priority, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_FIN, + SYN_STREAM, + CONTROL_FLAG_FIN, kStandardGetHeaders, arraysize(kStandardGetHeaders)); } // Constructs a standard SPDY SYN_STREAM frame for a CONNECT request. -spdy::SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], +SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], int extra_header_count, int stream_id) { const char* const kConnectHeaders[] = { @@ -454,8 +454,8 @@ spdy::SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], /*compressed*/ false, stream_id, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, kConnectHeaders, arraysize(kConnectHeaders)); } @@ -464,7 +464,7 @@ spdy::SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], +SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], int extra_header_count, int stream_id, int associated_stream_id) { @@ -481,14 +481,14 @@ spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], false, stream_id, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, kStandardGetHeaders, arraysize(kStandardGetHeaders), associated_stream_id); } -spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], +SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], int extra_header_count, int stream_id, int associated_stream_id, @@ -508,14 +508,14 @@ spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], false, stream_id, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, kStandardGetHeaders, arraysize(kStandardGetHeaders), associated_stream_id); } -spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], +SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], int extra_header_count, int stream_id, int associated_stream_id, @@ -539,14 +539,14 @@ spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], false, stream_id, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, kStandardGetHeaders, arraysize(kStandardGetHeaders), associated_stream_id); } -spdy::SpdyFrame* ConstructSpdyPush(int stream_id, +SpdyFrame* ConstructSpdyPush(int stream_id, int associated_stream_id, const char* url) { const char* const kStandardGetHeaders[] = { @@ -558,14 +558,14 @@ spdy::SpdyFrame* ConstructSpdyPush(int stream_id, false, stream_id, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, kStandardGetHeaders, arraysize(kStandardGetHeaders), associated_stream_id); } -spdy::SpdyFrame* ConstructSpdyPushHeaders(int stream_id, +SpdyFrame* ConstructSpdyPushHeaders(int stream_id, const char* const extra_headers[], int extra_header_count) { const char* const kStandardGetHeaders[] = { @@ -579,15 +579,15 @@ spdy::SpdyFrame* ConstructSpdyPushHeaders(int stream_id, false, stream_id, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, kStandardGetHeaders, arraysize(kStandardGetHeaders)); } // Constructs a standard SPDY SYN_REPLY packet with the specified status code. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdySynReplyError( +SpdyFrame* ConstructSpdySynReplyError( const char* const status, const char* const* const extra_headers, int extra_header_count, @@ -605,8 +605,8 @@ spdy::SpdyFrame* ConstructSpdySynReplyError( false, stream_id, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kStandardGetHeaders, arraysize(kStandardGetHeaders)); } @@ -615,7 +615,7 @@ spdy::SpdyFrame* ConstructSpdySynReplyError( // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGetSynReplyRedirect(int stream_id) { +SpdyFrame* ConstructSpdyGetSynReplyRedirect(int stream_id) { static const char* const kExtraHeaders[] = { "location", "http://www.foo.com/index.php", @@ -627,7 +627,7 @@ spdy::SpdyFrame* ConstructSpdyGetSynReplyRedirect(int stream_id) { // Constructs a standard SPDY SYN_REPLY packet with an Internal Server // Error status code. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdySynReplyError(int stream_id) { +SpdyFrame* ConstructSpdySynReplyError(int stream_id) { return ConstructSpdySynReplyError("500 Internal Server Error", NULL, 0, 1); } @@ -638,7 +638,7 @@ spdy::SpdyFrame* ConstructSpdySynReplyError(int stream_id) { // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[], +SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[], int extra_header_count, int stream_id) { static const char* const kStandardGetHeaders[] = { @@ -654,8 +654,8 @@ spdy::SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[], false, stream_id, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kStandardGetHeaders, arraysize(kStandardGetHeaders)); } @@ -665,7 +665,7 @@ spdy::SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[], // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyPost(int64 content_length, +SpdyFrame* ConstructSpdyPost(int64 content_length, const char* const extra_headers[], int extra_header_count) { std::string length_str = base::Int64ToString(content_length); @@ -688,8 +688,8 @@ spdy::SpdyFrame* ConstructSpdyPost(int64 content_length, false, 1, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, post_headers, arraysize(post_headers)); } @@ -698,7 +698,7 @@ spdy::SpdyFrame* ConstructSpdyPost(int64 content_length, // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructChunkedSpdyPost(const char* const extra_headers[], +SpdyFrame* ConstructChunkedSpdyPost(const char* const extra_headers[], int extra_header_count) { const char* post_headers[] = { "method", @@ -717,8 +717,8 @@ spdy::SpdyFrame* ConstructChunkedSpdyPost(const char* const extra_headers[], false, 1, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, post_headers, arraysize(post_headers)); } @@ -727,7 +727,7 @@ spdy::SpdyFrame* ConstructChunkedSpdyPost(const char* const extra_headers[], // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyPostSynReply(const char* const extra_headers[], +SpdyFrame* ConstructSpdyPostSynReply(const char* const extra_headers[], int extra_header_count) { static const char* const kStandardGetHeaders[] = { "hello", @@ -744,34 +744,34 @@ spdy::SpdyFrame* ConstructSpdyPostSynReply(const char* const extra_headers[], false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kStandardGetHeaders, arraysize(kStandardGetHeaders)); } // Constructs a single SPDY data frame with the default contents. -spdy::SpdyFrame* ConstructSpdyBodyFrame(int stream_id, bool fin) { - spdy::BufferedSpdyFramer framer(2); +SpdyFrame* ConstructSpdyBodyFrame(int stream_id, bool fin) { + BufferedSpdyFramer framer(2); return framer.CreateDataFrame( stream_id, kUploadData, kUploadDataSize, - fin ? spdy::DATA_FLAG_FIN : spdy::DATA_FLAG_NONE); + fin ? DATA_FLAG_FIN : DATA_FLAG_NONE); } // Constructs a single SPDY data frame with the given content. -spdy::SpdyFrame* ConstructSpdyBodyFrame(int stream_id, const char* data, +SpdyFrame* ConstructSpdyBodyFrame(int stream_id, const char* data, uint32 len, bool fin) { - spdy::BufferedSpdyFramer framer(2); + BufferedSpdyFramer framer(2); return framer.CreateDataFrame( - stream_id, data, len, fin ? spdy::DATA_FLAG_FIN : spdy::DATA_FLAG_NONE); + stream_id, data, len, fin ? DATA_FLAG_FIN : DATA_FLAG_NONE); } // Wraps |frame| in the payload of a data frame in stream |stream_id|. -spdy::SpdyFrame* ConstructWrappedSpdyFrame( - const scoped_ptr<spdy::SpdyFrame>& frame, +SpdyFrame* ConstructWrappedSpdyFrame( + const scoped_ptr<SpdyFrame>& frame, int stream_id) { return ConstructSpdyBodyFrame(stream_id, frame->data(), - frame->length() + spdy::SpdyFrame::kHeaderSize, + frame->length() + SpdyFrame::kHeaderSize, false); } @@ -787,14 +787,14 @@ int ConstructSpdyReplyString(const char* const extra_headers[], int packet_size = 0; char* buffer_write = buffer; int buffer_left = buffer_length; - spdy::SpdyHeaderBlock headers; + SpdyHeaderBlock headers; if (!buffer || !buffer_length) return 0; // Copy in the extra headers. AppendHeadersToSpdyFrame(extra_headers, extra_header_count, &headers); // The iterator gets us the list of header/value pairs in sorted order. - spdy::SpdyHeaderBlock::iterator next = headers.begin(); - spdy::SpdyHeaderBlock::iterator last = headers.end(); + SpdyHeaderBlock::iterator next = headers.begin(); + SpdyHeaderBlock::iterator last = headers.end(); for ( ; next != last; ++next) { // Write the header. int value_len, current_len, offset; @@ -852,51 +852,51 @@ int ConstructSpdyReplyString(const char* const extra_headers[], } // Create a MockWrite from the given SpdyFrame. -MockWrite CreateMockWrite(const spdy::SpdyFrame& req) { +MockWrite CreateMockWrite(const SpdyFrame& req) { return MockWrite( - ASYNC, req.data(), req.length() + spdy::SpdyFrame::kHeaderSize); + ASYNC, req.data(), req.length() + SpdyFrame::kHeaderSize); } // Create a MockWrite from the given SpdyFrame and sequence number. -MockWrite CreateMockWrite(const spdy::SpdyFrame& req, int seq) { +MockWrite CreateMockWrite(const SpdyFrame& req, int seq) { return CreateMockWrite(req, seq, ASYNC); } // Create a MockWrite from the given SpdyFrame and sequence number. -MockWrite CreateMockWrite(const spdy::SpdyFrame& req, int seq, IoMode mode) { +MockWrite CreateMockWrite(const SpdyFrame& req, int seq, IoMode mode) { return MockWrite( - mode, req.data(), req.length() + spdy::SpdyFrame::kHeaderSize, seq); + mode, req.data(), req.length() + SpdyFrame::kHeaderSize, seq); } // Create a MockRead from the given SpdyFrame. -MockRead CreateMockRead(const spdy::SpdyFrame& resp) { +MockRead CreateMockRead(const SpdyFrame& resp) { return MockRead( - ASYNC, resp.data(), resp.length() + spdy::SpdyFrame::kHeaderSize); + ASYNC, resp.data(), resp.length() + SpdyFrame::kHeaderSize); } // Create a MockRead from the given SpdyFrame and sequence number. -MockRead CreateMockRead(const spdy::SpdyFrame& resp, int seq) { +MockRead CreateMockRead(const SpdyFrame& resp, int seq) { return CreateMockRead(resp, seq, ASYNC); } // Create a MockRead from the given SpdyFrame and sequence number. -MockRead CreateMockRead(const spdy::SpdyFrame& resp, int seq, IoMode mode) { +MockRead CreateMockRead(const SpdyFrame& resp, int seq, IoMode mode) { return MockRead( - mode, resp.data(), resp.length() + spdy::SpdyFrame::kHeaderSize, seq); + mode, resp.data(), resp.length() + SpdyFrame::kHeaderSize, seq); } // Combines the given SpdyFrames into the given char array and returns // the total length. -int CombineFrames(const spdy::SpdyFrame** frames, int num_frames, +int CombineFrames(const SpdyFrame** frames, int num_frames, char* buff, int buff_len) { int total_len = 0; for (int i = 0; i < num_frames; ++i) { - total_len += frames[i]->length() + spdy::SpdyFrame::kHeaderSize; + total_len += frames[i]->length() + SpdyFrame::kHeaderSize; } DCHECK_LE(total_len, buff_len); char* ptr = buff; for (int i = 0; i < num_frames; ++i) { - int len = frames[i]->length() + spdy::SpdyFrame::kHeaderSize; + int len = frames[i]->length() + SpdyFrame::kHeaderSize; memcpy(ptr, frames[i]->data(), len); ptr += len; } @@ -992,18 +992,18 @@ SpdyURLRequestContext::SpdyURLRequestContext() SpdyURLRequestContext::~SpdyURLRequestContext() { } -const SpdyHeaderInfo MakeSpdyHeader(spdy::SpdyControlType type) { +const SpdyHeaderInfo MakeSpdyHeader(SpdyControlType type) { const SpdyHeaderInfo kHeader = { type, // Kind = Syn 1, // Stream ID 0, // Associated stream ID 2, // Priority - spdy::CONTROL_FLAG_FIN, // Control Flags + CONTROL_FLAG_FIN, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; return kHeader; } @@ -1013,13 +1013,13 @@ SpdyTestStateHelper::SpdyTestStateHelper() { SpdySession::set_enable_ping_based_connection_checking(false); // Compression is per-session which makes it impossible to create // SPDY frames with static methods. - spdy::SpdyFramer::set_enable_compression_default(false); + SpdyFramer::set_enable_compression_default(false); } SpdyTestStateHelper::~SpdyTestStateHelper() { SpdySession::ResetStaticSettingsToInit(); // TODO(rch): save/restore this value - spdy::SpdyFramer::set_enable_compression_default(true); + SpdyFramer::set_enable_compression_default(true); } } // namespace test_spdy2 diff --git a/net/spdy/spdy_test_util_spdy2.h b/net/spdy/spdy_test_util_spdy2.h index 7a0a59e..9441c3d 100644 --- a/net/spdy/spdy_test_util_spdy2.h +++ b/net/spdy/spdy_test_util_spdy2.h @@ -37,16 +37,16 @@ const int kUploadDataSize = arraysize(kUploadData)-1; // NOTE: In GCC, on a Mac, this can't be in an anonymous namespace! // This struct holds information used to construct spdy control and data frames. struct SpdyHeaderInfo { - spdy::SpdyControlType kind; - spdy::SpdyStreamId id; - spdy::SpdyStreamId assoc_id; - spdy::SpdyPriority priority; - spdy::SpdyControlFlags control_flags; + SpdyControlType kind; + SpdyStreamId id; + SpdyStreamId assoc_id; + SpdyPriority priority; + SpdyControlFlags control_flags; bool compressed; - spdy::SpdyStatusCodes status; + SpdyStatusCodes status; const char* data; uint32 data_length; - spdy::SpdyDataFlags data_flags; + SpdyDataFlags data_flags; }; // Chop a frame into an array of MockWrites. @@ -58,7 +58,7 @@ MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks); // Chop a SpdyFrame into an array of MockWrites. // |frame| is the frame to chop. // |num_chunks| is the number of chunks to create. -MockWrite* ChopWriteFrame(const spdy::SpdyFrame& frame, int num_chunks); +MockWrite* ChopWriteFrame(const SpdyFrame& frame, int num_chunks); // Chop a frame into an array of MockReads. // |data| is the frame to chop. @@ -69,7 +69,7 @@ MockRead* ChopReadFrame(const char* data, int length, int num_chunks); // Chop a SpdyFrame into an array of MockReads. // |frame| is the frame to chop. // |num_chunks| is the number of chunks to create. -MockRead* ChopReadFrame(const spdy::SpdyFrame& frame, int num_chunks); +MockRead* ChopReadFrame(const SpdyFrame& frame, int num_chunks); // Adds headers and values to a map. // |extra_headers| is an array of { name, value } pairs, arranged as strings @@ -78,7 +78,7 @@ MockRead* ChopReadFrame(const spdy::SpdyFrame& frame, int num_chunks); // |headers| gets filled in from |extra_headers|. void AppendHeadersToSpdyFrame(const char* const extra_headers[], int extra_header_count, - spdy::SpdyHeaderBlock* headers); + SpdyHeaderBlock* headers); // Writes |str| of the given |len| to the buffer pointed to by |buffer_handle|. // Uses a template so buffer_handle can be a char* or an unsigned char*. @@ -118,29 +118,29 @@ int AppendToBuffer(int val, // |tail| is any (relatively constant) header-value pairs to add. // |buffer| is the buffer we're filling in. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyPacket(const SpdyHeaderInfo& header_info, +SpdyFrame* ConstructSpdyPacket(const SpdyHeaderInfo& header_info, const char* const extra_headers[], int extra_header_count, const char* const tail[], int tail_header_count); // Construct a generic SpdyControlFrame. -spdy::SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], +SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], int extra_header_count, bool compressed, int stream_id, RequestPriority request_priority, - spdy::SpdyControlType type, - spdy::SpdyControlFlags flags, + SpdyControlType type, + SpdyControlFlags flags, const char* const* kHeaders, int kHeadersSize); -spdy::SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], +SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], int extra_header_count, bool compressed, int stream_id, RequestPriority request_priority, - spdy::SpdyControlType type, - spdy::SpdyControlFlags flags, + SpdyControlType type, + SpdyControlFlags flags, const char* const* kHeaders, int kHeadersSize, int associated_stream_id); @@ -158,32 +158,32 @@ int ConstructSpdyReplyString(const char* const extra_headers[], // Construct an expected SPDY SETTINGS frame. // |settings| are the settings to set. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdySettings( - const spdy::SpdySettings& settings); +SpdyFrame* ConstructSpdySettings( + const SpdySettings& settings); // Construct an expected SPDY CREDENTIAL frame. // |credential| is the credential to send. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyCredential( - const spdy::SpdyCredential& credential); +SpdyFrame* ConstructSpdyCredential( + const SpdyCredential& credential); // Construct a SPDY PING frame. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyPing(); +SpdyFrame* ConstructSpdyPing(); // Construct a SPDY GOAWAY frame. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyGoAway(); +SpdyFrame* ConstructSpdyGoAway(); // Construct a SPDY WINDOW_UPDATE frame. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyWindowUpdate(spdy::SpdyStreamId, +SpdyFrame* ConstructSpdyWindowUpdate(SpdyStreamId, uint32 delta_window_size); // Construct a SPDY RST_STREAM frame. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyRstStream(spdy::SpdyStreamId stream_id, - spdy::SpdyStatusCodes status); +SpdyFrame* ConstructSpdyRstStream(SpdyStreamId stream_id, + SpdyStatusCodes status); // Construct a single SPDY header entry, for validation. // |extra_headers| are the extra header-value pairs. @@ -201,7 +201,7 @@ int ConstructSpdyHeader(const char* const extra_headers[], // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGet(const char* const url, +SpdyFrame* ConstructSpdyGet(const char* const url, bool compressed, int stream_id, RequestPriority request_priority); @@ -210,7 +210,7 @@ spdy::SpdyFrame* ConstructSpdyGet(const char* const url, // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], +SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], int extra_header_count, bool compressed, int stream_id, @@ -221,7 +221,7 @@ spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], // will vary the most between calls. If |direct| is false, the // the full url will be used instead of simply the path. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], +SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], int extra_header_count, bool compressed, int stream_id, @@ -229,7 +229,7 @@ spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], bool direct); // Constructs a standard SPDY SYN_STREAM frame for a CONNECT request. -spdy::SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], +SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], int extra_header_count, int stream_id); @@ -237,27 +237,27 @@ spdy::SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], +SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], int extra_header_count, int stream_id, int associated_stream_id); -spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], +SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], int extra_header_count, int stream_id, int associated_stream_id, const char* url); -spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], +SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], int extra_header_count, int stream_id, int associated_stream_id, const char* url, const char* status, const char* location); -spdy::SpdyFrame* ConstructSpdyPush(int stream_id, +SpdyFrame* ConstructSpdyPush(int stream_id, int associated_stream_id, const char* url); -spdy::SpdyFrame* ConstructSpdyPushHeaders(int stream_id, +SpdyFrame* ConstructSpdyPushHeaders(int stream_id, const char* const extra_headers[], int extra_header_count); @@ -265,7 +265,7 @@ spdy::SpdyFrame* ConstructSpdyPushHeaders(int stream_id, // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[], +SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[], int extra_header_count, int stream_id); @@ -273,16 +273,16 @@ spdy::SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[], // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGetSynReplyRedirect(int stream_id); +SpdyFrame* ConstructSpdyGetSynReplyRedirect(int stream_id); // Constructs a standard SPDY SYN_REPLY packet with an Internal Server // Error status code. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdySynReplyError(int stream_id); +SpdyFrame* ConstructSpdySynReplyError(int stream_id); // Constructs a standard SPDY SYN_REPLY packet with the specified status code. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdySynReplyError( +SpdyFrame* ConstructSpdySynReplyError( const char* const status, const char* const* const extra_headers, int extra_header_count, @@ -292,7 +292,7 @@ spdy::SpdyFrame* ConstructSpdySynReplyError( // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyPost(int64 content_length, +SpdyFrame* ConstructSpdyPost(int64 content_length, const char* const extra_headers[], int extra_header_count); @@ -300,47 +300,47 @@ spdy::SpdyFrame* ConstructSpdyPost(int64 content_length, // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructChunkedSpdyPost(const char* const extra_headers[], +SpdyFrame* ConstructChunkedSpdyPost(const char* const extra_headers[], int extra_header_count); // Constructs a standard SPDY SYN_REPLY packet to match the SPDY POST. // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyPostSynReply(const char* const extra_headers[], +SpdyFrame* ConstructSpdyPostSynReply(const char* const extra_headers[], int extra_header_count); // Constructs a single SPDY data frame with the contents "hello!" -spdy::SpdyFrame* ConstructSpdyBodyFrame(int stream_id, +SpdyFrame* ConstructSpdyBodyFrame(int stream_id, bool fin); // Constructs a single SPDY data frame with the given content. -spdy::SpdyFrame* ConstructSpdyBodyFrame(int stream_id, const char* data, +SpdyFrame* ConstructSpdyBodyFrame(int stream_id, const char* data, uint32 len, bool fin); // Wraps |frame| in the payload of a data frame in stream |stream_id|. -spdy::SpdyFrame* ConstructWrappedSpdyFrame( - const scoped_ptr<spdy::SpdyFrame>& frame, int stream_id); +SpdyFrame* ConstructWrappedSpdyFrame( + const scoped_ptr<SpdyFrame>& frame, int stream_id); // Create an async MockWrite from the given SpdyFrame. -MockWrite CreateMockWrite(const spdy::SpdyFrame& req); +MockWrite CreateMockWrite(const SpdyFrame& req); // Create an async MockWrite from the given SpdyFrame and sequence number. -MockWrite CreateMockWrite(const spdy::SpdyFrame& req, int seq); +MockWrite CreateMockWrite(const SpdyFrame& req, int seq); -MockWrite CreateMockWrite(const spdy::SpdyFrame& req, int seq, IoMode mode); +MockWrite CreateMockWrite(const SpdyFrame& req, int seq, IoMode mode); // Create a MockRead from the given SpdyFrame. -MockRead CreateMockRead(const spdy::SpdyFrame& resp); +MockRead CreateMockRead(const SpdyFrame& resp); // Create a MockRead from the given SpdyFrame and sequence number. -MockRead CreateMockRead(const spdy::SpdyFrame& resp, int seq); +MockRead CreateMockRead(const SpdyFrame& resp, int seq); -MockRead CreateMockRead(const spdy::SpdyFrame& resp, int seq, IoMode mode); +MockRead CreateMockRead(const SpdyFrame& resp, int seq, IoMode mode); // Combines the given SpdyFrames into the given char array and returns // the total length. -int CombineFrames(const spdy::SpdyFrame** frames, int num_frames, +int CombineFrames(const SpdyFrame** frames, int num_frames, char* buff, int buff_len); // Helper to manage the lifetimes of the dependencies for a @@ -385,7 +385,7 @@ class SpdyURLRequestContext : public URLRequestContext { net::URLRequestContextStorage storage_; }; -const SpdyHeaderInfo MakeSpdyHeader(spdy::SpdyControlType type); +const SpdyHeaderInfo MakeSpdyHeader(SpdyControlType type); class SpdySessionPoolPeer { public: diff --git a/net/spdy/spdy_test_util_spdy3.cc b/net/spdy/spdy_test_util_spdy3.cc index 9bd8bd5..81d3c3f 100644 --- a/net/spdy/spdy_test_util_spdy3.cc +++ b/net/spdy/spdy_test_util_spdy3.cc @@ -40,9 +40,9 @@ MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks) { // Chop a SpdyFrame into an array of MockWrites. // |frame| is the frame to chop. // |num_chunks| is the number of chunks to create. -MockWrite* ChopWriteFrame(const spdy::SpdyFrame& frame, int num_chunks) { +MockWrite* ChopWriteFrame(const SpdyFrame& frame, int num_chunks) { return ChopWriteFrame(frame.data(), - frame.length() + spdy::SpdyFrame::kHeaderSize, + frame.length() + SpdyFrame::kHeaderSize, num_chunks); } @@ -65,9 +65,9 @@ MockRead* ChopReadFrame(const char* data, int length, int num_chunks) { // Chop a SpdyFrame into an array of MockReads. // |frame| is the frame to chop. // |num_chunks| is the number of chunks to create. -MockRead* ChopReadFrame(const spdy::SpdyFrame& frame, int num_chunks) { +MockRead* ChopReadFrame(const SpdyFrame& frame, int num_chunks) { return ChopReadFrame(frame.data(), - frame.length() + spdy::SpdyFrame::kHeaderSize, + frame.length() + SpdyFrame::kHeaderSize, num_chunks); } @@ -78,7 +78,7 @@ MockRead* ChopReadFrame(const spdy::SpdyFrame& frame, int num_chunks) { // |headers| gets filled in from |extra_headers|. void AppendHeadersToSpdyFrame(const char* const extra_headers[], int extra_header_count, - spdy::SpdyHeaderBlock* headers) { + SpdyHeaderBlock* headers) { std::string this_header; std::string this_value; @@ -151,34 +151,34 @@ int AppendToBuffer(int val, // |tail| is any (relatively constant) header-value pairs to add. // |buffer| is the buffer we're filling in. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyPacket(const SpdyHeaderInfo& header_info, +SpdyFrame* ConstructSpdyPacket(const SpdyHeaderInfo& header_info, const char* const extra_headers[], int extra_header_count, const char* const tail[], int tail_header_count) { - spdy::BufferedSpdyFramer framer(3); - spdy::SpdyHeaderBlock headers; + BufferedSpdyFramer framer(3); + SpdyHeaderBlock headers; // Copy in the extra headers to our map. AppendHeadersToSpdyFrame(extra_headers, extra_header_count, &headers); // Copy in the tail headers to our map. if (tail && tail_header_count) AppendHeadersToSpdyFrame(tail, tail_header_count, &headers); - spdy::SpdyFrame* frame = NULL; + SpdyFrame* frame = NULL; switch (header_info.kind) { - case spdy::SYN_STREAM: + case SYN_STREAM: frame = framer.CreateSynStream(header_info.id, header_info.assoc_id, header_info.priority, header_info.control_flags, header_info.compressed, &headers); break; - case spdy::SYN_REPLY: + case SYN_REPLY: frame = framer.CreateSynReply(header_info.id, header_info.control_flags, header_info.compressed, &headers); break; - case spdy::RST_STREAM: + case RST_STREAM: frame = framer.CreateRstStream(header_info.id, header_info.status); break; - case spdy::HEADERS: + case HEADERS: frame = framer.CreateHeaders(header_info.id, header_info.control_flags, header_info.compressed, &headers); break; @@ -194,48 +194,48 @@ spdy::SpdyFrame* ConstructSpdyPacket(const SpdyHeaderInfo& header_info, // Construct an expected SPDY SETTINGS frame. // |settings| are the settings to set. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdySettings( - const spdy::SpdySettings& settings) { - spdy::BufferedSpdyFramer framer(3); +SpdyFrame* ConstructSpdySettings( + const SpdySettings& settings) { + BufferedSpdyFramer framer(3); return framer.CreateSettings(settings); } // Construct an expected SPDY CREDENTIAL frame. // |credential| is the credential to sen. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyCredential( - const spdy::SpdyCredential& credential) { - spdy::BufferedSpdyFramer framer(3); +SpdyFrame* ConstructSpdyCredential( + const SpdyCredential& credential) { + BufferedSpdyFramer framer(3); return framer.CreateCredentialFrame(credential); } // Construct a SPDY PING frame. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyPing() { - spdy::BufferedSpdyFramer framer(3); +SpdyFrame* ConstructSpdyPing() { + BufferedSpdyFramer framer(3); return framer.CreatePingFrame(1); } // Construct a SPDY GOAWAY frame. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyGoAway() { - spdy::BufferedSpdyFramer framer(3); - return framer.CreateGoAway(0, spdy::GOAWAY_OK); +SpdyFrame* ConstructSpdyGoAway() { + BufferedSpdyFramer framer(3); + return framer.CreateGoAway(0, GOAWAY_OK); } // Construct a SPDY WINDOW_UPDATE frame. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyWindowUpdate( - const spdy::SpdyStreamId stream_id, uint32 delta_window_size) { - spdy::BufferedSpdyFramer framer(3); +SpdyFrame* ConstructSpdyWindowUpdate( + const SpdyStreamId stream_id, uint32 delta_window_size) { + BufferedSpdyFramer framer(3); return framer.CreateWindowUpdate(stream_id, delta_window_size); } // Construct a SPDY RST_STREAM frame. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyRstStream(spdy::SpdyStreamId stream_id, - spdy::SpdyStatusCodes status) { - spdy::BufferedSpdyFramer framer(3); +SpdyFrame* ConstructSpdyRstStream(SpdyStreamId stream_id, + SpdyStatusCodes status) { + BufferedSpdyFramer framer(3); return framer.CreateRstStream(stream_id, status); } @@ -279,13 +279,13 @@ int ConstructSpdyHeader(const char* const extra_headers[], return n; } -spdy::SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], +SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], int extra_header_count, bool compressed, int stream_id, RequestPriority request_priority, - spdy::SpdyControlType type, - spdy::SpdyControlFlags flags, + SpdyControlType type, + SpdyControlFlags flags, const char* const* kHeaders, int kHeadersSize) { return ConstructSpdyControlFrame(extra_headers, @@ -300,13 +300,13 @@ spdy::SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], 0); } -spdy::SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], +SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], int extra_header_count, bool compressed, int stream_id, RequestPriority request_priority, - spdy::SpdyControlType type, - spdy::SpdyControlFlags flags, + SpdyControlType type, + SpdyControlFlags flags, const char* const* kHeaders, int kHeadersSize, int associated_stream_id) { @@ -318,10 +318,10 @@ spdy::SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], // Priority flags, // Control Flags compressed, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; return ConstructSpdyPacket(kSynStartHeader, extra_headers, @@ -335,22 +335,22 @@ spdy::SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGet(const char* const url, +SpdyFrame* ConstructSpdyGet(const char* const url, bool compressed, int stream_id, RequestPriority request_priority) { const SpdyHeaderInfo kSynStartHeader = { - spdy::SYN_STREAM, // Kind = Syn + SYN_STREAM, // Kind = Syn stream_id, // Stream ID 0, // Associated stream ID net::ConvertRequestPriorityToSpdyPriority(request_priority), // Priority - spdy::CONTROL_FLAG_FIN, // Control Flags + CONTROL_FLAG_FIN, // Control Flags compressed, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; GURL gurl(url); @@ -397,7 +397,7 @@ spdy::SpdyFrame* ConstructSpdyGet(const char* const url, // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], +SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], int extra_header_count, bool compressed, int stream_id, @@ -410,7 +410,7 @@ spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], +SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], int extra_header_count, bool compressed, int stream_id, @@ -433,14 +433,14 @@ spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], compressed, stream_id, request_priority, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_FIN, + SYN_STREAM, + CONTROL_FLAG_FIN, kStandardGetHeaders, arraysize(kStandardGetHeaders)); } // Constructs a standard SPDY SYN_STREAM frame for a CONNECT request. -spdy::SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], +SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], int extra_header_count, int stream_id) { const char* const kConnectHeaders[] = { @@ -454,8 +454,8 @@ spdy::SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], /*compressed*/ false, stream_id, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, kConnectHeaders, arraysize(kConnectHeaders)); } @@ -464,7 +464,7 @@ spdy::SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], +SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], int extra_header_count, int stream_id, int associated_stream_id) { @@ -481,14 +481,14 @@ spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], false, stream_id, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, kStandardGetHeaders, arraysize(kStandardGetHeaders), associated_stream_id); } -spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], +SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], int extra_header_count, int stream_id, int associated_stream_id, @@ -508,14 +508,14 @@ spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], false, stream_id, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, kStandardGetHeaders, arraysize(kStandardGetHeaders), associated_stream_id); } -spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], +SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], int extra_header_count, int stream_id, int associated_stream_id, @@ -539,14 +539,14 @@ spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], false, stream_id, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, kStandardGetHeaders, arraysize(kStandardGetHeaders), associated_stream_id); } -spdy::SpdyFrame* ConstructSpdyPush(int stream_id, +SpdyFrame* ConstructSpdyPush(int stream_id, int associated_stream_id, const char* url) { const char* const kStandardGetHeaders[] = { @@ -558,14 +558,14 @@ spdy::SpdyFrame* ConstructSpdyPush(int stream_id, false, stream_id, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, kStandardGetHeaders, arraysize(kStandardGetHeaders), associated_stream_id); } -spdy::SpdyFrame* ConstructSpdyPushHeaders(int stream_id, +SpdyFrame* ConstructSpdyPushHeaders(int stream_id, const char* const extra_headers[], int extra_header_count) { const char* const kStandardGetHeaders[] = { @@ -579,15 +579,15 @@ spdy::SpdyFrame* ConstructSpdyPushHeaders(int stream_id, false, stream_id, LOWEST, - spdy::HEADERS, - spdy::CONTROL_FLAG_NONE, + HEADERS, + CONTROL_FLAG_NONE, kStandardGetHeaders, arraysize(kStandardGetHeaders)); } // Constructs a standard SPDY SYN_REPLY packet with the specified status code. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdySynReplyError( +SpdyFrame* ConstructSpdySynReplyError( const char* const status, const char* const* const extra_headers, int extra_header_count, @@ -605,8 +605,8 @@ spdy::SpdyFrame* ConstructSpdySynReplyError( false, stream_id, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kStandardGetHeaders, arraysize(kStandardGetHeaders)); } @@ -615,7 +615,7 @@ spdy::SpdyFrame* ConstructSpdySynReplyError( // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGetSynReplyRedirect(int stream_id) { +SpdyFrame* ConstructSpdyGetSynReplyRedirect(int stream_id) { static const char* const kExtraHeaders[] = { "location", "http://www.foo.com/index.php", @@ -627,7 +627,7 @@ spdy::SpdyFrame* ConstructSpdyGetSynReplyRedirect(int stream_id) { // Constructs a standard SPDY SYN_REPLY packet with an Internal Server // Error status code. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdySynReplyError(int stream_id) { +SpdyFrame* ConstructSpdySynReplyError(int stream_id) { return ConstructSpdySynReplyError("500 Internal Server Error", NULL, 0, 1); } @@ -638,7 +638,7 @@ spdy::SpdyFrame* ConstructSpdySynReplyError(int stream_id) { // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[], +SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[], int extra_header_count, int stream_id) { static const char* const kStandardGetHeaders[] = { @@ -654,8 +654,8 @@ spdy::SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[], false, stream_id, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kStandardGetHeaders, arraysize(kStandardGetHeaders)); } @@ -665,7 +665,7 @@ spdy::SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[], // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyPost(int64 content_length, +SpdyFrame* ConstructSpdyPost(int64 content_length, const char* const extra_headers[], int extra_header_count) { std::string length_str = base::Int64ToString(content_length); @@ -688,8 +688,8 @@ spdy::SpdyFrame* ConstructSpdyPost(int64 content_length, false, 1, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, post_headers, arraysize(post_headers)); } @@ -698,7 +698,7 @@ spdy::SpdyFrame* ConstructSpdyPost(int64 content_length, // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructChunkedSpdyPost(const char* const extra_headers[], +SpdyFrame* ConstructChunkedSpdyPost(const char* const extra_headers[], int extra_header_count) { const char* post_headers[] = { ":method", @@ -717,8 +717,8 @@ spdy::SpdyFrame* ConstructChunkedSpdyPost(const char* const extra_headers[], false, 1, LOWEST, - spdy::SYN_STREAM, - spdy::CONTROL_FLAG_NONE, + SYN_STREAM, + CONTROL_FLAG_NONE, post_headers, arraysize(post_headers)); } @@ -727,7 +727,7 @@ spdy::SpdyFrame* ConstructChunkedSpdyPost(const char* const extra_headers[], // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyPostSynReply(const char* const extra_headers[], +SpdyFrame* ConstructSpdyPostSynReply(const char* const extra_headers[], int extra_header_count) { static const char* const kStandardGetHeaders[] = { "hello", @@ -744,34 +744,34 @@ spdy::SpdyFrame* ConstructSpdyPostSynReply(const char* const extra_headers[], false, 1, LOWEST, - spdy::SYN_REPLY, - spdy::CONTROL_FLAG_NONE, + SYN_REPLY, + CONTROL_FLAG_NONE, kStandardGetHeaders, arraysize(kStandardGetHeaders)); } // Constructs a single SPDY data frame with the default contents. -spdy::SpdyFrame* ConstructSpdyBodyFrame(int stream_id, bool fin) { - spdy::BufferedSpdyFramer framer(3); +SpdyFrame* ConstructSpdyBodyFrame(int stream_id, bool fin) { + BufferedSpdyFramer framer(3); return framer.CreateDataFrame( stream_id, kUploadData, kUploadDataSize, - fin ? spdy::DATA_FLAG_FIN : spdy::DATA_FLAG_NONE); + fin ? DATA_FLAG_FIN : DATA_FLAG_NONE); } // Constructs a single SPDY data frame with the given content. -spdy::SpdyFrame* ConstructSpdyBodyFrame(int stream_id, const char* data, +SpdyFrame* ConstructSpdyBodyFrame(int stream_id, const char* data, uint32 len, bool fin) { - spdy::BufferedSpdyFramer framer(3); + BufferedSpdyFramer framer(3); return framer.CreateDataFrame( - stream_id, data, len, fin ? spdy::DATA_FLAG_FIN : spdy::DATA_FLAG_NONE); + stream_id, data, len, fin ? DATA_FLAG_FIN : DATA_FLAG_NONE); } // Wraps |frame| in the payload of a data frame in stream |stream_id|. -spdy::SpdyFrame* ConstructWrappedSpdyFrame( - const scoped_ptr<spdy::SpdyFrame>& frame, +SpdyFrame* ConstructWrappedSpdyFrame( + const scoped_ptr<SpdyFrame>& frame, int stream_id) { return ConstructSpdyBodyFrame(stream_id, frame->data(), - frame->length() + spdy::SpdyFrame::kHeaderSize, + frame->length() + SpdyFrame::kHeaderSize, false); } @@ -787,14 +787,14 @@ int ConstructSpdyReplyString(const char* const extra_headers[], int packet_size = 0; char* buffer_write = buffer; int buffer_left = buffer_length; - spdy::SpdyHeaderBlock headers; + SpdyHeaderBlock headers; if (!buffer || !buffer_length) return 0; // Copy in the extra headers. AppendHeadersToSpdyFrame(extra_headers, extra_header_count, &headers); // The iterator gets us the list of header/value pairs in sorted order. - spdy::SpdyHeaderBlock::iterator next = headers.begin(); - spdy::SpdyHeaderBlock::iterator last = headers.end(); + SpdyHeaderBlock::iterator next = headers.begin(); + SpdyHeaderBlock::iterator last = headers.end(); for ( ; next != last; ++next) { // Write the header. int value_len, current_len, offset; @@ -852,51 +852,51 @@ int ConstructSpdyReplyString(const char* const extra_headers[], } // Create a MockWrite from the given SpdyFrame. -MockWrite CreateMockWrite(const spdy::SpdyFrame& req) { +MockWrite CreateMockWrite(const SpdyFrame& req) { return MockWrite( - ASYNC, req.data(), req.length() + spdy::SpdyFrame::kHeaderSize); + ASYNC, req.data(), req.length() + SpdyFrame::kHeaderSize); } // Create a MockWrite from the given SpdyFrame and sequence number. -MockWrite CreateMockWrite(const spdy::SpdyFrame& req, int seq) { +MockWrite CreateMockWrite(const SpdyFrame& req, int seq) { return CreateMockWrite(req, seq, ASYNC); } // Create a MockWrite from the given SpdyFrame and sequence number. -MockWrite CreateMockWrite(const spdy::SpdyFrame& req, int seq, IoMode mode) { +MockWrite CreateMockWrite(const SpdyFrame& req, int seq, IoMode mode) { return MockWrite( - mode, req.data(), req.length() + spdy::SpdyFrame::kHeaderSize, seq); + mode, req.data(), req.length() + SpdyFrame::kHeaderSize, seq); } // Create a MockRead from the given SpdyFrame. -MockRead CreateMockRead(const spdy::SpdyFrame& resp) { +MockRead CreateMockRead(const SpdyFrame& resp) { return MockRead( - ASYNC, resp.data(), resp.length() + spdy::SpdyFrame::kHeaderSize); + ASYNC, resp.data(), resp.length() + SpdyFrame::kHeaderSize); } // Create a MockRead from the given SpdyFrame and sequence number. -MockRead CreateMockRead(const spdy::SpdyFrame& resp, int seq) { +MockRead CreateMockRead(const SpdyFrame& resp, int seq) { return CreateMockRead(resp, seq, ASYNC); } // Create a MockRead from the given SpdyFrame and sequence number. -MockRead CreateMockRead(const spdy::SpdyFrame& resp, int seq, IoMode mode) { +MockRead CreateMockRead(const SpdyFrame& resp, int seq, IoMode mode) { return MockRead( - mode, resp.data(), resp.length() + spdy::SpdyFrame::kHeaderSize, seq); + mode, resp.data(), resp.length() + SpdyFrame::kHeaderSize, seq); } // Combines the given SpdyFrames into the given char array and returns // the total length. -int CombineFrames(const spdy::SpdyFrame** frames, int num_frames, +int CombineFrames(const SpdyFrame** frames, int num_frames, char* buff, int buff_len) { int total_len = 0; for (int i = 0; i < num_frames; ++i) { - total_len += frames[i]->length() + spdy::SpdyFrame::kHeaderSize; + total_len += frames[i]->length() + SpdyFrame::kHeaderSize; } DCHECK_LE(total_len, buff_len); char* ptr = buff; for (int i = 0; i < num_frames; ++i) { - int len = frames[i]->length() + spdy::SpdyFrame::kHeaderSize; + int len = frames[i]->length() + SpdyFrame::kHeaderSize; memcpy(ptr, frames[i]->data(), len); ptr += len; } @@ -992,18 +992,18 @@ SpdyURLRequestContext::SpdyURLRequestContext() SpdyURLRequestContext::~SpdyURLRequestContext() { } -const SpdyHeaderInfo MakeSpdyHeader(spdy::SpdyControlType type) { +const SpdyHeaderInfo MakeSpdyHeader(SpdyControlType type) { const SpdyHeaderInfo kHeader = { type, // Kind = Syn 1, // Stream ID 0, // Associated stream ID 2, // Priority - spdy::CONTROL_FLAG_FIN, // Control Flags + CONTROL_FLAG_FIN, // Control Flags false, // Compressed - spdy::INVALID, // Status + INVALID, // Status NULL, // Data 0, // Length - spdy::DATA_FLAG_NONE // Data Flags + DATA_FLAG_NONE // Data Flags }; return kHeader; } @@ -1013,13 +1013,13 @@ SpdyTestStateHelper::SpdyTestStateHelper() { SpdySession::set_enable_ping_based_connection_checking(false); // Compression is per-session which makes it impossible to create // SPDY frames with static methods. - spdy::SpdyFramer::set_enable_compression_default(false); + SpdyFramer::set_enable_compression_default(false); } SpdyTestStateHelper::~SpdyTestStateHelper() { SpdySession::ResetStaticSettingsToInit(); // TODO(rch): save/restore this value - spdy::SpdyFramer::set_enable_compression_default(true); + SpdyFramer::set_enable_compression_default(true); } } // namespace test_spdy3 diff --git a/net/spdy/spdy_test_util_spdy3.h b/net/spdy/spdy_test_util_spdy3.h index 896617c..f7e7c00 100644 --- a/net/spdy/spdy_test_util_spdy3.h +++ b/net/spdy/spdy_test_util_spdy3.h @@ -37,16 +37,16 @@ const int kUploadDataSize = arraysize(kUploadData)-1; // NOTE: In GCC, on a Mac, this can't be in an anonymous namespace! // This struct holds information used to construct spdy control and data frames. struct SpdyHeaderInfo { - spdy::SpdyControlType kind; - spdy::SpdyStreamId id; - spdy::SpdyStreamId assoc_id; - spdy::SpdyPriority priority; - spdy::SpdyControlFlags control_flags; + SpdyControlType kind; + SpdyStreamId id; + SpdyStreamId assoc_id; + SpdyPriority priority; + SpdyControlFlags control_flags; bool compressed; - spdy::SpdyStatusCodes status; + SpdyStatusCodes status; const char* data; uint32 data_length; - spdy::SpdyDataFlags data_flags; + SpdyDataFlags data_flags; }; // Chop a frame into an array of MockWrites. @@ -58,7 +58,7 @@ MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks); // Chop a SpdyFrame into an array of MockWrites. // |frame| is the frame to chop. // |num_chunks| is the number of chunks to create. -MockWrite* ChopWriteFrame(const spdy::SpdyFrame& frame, int num_chunks); +MockWrite* ChopWriteFrame(const SpdyFrame& frame, int num_chunks); // Chop a frame into an array of MockReads. // |data| is the frame to chop. @@ -69,7 +69,7 @@ MockRead* ChopReadFrame(const char* data, int length, int num_chunks); // Chop a SpdyFrame into an array of MockReads. // |frame| is the frame to chop. // |num_chunks| is the number of chunks to create. -MockRead* ChopReadFrame(const spdy::SpdyFrame& frame, int num_chunks); +MockRead* ChopReadFrame(const SpdyFrame& frame, int num_chunks); // Adds headers and values to a map. // |extra_headers| is an array of { name, value } pairs, arranged as strings @@ -78,7 +78,7 @@ MockRead* ChopReadFrame(const spdy::SpdyFrame& frame, int num_chunks); // |headers| gets filled in from |extra_headers|. void AppendHeadersToSpdyFrame(const char* const extra_headers[], int extra_header_count, - spdy::SpdyHeaderBlock* headers); + SpdyHeaderBlock* headers); // Writes |str| of the given |len| to the buffer pointed to by |buffer_handle|. // Uses a template so buffer_handle can be a char* or an unsigned char*. @@ -118,29 +118,29 @@ int AppendToBuffer(int val, // |tail| is any (relatively constant) header-value pairs to add. // |buffer| is the buffer we're filling in. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyPacket(const SpdyHeaderInfo& header_info, +SpdyFrame* ConstructSpdyPacket(const SpdyHeaderInfo& header_info, const char* const extra_headers[], int extra_header_count, const char* const tail[], int tail_header_count); // Construct a generic SpdyControlFrame. -spdy::SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], +SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], int extra_header_count, bool compressed, int stream_id, RequestPriority request_priority, - spdy::SpdyControlType type, - spdy::SpdyControlFlags flags, + SpdyControlType type, + SpdyControlFlags flags, const char* const* kHeaders, int kHeadersSize); -spdy::SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], +SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], int extra_header_count, bool compressed, int stream_id, RequestPriority request_priority, - spdy::SpdyControlType type, - spdy::SpdyControlFlags flags, + SpdyControlType type, + SpdyControlFlags flags, const char* const* kHeaders, int kHeadersSize, int associated_stream_id); @@ -158,32 +158,32 @@ int ConstructSpdyReplyString(const char* const extra_headers[], // Construct an expected SPDY SETTINGS frame. // |settings| are the settings to set. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdySettings( - const spdy::SpdySettings& settings); +SpdyFrame* ConstructSpdySettings( + const SpdySettings& settings); // Construct an expected SPDY CREDENTIAL frame. // |credential| is the credential to send. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyCredential( - const spdy::SpdyCredential& credential); +SpdyFrame* ConstructSpdyCredential( + const SpdyCredential& credential); // Construct a SPDY PING frame. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyPing(); +SpdyFrame* ConstructSpdyPing(); // Construct a SPDY GOAWAY frame. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyGoAway(); +SpdyFrame* ConstructSpdyGoAway(); // Construct a SPDY WINDOW_UPDATE frame. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyWindowUpdate(spdy::SpdyStreamId, +SpdyFrame* ConstructSpdyWindowUpdate(SpdyStreamId, uint32 delta_window_size); // Construct a SPDY RST_STREAM frame. // Returns the constructed frame. The caller takes ownership of the frame. -spdy::SpdyFrame* ConstructSpdyRstStream(spdy::SpdyStreamId stream_id, - spdy::SpdyStatusCodes status); +SpdyFrame* ConstructSpdyRstStream(SpdyStreamId stream_id, + SpdyStatusCodes status); // Construct a single SPDY header entry, for validation. // |extra_headers| are the extra header-value pairs. @@ -201,7 +201,7 @@ int ConstructSpdyHeader(const char* const extra_headers[], // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGet(const char* const url, +SpdyFrame* ConstructSpdyGet(const char* const url, bool compressed, int stream_id, RequestPriority request_priority); @@ -210,7 +210,7 @@ spdy::SpdyFrame* ConstructSpdyGet(const char* const url, // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], +SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], int extra_header_count, bool compressed, int stream_id, @@ -221,7 +221,7 @@ spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], // will vary the most between calls. If |direct| is false, the // the full url will be used instead of simply the path. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], +SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], int extra_header_count, bool compressed, int stream_id, @@ -229,7 +229,7 @@ spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], bool direct); // Constructs a standard SPDY SYN_STREAM frame for a CONNECT request. -spdy::SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], +SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], int extra_header_count, int stream_id); @@ -237,27 +237,27 @@ spdy::SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], +SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], int extra_header_count, int stream_id, int associated_stream_id); -spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], +SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], int extra_header_count, int stream_id, int associated_stream_id, const char* url); -spdy::SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], +SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], int extra_header_count, int stream_id, int associated_stream_id, const char* url, const char* status, const char* location); -spdy::SpdyFrame* ConstructSpdyPush(int stream_id, +SpdyFrame* ConstructSpdyPush(int stream_id, int associated_stream_id, const char* url); -spdy::SpdyFrame* ConstructSpdyPushHeaders(int stream_id, +SpdyFrame* ConstructSpdyPushHeaders(int stream_id, const char* const extra_headers[], int extra_header_count); @@ -265,7 +265,7 @@ spdy::SpdyFrame* ConstructSpdyPushHeaders(int stream_id, // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[], +SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[], int extra_header_count, int stream_id); @@ -273,16 +273,16 @@ spdy::SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[], // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyGetSynReplyRedirect(int stream_id); +SpdyFrame* ConstructSpdyGetSynReplyRedirect(int stream_id); // Constructs a standard SPDY SYN_REPLY packet with an Internal Server // Error status code. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdySynReplyError(int stream_id); +SpdyFrame* ConstructSpdySynReplyError(int stream_id); // Constructs a standard SPDY SYN_REPLY packet with the specified status code. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdySynReplyError( +SpdyFrame* ConstructSpdySynReplyError( const char* const status, const char* const* const extra_headers, int extra_header_count, @@ -292,7 +292,7 @@ spdy::SpdyFrame* ConstructSpdySynReplyError( // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyPost(int64 content_length, +SpdyFrame* ConstructSpdyPost(int64 content_length, const char* const extra_headers[], int extra_header_count); @@ -300,47 +300,47 @@ spdy::SpdyFrame* ConstructSpdyPost(int64 content_length, // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructChunkedSpdyPost(const char* const extra_headers[], +SpdyFrame* ConstructChunkedSpdyPost(const char* const extra_headers[], int extra_header_count); // Constructs a standard SPDY SYN_REPLY packet to match the SPDY POST. // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. // Returns a SpdyFrame. -spdy::SpdyFrame* ConstructSpdyPostSynReply(const char* const extra_headers[], +SpdyFrame* ConstructSpdyPostSynReply(const char* const extra_headers[], int extra_header_count); // Constructs a single SPDY data frame with the contents "hello!" -spdy::SpdyFrame* ConstructSpdyBodyFrame(int stream_id, +SpdyFrame* ConstructSpdyBodyFrame(int stream_id, bool fin); // Constructs a single SPDY data frame with the given content. -spdy::SpdyFrame* ConstructSpdyBodyFrame(int stream_id, const char* data, +SpdyFrame* ConstructSpdyBodyFrame(int stream_id, const char* data, uint32 len, bool fin); // Wraps |frame| in the payload of a data frame in stream |stream_id|. -spdy::SpdyFrame* ConstructWrappedSpdyFrame( - const scoped_ptr<spdy::SpdyFrame>& frame, int stream_id); +SpdyFrame* ConstructWrappedSpdyFrame( + const scoped_ptr<SpdyFrame>& frame, int stream_id); // Create an async MockWrite from the given SpdyFrame. -MockWrite CreateMockWrite(const spdy::SpdyFrame& req); +MockWrite CreateMockWrite(const SpdyFrame& req); // Create an async MockWrite from the given SpdyFrame and sequence number. -MockWrite CreateMockWrite(const spdy::SpdyFrame& req, int seq); +MockWrite CreateMockWrite(const SpdyFrame& req, int seq); -MockWrite CreateMockWrite(const spdy::SpdyFrame& req, int seq, IoMode mode); +MockWrite CreateMockWrite(const SpdyFrame& req, int seq, IoMode mode); // Create a MockRead from the given SpdyFrame. -MockRead CreateMockRead(const spdy::SpdyFrame& resp); +MockRead CreateMockRead(const SpdyFrame& resp); // Create a MockRead from the given SpdyFrame and sequence number. -MockRead CreateMockRead(const spdy::SpdyFrame& resp, int seq); +MockRead CreateMockRead(const SpdyFrame& resp, int seq); -MockRead CreateMockRead(const spdy::SpdyFrame& resp, int seq, IoMode mode); +MockRead CreateMockRead(const SpdyFrame& resp, int seq, IoMode mode); // Combines the given SpdyFrames into the given char array and returns // the total length. -int CombineFrames(const spdy::SpdyFrame** frames, int num_frames, +int CombineFrames(const SpdyFrame** frames, int num_frames, char* buff, int buff_len); // Helper to manage the lifetimes of the dependencies for a @@ -385,7 +385,7 @@ class SpdyURLRequestContext : public URLRequestContext { net::URLRequestContextStorage storage_; }; -const SpdyHeaderInfo MakeSpdyHeader(spdy::SpdyControlType type); +const SpdyHeaderInfo MakeSpdyHeader(SpdyControlType type); class SpdySessionPoolPeer { public: diff --git a/net/spdy/spdy_websocket_stream.cc b/net/spdy/spdy_websocket_stream.cc index 0ea15c5..56fbe7a 100644 --- a/net/spdy/spdy_websocket_stream.cc +++ b/net/spdy/spdy_websocket_stream.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -55,7 +55,7 @@ int SpdyWebSocketStream::InitializeStream(const GURL& url, } int SpdyWebSocketStream::SendRequest( - const linked_ptr<spdy::SpdyHeaderBlock>& headers) { + const linked_ptr<SpdyHeaderBlock>& headers) { if (!stream_) { NOTREACHED(); return ERR_UNEXPECTED; @@ -74,7 +74,7 @@ int SpdyWebSocketStream::SendData(const char* data, int length) { } scoped_refptr<IOBuffer> buf(new IOBuffer(length)); memcpy(buf->data(), data, length); - return stream_->WriteStreamData(buf.get(), length, spdy::DATA_FLAG_NONE); + return stream_->WriteStreamData(buf.get(), length, DATA_FLAG_NONE); } void SpdyWebSocketStream::Close() { @@ -102,7 +102,7 @@ int SpdyWebSocketStream::OnSendBodyComplete(int status, bool* eof) { } int SpdyWebSocketStream::OnResponseReceived( - const spdy::SpdyHeaderBlock& response, + const SpdyHeaderBlock& response, base::Time response_time, int status) { DCHECK(delegate_); return delegate_->OnReceivedSpdyResponseHeader(response, status); diff --git a/net/spdy/spdy_websocket_stream.h b/net/spdy/spdy_websocket_stream.h index 5bce033..9971ec6 100644 --- a/net/spdy/spdy_websocket_stream.h +++ b/net/spdy/spdy_websocket_stream.h @@ -40,7 +40,7 @@ class NET_EXPORT_PRIVATE SpdyWebSocketStream // SYN_REPLY, or HEADERS frames are received. This callback may be called // multiple times as SPDY's delegate does. virtual int OnReceivedSpdyResponseHeader( - const spdy::SpdyHeaderBlock& headers, + const SpdyHeaderBlock& headers, int status) = 0; // Called when data is sent. @@ -64,7 +64,7 @@ class NET_EXPORT_PRIVATE SpdyWebSocketStream RequestPriority request_priority, const BoundNetLog& stream_net_log); - int SendRequest(const linked_ptr<spdy::SpdyHeaderBlock>& headers); + int SendRequest(const linked_ptr<SpdyHeaderBlock>& headers); int SendData(const char* data, int length); void Close(); @@ -72,7 +72,7 @@ class NET_EXPORT_PRIVATE SpdyWebSocketStream virtual bool OnSendHeadersComplete(int status) OVERRIDE; virtual int OnSendBody() OVERRIDE; virtual int OnSendBodyComplete(int status, bool* eof) OVERRIDE; - virtual int OnResponseReceived(const spdy::SpdyHeaderBlock& response, + virtual int OnResponseReceived(const SpdyHeaderBlock& response, base::Time response_time, int status) OVERRIDE; virtual void OnDataReceived(const char* data, int length) OVERRIDE; diff --git a/net/spdy/spdy_websocket_stream_spdy2_unittest.cc b/net/spdy/spdy_websocket_stream_spdy2_unittest.cc index 59d533d..91c121b 100644 --- a/net/spdy/spdy_websocket_stream_spdy2_unittest.cc +++ b/net/spdy/spdy_websocket_stream_spdy2_unittest.cc @@ -21,6 +21,8 @@ using namespace net::test_spdy2; +namespace net { + namespace { struct SpdyWebSocketStreamEvent { @@ -33,7 +35,7 @@ struct SpdyWebSocketStreamEvent { EVENT_CLOSE, }; SpdyWebSocketStreamEvent(EventType type, - const spdy::SpdyHeaderBlock& headers, + const SpdyHeaderBlock& headers, int result, const std::string& data) : event_type(type), @@ -42,17 +44,11 @@ struct SpdyWebSocketStreamEvent { data(data) {} EventType event_type; - spdy::SpdyHeaderBlock headers; + SpdyHeaderBlock headers; int result; std::string data; }; -} // namespace - -namespace net { - -namespace { - class SpdyWebSocketStreamEventRecorder : public SpdyWebSocketStream::Delegate { public: explicit SpdyWebSocketStreamEventRecorder(const CompletionCallback& callback) @@ -85,7 +81,7 @@ class SpdyWebSocketStreamEventRecorder : public SpdyWebSocketStream::Delegate { virtual void OnCreatedSpdyStream(int result) { events_.push_back( SpdyWebSocketStreamEvent(SpdyWebSocketStreamEvent::EVENT_CREATED, - spdy::SpdyHeaderBlock(), + SpdyHeaderBlock(), result, std::string())); if (!on_created_.is_null()) @@ -94,14 +90,14 @@ class SpdyWebSocketStreamEventRecorder : public SpdyWebSocketStream::Delegate { virtual void OnSentSpdyHeaders(int result) { events_.push_back( SpdyWebSocketStreamEvent(SpdyWebSocketStreamEvent::EVENT_SENT_HEADERS, - spdy::SpdyHeaderBlock(), + SpdyHeaderBlock(), result, std::string())); if (!on_sent_data_.is_null()) on_sent_data_.Run(&events_.back()); } virtual int OnReceivedSpdyResponseHeader( - const spdy::SpdyHeaderBlock& headers, int status) { + const SpdyHeaderBlock& headers, int status) { events_.push_back( SpdyWebSocketStreamEvent( SpdyWebSocketStreamEvent::EVENT_RECEIVED_HEADER, @@ -116,7 +112,7 @@ class SpdyWebSocketStreamEventRecorder : public SpdyWebSocketStream::Delegate { events_.push_back( SpdyWebSocketStreamEvent( SpdyWebSocketStreamEvent::EVENT_SENT_DATA, - spdy::SpdyHeaderBlock(), + SpdyHeaderBlock(), amount_sent, std::string())); if (!on_sent_data_.is_null()) @@ -126,7 +122,7 @@ class SpdyWebSocketStreamEventRecorder : public SpdyWebSocketStream::Delegate { events_.push_back( SpdyWebSocketStreamEvent( SpdyWebSocketStreamEvent::EVENT_RECEIVED_DATA, - spdy::SpdyHeaderBlock(), + SpdyHeaderBlock(), length, std::string(data, length))); if (!on_received_data_.is_null()) @@ -136,7 +132,7 @@ class SpdyWebSocketStreamEventRecorder : public SpdyWebSocketStream::Delegate { events_.push_back( SpdyWebSocketStreamEvent( SpdyWebSocketStreamEvent::EVENT_CLOSE, - spdy::SpdyHeaderBlock(), + SpdyHeaderBlock(), OK, std::string())); if (!on_close_.is_null()) @@ -197,22 +193,22 @@ class SpdyWebSocketStreamSpdy2Test : public testing::Test { host_port_proxy_pair_.second = ProxyServer::Direct(); const size_t max_concurrent_streams = 1; - spdy::SettingsFlagsAndId id(spdy::SETTINGS_FLAG_PLEASE_PERSIST, - spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + SettingsFlagsAndId id(SETTINGS_FLAG_PLEASE_PERSIST, + SETTINGS_MAX_CONCURRENT_STREAMS); spdy_settings_to_set_.push_back( - spdy::SpdySetting(id, max_concurrent_streams)); + SpdySetting(id, max_concurrent_streams)); - spdy::SettingsFlagsAndId id1(spdy::SETTINGS_FLAG_PERSISTED, - spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + SettingsFlagsAndId id1(SETTINGS_FLAG_PERSISTED, + SETTINGS_MAX_CONCURRENT_STREAMS); spdy_settings_to_send_.push_back( - spdy::SpdySetting(id1, max_concurrent_streams)); + SpdySetting(id1, max_concurrent_streams)); } virtual void TearDown() { MessageLoop::current()->RunAllPending(); } - void Prepare(spdy::SpdyStreamId stream_id) { + void Prepare(SpdyStreamId stream_id) { stream_id_ = stream_id; const char* const request_headers[] = { @@ -284,26 +280,26 @@ class SpdyWebSocketStreamSpdy2Test : public testing::Test { return session_->InitializeWithSocket(connection.release(), false, OK); } void SendRequest() { - linked_ptr<spdy::SpdyHeaderBlock> headers(new spdy::SpdyHeaderBlock); + linked_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock); (*headers)["url"] = "ws://example.com/echo"; (*headers)["origin"] = "http://example.com/wsdemo"; websocket_stream_->SendRequest(headers); } - spdy::SpdySettings spdy_settings_to_set_; - spdy::SpdySettings spdy_settings_to_send_; + SpdySettings spdy_settings_to_set_; + SpdySettings spdy_settings_to_send_; SpdySessionDependencies session_deps_; scoped_ptr<OrderedSocketData> data_; scoped_refptr<HttpNetworkSession> http_session_; scoped_refptr<SpdySession> session_; scoped_refptr<TransportSocketParams> transport_params_; scoped_ptr<SpdyWebSocketStream> websocket_stream_; - spdy::SpdyStreamId stream_id_; - scoped_ptr<spdy::SpdyFrame> request_frame_; - scoped_ptr<spdy::SpdyFrame> response_frame_; - scoped_ptr<spdy::SpdyFrame> message_frame_; - scoped_ptr<spdy::SpdyFrame> closing_frame_; + SpdyStreamId stream_id_; + scoped_ptr<SpdyFrame> request_frame_; + scoped_ptr<SpdyFrame> response_frame_; + scoped_ptr<SpdyFrame> message_frame_; + scoped_ptr<SpdyFrame> closing_frame_; HostPortPair host_port_pair_; HostPortProxyPair host_port_proxy_pair_; TestCompletionCallback completion_callback_; @@ -525,7 +521,7 @@ TEST_F(SpdyWebSocketStreamSpdy2Test, DestructionAfterExplicitClose) { TEST_F(SpdyWebSocketStreamSpdy2Test, IOPending) { Prepare(3); - scoped_ptr<spdy::SpdyFrame> settings_frame( + scoped_ptr<SpdyFrame> settings_frame( ConstructSpdySettings(spdy_settings_to_send_)); MockWrite writes[] = { // Setting throttling make SpdySession send settings frame automatically. diff --git a/net/spdy/spdy_websocket_stream_spdy3_unittest.cc b/net/spdy/spdy_websocket_stream_spdy3_unittest.cc index d5a9f71..f021b4e 100644 --- a/net/spdy/spdy_websocket_stream_spdy3_unittest.cc +++ b/net/spdy/spdy_websocket_stream_spdy3_unittest.cc @@ -21,6 +21,8 @@ using namespace net::test_spdy3; +namespace net { + namespace { struct SpdyWebSocketStreamEvent { @@ -33,7 +35,7 @@ struct SpdyWebSocketStreamEvent { EVENT_CLOSE, }; SpdyWebSocketStreamEvent(EventType type, - const spdy::SpdyHeaderBlock& headers, + const SpdyHeaderBlock& headers, int result, const std::string& data) : event_type(type), @@ -42,17 +44,11 @@ struct SpdyWebSocketStreamEvent { data(data) {} EventType event_type; - spdy::SpdyHeaderBlock headers; + SpdyHeaderBlock headers; int result; std::string data; }; -} // namespace - -namespace net { - -namespace { - class SpdyWebSocketStreamEventRecorder : public SpdyWebSocketStream::Delegate { public: explicit SpdyWebSocketStreamEventRecorder(const CompletionCallback& callback) @@ -85,7 +81,7 @@ class SpdyWebSocketStreamEventRecorder : public SpdyWebSocketStream::Delegate { virtual void OnCreatedSpdyStream(int result) { events_.push_back( SpdyWebSocketStreamEvent(SpdyWebSocketStreamEvent::EVENT_CREATED, - spdy::SpdyHeaderBlock(), + SpdyHeaderBlock(), result, std::string())); if (!on_created_.is_null()) @@ -94,14 +90,14 @@ class SpdyWebSocketStreamEventRecorder : public SpdyWebSocketStream::Delegate { virtual void OnSentSpdyHeaders(int result) { events_.push_back( SpdyWebSocketStreamEvent(SpdyWebSocketStreamEvent::EVENT_SENT_HEADERS, - spdy::SpdyHeaderBlock(), + SpdyHeaderBlock(), result, std::string())); if (!on_sent_data_.is_null()) on_sent_data_.Run(&events_.back()); } virtual int OnReceivedSpdyResponseHeader( - const spdy::SpdyHeaderBlock& headers, int status) { + const SpdyHeaderBlock& headers, int status) { events_.push_back( SpdyWebSocketStreamEvent( SpdyWebSocketStreamEvent::EVENT_RECEIVED_HEADER, @@ -116,7 +112,7 @@ class SpdyWebSocketStreamEventRecorder : public SpdyWebSocketStream::Delegate { events_.push_back( SpdyWebSocketStreamEvent( SpdyWebSocketStreamEvent::EVENT_SENT_DATA, - spdy::SpdyHeaderBlock(), + SpdyHeaderBlock(), amount_sent, std::string())); if (!on_sent_data_.is_null()) @@ -126,7 +122,7 @@ class SpdyWebSocketStreamEventRecorder : public SpdyWebSocketStream::Delegate { events_.push_back( SpdyWebSocketStreamEvent( SpdyWebSocketStreamEvent::EVENT_RECEIVED_DATA, - spdy::SpdyHeaderBlock(), + SpdyHeaderBlock(), length, std::string(data, length))); if (!on_received_data_.is_null()) @@ -136,7 +132,7 @@ class SpdyWebSocketStreamEventRecorder : public SpdyWebSocketStream::Delegate { events_.push_back( SpdyWebSocketStreamEvent( SpdyWebSocketStreamEvent::EVENT_CLOSE, - spdy::SpdyHeaderBlock(), + SpdyHeaderBlock(), OK, std::string())); if (!on_close_.is_null()) @@ -197,22 +193,22 @@ class SpdyWebSocketStreamSpdy3Test : public testing::Test { host_port_proxy_pair_.second = ProxyServer::Direct(); const size_t max_concurrent_streams = 1; - spdy::SettingsFlagsAndId id(spdy::SETTINGS_FLAG_PLEASE_PERSIST, - spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + SettingsFlagsAndId id(SETTINGS_FLAG_PLEASE_PERSIST, + SETTINGS_MAX_CONCURRENT_STREAMS); spdy_settings_to_set_.push_back( - spdy::SpdySetting(id, max_concurrent_streams)); + SpdySetting(id, max_concurrent_streams)); - spdy::SettingsFlagsAndId id1(spdy::SETTINGS_FLAG_PERSISTED, - spdy::SETTINGS_MAX_CONCURRENT_STREAMS); + SettingsFlagsAndId id1(SETTINGS_FLAG_PERSISTED, + SETTINGS_MAX_CONCURRENT_STREAMS); spdy_settings_to_send_.push_back( - spdy::SpdySetting(id1, max_concurrent_streams)); + SpdySetting(id1, max_concurrent_streams)); } virtual void TearDown() { MessageLoop::current()->RunAllPending(); } - void Prepare(spdy::SpdyStreamId stream_id) { + void Prepare(SpdyStreamId stream_id) { stream_id_ = stream_id; const char* const request_headers[] = { @@ -284,26 +280,26 @@ class SpdyWebSocketStreamSpdy3Test : public testing::Test { return session_->InitializeWithSocket(connection.release(), false, OK); } void SendRequest() { - linked_ptr<spdy::SpdyHeaderBlock> headers(new spdy::SpdyHeaderBlock); + linked_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock); (*headers)["url"] = "ws://example.com/echo"; (*headers)["origin"] = "http://example.com/wsdemo"; websocket_stream_->SendRequest(headers); } - spdy::SpdySettings spdy_settings_to_set_; - spdy::SpdySettings spdy_settings_to_send_; + SpdySettings spdy_settings_to_set_; + SpdySettings spdy_settings_to_send_; SpdySessionDependencies session_deps_; scoped_ptr<OrderedSocketData> data_; scoped_refptr<HttpNetworkSession> http_session_; scoped_refptr<SpdySession> session_; scoped_refptr<TransportSocketParams> transport_params_; scoped_ptr<SpdyWebSocketStream> websocket_stream_; - spdy::SpdyStreamId stream_id_; - scoped_ptr<spdy::SpdyFrame> request_frame_; - scoped_ptr<spdy::SpdyFrame> response_frame_; - scoped_ptr<spdy::SpdyFrame> message_frame_; - scoped_ptr<spdy::SpdyFrame> closing_frame_; + SpdyStreamId stream_id_; + scoped_ptr<SpdyFrame> request_frame_; + scoped_ptr<SpdyFrame> response_frame_; + scoped_ptr<SpdyFrame> message_frame_; + scoped_ptr<SpdyFrame> closing_frame_; HostPortPair host_port_pair_; HostPortProxyPair host_port_proxy_pair_; TestCompletionCallback completion_callback_; @@ -525,7 +521,7 @@ TEST_F(SpdyWebSocketStreamSpdy3Test, DestructionAfterExplicitClose) { TEST_F(SpdyWebSocketStreamSpdy3Test, IOPending) { Prepare(3); - scoped_ptr<spdy::SpdyFrame> settings_frame( + scoped_ptr<SpdyFrame> settings_frame( ConstructSpdySettings(spdy_settings_to_send_)); MockWrite writes[] = { // Setting throttling make SpdySession send settings frame automatically. diff --git a/net/spdy/spdy_websocket_test_util_spdy2.cc b/net/spdy/spdy_websocket_test_util_spdy2.cc index 7deda4e..a72398e 100644 --- a/net/spdy/spdy_websocket_test_util_spdy2.cc +++ b/net/spdy/spdy_websocket_test_util_spdy2.cc @@ -19,24 +19,24 @@ namespace net { namespace test_spdy2 { -spdy::SpdyFrame* ConstructSpdyWebSocketHandshakeRequestFrame( +SpdyFrame* ConstructSpdyWebSocketHandshakeRequestFrame( const char* const headers[], int header_count, - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, RequestPriority request_priority) { // SPDY SYN_STREAM control frame header. const SpdyHeaderInfo kSynStreamHeader = { - spdy::SYN_STREAM, + SYN_STREAM, stream_id, kDefaultAssociatedStreamId, ConvertRequestPriorityToSpdyPriority(request_priority), - spdy::CONTROL_FLAG_NONE, + CONTROL_FLAG_NONE, kDefaultCompressed, - spdy::INVALID, + INVALID, kDefaultDataPointer, kDefaultDataLength, - spdy::DATA_FLAG_NONE + DATA_FLAG_NONE }; // Construct SPDY SYN_STREAM control frame. @@ -48,24 +48,24 @@ spdy::SpdyFrame* ConstructSpdyWebSocketHandshakeRequestFrame( header_count); } -spdy::SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame( +SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame( const char* const headers[], int header_count, - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, RequestPriority request_priority) { // SPDY SYN_REPLY control frame header. const SpdyHeaderInfo kSynReplyHeader = { - spdy::SYN_REPLY, + SYN_REPLY, stream_id, kDefaultAssociatedStreamId, ConvertRequestPriorityToSpdyPriority(request_priority), - spdy::CONTROL_FLAG_NONE, + CONTROL_FLAG_NONE, kDefaultCompressed, - spdy::INVALID, + INVALID, kDefaultDataPointer, kDefaultDataLength, - spdy::DATA_FLAG_NONE + DATA_FLAG_NONE }; // Construct SPDY SYN_REPLY control frame. @@ -77,19 +77,19 @@ spdy::SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame( header_count); } -spdy::SpdyFrame* ConstructSpdyWebSocketDataFrame( +SpdyFrame* ConstructSpdyWebSocketDataFrame( const char* data, int len, - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, bool fin) { // Construct SPDY data frame. - spdy::BufferedSpdyFramer framer(2); + BufferedSpdyFramer framer(2); return framer.CreateDataFrame( stream_id, data, len, - fin ? spdy::DATA_FLAG_FIN : spdy::DATA_FLAG_NONE); + fin ? DATA_FLAG_FIN : DATA_FLAG_NONE); } } // namespace test_spdy2 diff --git a/net/spdy/spdy_websocket_test_util_spdy2.h b/net/spdy/spdy_websocket_test_util_spdy2.h index acdd9b3..29ea748 100644 --- a/net/spdy/spdy_websocket_test_util_spdy2.h +++ b/net/spdy/spdy_websocket_test_util_spdy2.h @@ -14,24 +14,24 @@ namespace net { namespace test_spdy2 { // Construct a WebSocket over SPDY handshake request packet. -spdy::SpdyFrame* ConstructSpdyWebSocketHandshakeRequestFrame( +SpdyFrame* ConstructSpdyWebSocketHandshakeRequestFrame( const char* const headers[], int header_count, - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, RequestPriority request_priority); // Construct a WebSocket over SPDY handshake response packet. -spdy::SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame( +SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame( const char* const headers[], int header_count, - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, RequestPriority request_priority); // Construct a WebSocket over SPDY data packet. -spdy::SpdyFrame* ConstructSpdyWebSocketDataFrame( +SpdyFrame* ConstructSpdyWebSocketDataFrame( const char* data, int len, - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, bool fin); } // namespace test_spdy2 diff --git a/net/spdy/spdy_websocket_test_util_spdy3.cc b/net/spdy/spdy_websocket_test_util_spdy3.cc index 555eece..1cc6b5b 100644 --- a/net/spdy/spdy_websocket_test_util_spdy3.cc +++ b/net/spdy/spdy_websocket_test_util_spdy3.cc @@ -19,24 +19,24 @@ namespace net { namespace test_spdy3 { -spdy::SpdyFrame* ConstructSpdyWebSocketHandshakeRequestFrame( +SpdyFrame* ConstructSpdyWebSocketHandshakeRequestFrame( const char* const headers[], int header_count, - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, RequestPriority request_priority) { // SPDY SYN_STREAM control frame header. const SpdyHeaderInfo kSynStreamHeader = { - spdy::SYN_STREAM, + SYN_STREAM, stream_id, kDefaultAssociatedStreamId, ConvertRequestPriorityToSpdyPriority(request_priority), - spdy::CONTROL_FLAG_NONE, + CONTROL_FLAG_NONE, kDefaultCompressed, - spdy::INVALID, + INVALID, kDefaultDataPointer, kDefaultDataLength, - spdy::DATA_FLAG_NONE + DATA_FLAG_NONE }; // Construct SPDY SYN_STREAM control frame. @@ -48,24 +48,24 @@ spdy::SpdyFrame* ConstructSpdyWebSocketHandshakeRequestFrame( header_count); } -spdy::SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame( +SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame( const char* const headers[], int header_count, - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, RequestPriority request_priority) { // SPDY SYN_REPLY control frame header. const SpdyHeaderInfo kSynReplyHeader = { - spdy::SYN_REPLY, + SYN_REPLY, stream_id, kDefaultAssociatedStreamId, ConvertRequestPriorityToSpdyPriority(request_priority), - spdy::CONTROL_FLAG_NONE, + CONTROL_FLAG_NONE, kDefaultCompressed, - spdy::INVALID, + INVALID, kDefaultDataPointer, kDefaultDataLength, - spdy::DATA_FLAG_NONE + DATA_FLAG_NONE }; // Construct SPDY SYN_REPLY control frame. @@ -77,19 +77,19 @@ spdy::SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame( header_count); } -spdy::SpdyFrame* ConstructSpdyWebSocketDataFrame( +SpdyFrame* ConstructSpdyWebSocketDataFrame( const char* data, int len, - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, bool fin) { // Construct SPDY data frame. - spdy::BufferedSpdyFramer framer(3); + BufferedSpdyFramer framer(3); return framer.CreateDataFrame( stream_id, data, len, - fin ? spdy::DATA_FLAG_FIN : spdy::DATA_FLAG_NONE); + fin ? DATA_FLAG_FIN : DATA_FLAG_NONE); } } // namespace test_spdy3 diff --git a/net/spdy/spdy_websocket_test_util_spdy3.h b/net/spdy/spdy_websocket_test_util_spdy3.h index d4d32f8..2054c48 100644 --- a/net/spdy/spdy_websocket_test_util_spdy3.h +++ b/net/spdy/spdy_websocket_test_util_spdy3.h @@ -14,24 +14,24 @@ namespace net { namespace test_spdy3 { // Construct a WebSocket over SPDY handshake request packet. -spdy::SpdyFrame* ConstructSpdyWebSocketHandshakeRequestFrame( +SpdyFrame* ConstructSpdyWebSocketHandshakeRequestFrame( const char* const headers[], int header_count, - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, RequestPriority request_priority); // Construct a WebSocket over SPDY handshake response packet. -spdy::SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame( +SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame( const char* const headers[], int header_count, - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, RequestPriority request_priority); // Construct a WebSocket over SPDY data packet. -spdy::SpdyFrame* ConstructSpdyWebSocketDataFrame( +SpdyFrame* ConstructSpdyWebSocketDataFrame( const char* data, int len, - spdy::SpdyStreamId stream_id, + SpdyStreamId stream_id, bool fin); } // namespace test_spdy3 diff --git a/net/tools/flip_server/constants.h b/net/tools/flip_server/constants.h index c0bc98c..a9fa3db 100644 --- a/net/tools/flip_server/constants.h +++ b/net/tools/flip_server/constants.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,7 +9,7 @@ const int kMSS = 1460; const int kSSLOverhead = 25; -const int kSpdyOverhead = spdy::SpdyFrame::kHeaderSize; +const int kSpdyOverhead = net::SpdyFrame::kHeaderSize; const int kInitialDataSendersThreshold = (2 * kMSS) - kSpdyOverhead; const int kSSLSegmentSize = (1 * kMSS) - kSSLOverhead; const int kSpdySegmentSize = kSSLSegmentSize - kSpdyOverhead; diff --git a/net/tools/flip_server/spdy_interface.cc b/net/tools/flip_server/spdy_interface.cc index 4638b1f..6ef3a2d 100644 --- a/net/tools/flip_server/spdy_interface.cc +++ b/net/tools/flip_server/spdy_interface.cc @@ -13,31 +13,6 @@ #include "net/tools/flip_server/http_interface.h" #include "net/tools/flip_server/spdy_util.h" -using spdy::kSpdyStreamMaximumWindowSize; -using spdy::CONTROL_FLAG_NONE; -using spdy::DATA_FLAG_COMPRESSED; -using spdy::DATA_FLAG_FIN; -using spdy::RST_STREAM; -using spdy::SETTINGS_MAX_CONCURRENT_STREAMS; -using spdy::SYN_REPLY; -using spdy::SYN_STREAM; -using spdy::BufferedSpdyFramer; -using spdy::SettingsFlagsAndId; -using spdy::SpdyControlFrame; -using spdy::SpdySettingsControlFrame; -using spdy::SpdyDataFlags; -using spdy::SpdyDataFrame; -using spdy::SpdyRstStreamControlFrame; -using spdy::SpdyFrame; -using spdy::SpdyFramer; -using spdy::SpdyFramerVisitorInterface; -using spdy::SpdyHeaderBlock; -using spdy::SpdySetting; -using spdy::SpdySettings; -using spdy::SpdyStreamId; -using spdy::SpdySynReplyControlFrame; -using spdy::SpdySynStreamControlFrame; - namespace net { // static @@ -147,7 +122,7 @@ SMInterface* SpdySM::FindOrMakeNewSMConnectionInterface( int SpdySM::SpdyHandleNewStream( const SpdySynStreamControlFrame* syn_stream, - const linked_ptr<spdy::SpdyHeaderBlock>& headers, + const linked_ptr<SpdyHeaderBlock>& headers, std::string &http_data, bool* is_https_scheme) { *is_https_scheme = false; @@ -226,8 +201,8 @@ void SpdySM::OnStreamFrameData(SpdyStreamId stream_id, interface->ProcessWriteInput(data, len); } -void SpdySM::OnSynStream(const spdy::SpdySynStreamControlFrame& syn_stream, - const linked_ptr<spdy::SpdyHeaderBlock>& headers) { +void SpdySM::OnSynStream(const SpdySynStreamControlFrame& syn_stream, + const linked_ptr<SpdyHeaderBlock>& headers) { std::string http_data; bool is_https_scheme; int ret = SpdyHandleNewStream(&syn_stream, headers, http_data, @@ -259,21 +234,21 @@ void SpdySM::OnSynStream(const spdy::SpdySynStreamControlFrame& syn_stream, } } -void SpdySM::OnSynReply(const spdy::SpdySynReplyControlFrame& frame, - const linked_ptr<spdy::SpdyHeaderBlock>& headers) { +void SpdySM::OnSynReply(const SpdySynReplyControlFrame& frame, + const linked_ptr<SpdyHeaderBlock>& headers) { // TODO(willchan): if there is an error parsing headers, we // should send a RST_STREAM. VLOG(2) << ACCEPTOR_CLIENT_IDENT << "SpdySM: OnSynReply(" << frame.stream_id() << ")"; } -void SpdySM::OnHeaders(const spdy::SpdyHeadersControlFrame& frame, - const linked_ptr<spdy::SpdyHeaderBlock>& headers) { +void SpdySM::OnHeaders(const SpdyHeadersControlFrame& frame, + const linked_ptr<SpdyHeaderBlock>& headers) { VLOG(2) << ACCEPTOR_CLIENT_IDENT << "SpdySM: OnHeaders(" << frame.stream_id() << ")"; } -void SpdySM::OnRstStream(const spdy::SpdyRstStreamControlFrame& frame) { +void SpdySM::OnRstStream(const SpdyRstStreamControlFrame& frame) { VLOG(2) << ACCEPTOR_CLIENT_IDENT << "SpdySM: OnRstStream(" << frame.stream_id() << ")"; client_output_ordering_.RemoveStreamId(frame.stream_id()); diff --git a/net/tools/flip_server/spdy_interface.h b/net/tools/flip_server/spdy_interface.h index 621a4ee..a53d577 100644 --- a/net/tools/flip_server/spdy_interface.h +++ b/net/tools/flip_server/spdy_interface.h @@ -23,7 +23,7 @@ namespace net { class FlipAcceptor; class MemoryCache; -class SpdySM : public spdy::BufferedSpdyFramerVisitorInterface, +class SpdySM : public BufferedSpdyFramerVisitorInterface, public SMInterface { public: SpdySM(SMConnection* connection, @@ -55,35 +55,35 @@ class SpdySM : public spdy::BufferedSpdyFramerVisitorInterface, SMInterface* NewConnectionInterface(); SMInterface* FindOrMakeNewSMConnectionInterface(std::string server_ip, std::string server_port); - int SpdyHandleNewStream(const spdy::SpdySynStreamControlFrame* frame, - const linked_ptr<spdy::SpdyHeaderBlock>& headers, + int SpdyHandleNewStream(const SpdySynStreamControlFrame* frame, + const linked_ptr<SpdyHeaderBlock>& headers, std::string& http_data, bool* is_https_scheme); // BufferedSpdyFramerVisitorInterface: virtual void OnError(int error_code) OVERRIDE {} - virtual void OnStreamError(spdy::SpdyStreamId stream_id, + virtual void OnStreamError(SpdyStreamId stream_id, const std::string& description) OVERRIDE {} virtual void OnRstStream( - const spdy::SpdyRstStreamControlFrame& frame) OVERRIDE; - virtual void OnGoAway(const spdy::SpdyGoAwayControlFrame& frame) OVERRIDE {} - virtual void OnPing(const spdy::SpdyPingControlFrame& frame) OVERRIDE {} + const SpdyRstStreamControlFrame& frame) OVERRIDE; + virtual void OnGoAway(const SpdyGoAwayControlFrame& frame) OVERRIDE {} + virtual void OnPing(const SpdyPingControlFrame& frame) OVERRIDE {} virtual void OnWindowUpdate( - const spdy::SpdyWindowUpdateControlFrame& frame) OVERRIDE {} - virtual void OnStreamFrameData(spdy::SpdyStreamId stream_id, + const SpdyWindowUpdateControlFrame& frame) OVERRIDE {} + virtual void OnStreamFrameData(SpdyStreamId stream_id, const char* data, size_t len) OVERRIDE; virtual void OnSetting( - spdy::SpdySettingsIds id, uint8 flags, uint32 value) OVERRIDE {} + SpdySettingsIds id, uint8 flags, uint32 value) OVERRIDE {} virtual void OnSynStream( - const spdy::SpdySynStreamControlFrame& frame, - const linked_ptr<spdy::SpdyHeaderBlock>& headers) OVERRIDE; + const SpdySynStreamControlFrame& frame, + const linked_ptr<SpdyHeaderBlock>& headers) OVERRIDE; virtual void OnSynReply( - const spdy::SpdySynReplyControlFrame& frame, - const linked_ptr<spdy::SpdyHeaderBlock>& headers) OVERRIDE; + const SpdySynReplyControlFrame& frame, + const linked_ptr<SpdyHeaderBlock>& headers) OVERRIDE; virtual void OnHeaders( - const spdy::SpdyHeadersControlFrame& frame, - const linked_ptr<spdy::SpdyHeaderBlock>& headers) OVERRIDE; + const SpdyHeadersControlFrame& frame, + const linked_ptr<SpdyHeaderBlock>& headers) OVERRIDE; public: virtual size_t ProcessReadInput(const char* data, size_t len) OVERRIDE; @@ -116,7 +116,7 @@ class SpdySM : public spdy::BufferedSpdyFramerVisitorInterface, const BalsaHeaders& headers) OVERRIDE; virtual void SendDataFrame(uint32 stream_id, const char* data, int64 len, uint32 flags, bool compress) OVERRIDE; - spdy::BufferedSpdyFramer* spdy_framer() { + BufferedSpdyFramer* spdy_framer() { return buffered_spdy_framer_; } @@ -130,16 +130,16 @@ class SpdySM : public spdy::BufferedSpdyFramerVisitorInterface, void SendErrorNotFoundImpl(uint32 stream_id); void SendOKResponseImpl(uint32 stream_id, std::string* output); void KillStream(uint32 stream_id); - void CopyHeaders(spdy::SpdyHeaderBlock& dest, const BalsaHeaders& headers); + void CopyHeaders(SpdyHeaderBlock& dest, const BalsaHeaders& headers); size_t SendSynStreamImpl(uint32 stream_id, const BalsaHeaders& headers); size_t SendSynReplyImpl(uint32 stream_id, const BalsaHeaders& headers); void SendDataFrameImpl(uint32 stream_id, const char* data, int64 len, - spdy::SpdyDataFlags flags, bool compress); + SpdyDataFlags flags, bool compress); void EnqueueDataFrame(DataFrame* df); virtual void GetOutput() OVERRIDE; private: uint64 seq_num_; - spdy::BufferedSpdyFramer* buffered_spdy_framer_; + BufferedSpdyFramer* buffered_spdy_framer_; bool valid_spdy_session_; // True if we have seen valid data on this session. // Use this to fail fast when junk is sent to our // port. diff --git a/net/websockets/websocket_handshake_handler.cc b/net/websockets/websocket_handshake_handler.cc index 9f313b7..888a546 100644 --- a/net/websockets/websocket_handshake_handler.cc +++ b/net/websockets/websocket_handshake_handler.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -265,7 +265,7 @@ HttpRequestInfo WebSocketHandshakeRequestHandler::GetRequestInfo( } bool WebSocketHandshakeRequestHandler::GetRequestHeaderBlock( - const GURL& url, spdy::SpdyHeaderBlock* headers, std::string* challenge) { + const GURL& url, SpdyHeaderBlock* headers, std::string* challenge) { // We don't set "method" and "version". These are fixed value in WebSocket // protocol. (*headers)["url"] = url.spec(); @@ -301,7 +301,7 @@ bool WebSocketHandshakeRequestHandler::GetRequestHeaderBlock( } // Others should be sent out to |headers|. std::string name = StringToLowerASCII(iter.name()); - spdy::SpdyHeaderBlock::iterator found = headers->find(name); + SpdyHeaderBlock::iterator found = headers->find(name); if (found == headers->end()) { (*headers)[name] = iter.values(); } else { @@ -446,7 +446,7 @@ bool WebSocketHandshakeResponseHandler::ParseResponseInfo( } bool WebSocketHandshakeResponseHandler::ParseResponseHeaderBlock( - const spdy::SpdyHeaderBlock& headers, + const SpdyHeaderBlock& headers, const std::string& challenge) { std::string response_message; if (protocol_version_ >= kMinVersionOfHybiNewHandshake) { @@ -466,7 +466,7 @@ bool WebSocketHandshakeResponseHandler::ParseResponseHeaderBlock( response_message += "Sec-WebSocket-Accept: " + websocket_accept + "\r\n"; } - for (spdy::SpdyHeaderBlock::const_iterator iter = headers.begin(); + for (SpdyHeaderBlock::const_iterator iter = headers.begin(); iter != headers.end(); ++iter) { // For each value, if the server sends a NUL-separated list of values, diff --git a/net/websockets/websocket_handshake_handler.h b/net/websockets/websocket_handshake_handler.h index be6c13d..46a0a39 100644 --- a/net/websockets/websocket_handshake_handler.h +++ b/net/websockets/websocket_handshake_handler.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -68,7 +68,7 @@ class NET_EXPORT_PRIVATE WebSocketHandshakeRequestHandler { // Gets request as SpdyHeaderBlock. // Also, fills challenge data in |challenge|. bool GetRequestHeaderBlock(const GURL& url, - spdy::SpdyHeaderBlock* headers, + SpdyHeaderBlock* headers, std::string* challenge); // Gets WebSocket handshake raw request message to open WebSocket // connection. @@ -117,7 +117,7 @@ class NET_EXPORT_PRIVATE WebSocketHandshakeResponseHandler { bool ParseResponseInfo(const HttpResponseInfo& response_info, const std::string& challenge); // Parses WebSocket handshake response as SpdyHeaderBlock. - bool ParseResponseHeaderBlock(const spdy::SpdyHeaderBlock& headers, + bool ParseResponseHeaderBlock(const SpdyHeaderBlock& headers, const std::string& challenge); // Gets the headers value. diff --git a/net/websockets/websocket_handshake_handler_unittest.cc b/net/websockets/websocket_handshake_handler_unittest.cc index 4750e1a..606e528 100644 --- a/net/websockets/websocket_handshake_handler_unittest.cc +++ b/net/websockets/websocket_handshake_handler_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -489,7 +489,7 @@ TEST(WebSocketHandshakeHandlerTest, SpdyRequestResponse) { GURL url("ws://example.com/demo"); std::string challenge; - spdy::SpdyHeaderBlock headers; + SpdyHeaderBlock headers; ASSERT_TRUE(request_handler.GetRequestHeaderBlock(url, &headers, &challenge)); EXPECT_EQ(url.spec(), headers["url"]); @@ -559,7 +559,7 @@ TEST(WebSocketHandshakeHandlerTest, SpdyRequestResponseHybi06Handshake) { GURL url("ws://example.com/demo"); std::string challenge; - spdy::SpdyHeaderBlock headers; + SpdyHeaderBlock headers; ASSERT_TRUE(request_handler.GetRequestHeaderBlock(url, &headers, &challenge)); EXPECT_EQ(url.spec(), headers["url"]); @@ -623,7 +623,7 @@ TEST(WebSocketHandshakeHandlerTest, SpdyRequestResponseWithCookies) { GURL url("ws://example.com/demo"); std::string challenge; - spdy::SpdyHeaderBlock headers; + SpdyHeaderBlock headers; ASSERT_TRUE(request_handler.GetRequestHeaderBlock(url, &headers, &challenge)); EXPECT_EQ(url.spec(), headers["url"]); @@ -699,7 +699,7 @@ TEST(WebSocketHandshakeHandlerTest, GURL url("ws://example.com/demo"); std::string challenge; - spdy::SpdyHeaderBlock headers; + SpdyHeaderBlock headers; ASSERT_TRUE(request_handler.GetRequestHeaderBlock(url, &headers, &challenge)); EXPECT_EQ(url.spec(), headers["url"]); diff --git a/net/websockets/websocket_job.cc b/net/websockets/websocket_job.cc index 0be903d..0df6ac1 100644 --- a/net/websockets/websocket_job.cc +++ b/net/websockets/websocket_job.cc @@ -305,7 +305,7 @@ void WebSocketJob::OnSentSpdyHeaders(int result) { } int WebSocketJob::OnReceivedSpdyResponseHeader( - const spdy::SpdyHeaderBlock& headers, int status) { + const SpdyHeaderBlock& headers, int status) { DCHECK_NE(INITIALIZED, state_); if (state_ != CONNECTING) return status; @@ -387,7 +387,7 @@ void WebSocketJob::LoadCookieCallback(const std::string& cookie) { void WebSocketJob::DoSendData() { if (spdy_websocket_stream_.get()) { - linked_ptr<spdy::SpdyHeaderBlock> headers(new spdy::SpdyHeaderBlock); + linked_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock); handshake_request_->GetRequestHeaderBlock( socket_->url(), headers.get(), &challenge_); spdy_websocket_stream_->SendRequest(headers); diff --git a/net/websockets/websocket_job.h b/net/websockets/websocket_job.h index 0abac3c..b99c587 100644 --- a/net/websockets/websocket_job.h +++ b/net/websockets/websocket_job.h @@ -81,7 +81,7 @@ class NET_EXPORT WebSocketJob virtual void OnCreatedSpdyStream(int status) OVERRIDE; virtual void OnSentSpdyHeaders(int status) OVERRIDE; virtual int OnReceivedSpdyResponseHeader( - const spdy::SpdyHeaderBlock& headers, int status) OVERRIDE; + const SpdyHeaderBlock& headers, int status) OVERRIDE; virtual void OnSentSpdyData(int amount_sent) OVERRIDE; virtual void OnReceivedSpdyData(const char* data, int length) OVERRIDE; virtual void OnCloseSpdyStream() OVERRIDE; diff --git a/net/websockets/websocket_job_spdy2_unittest.cc b/net/websockets/websocket_job_spdy2_unittest.cc index da47d43..471748e 100644 --- a/net/websockets/websocket_job_spdy2_unittest.cc +++ b/net/websockets/websocket_job_spdy2_unittest.cc @@ -909,26 +909,26 @@ void WebSocketJobSpdy2Test::TestConnectBySpdy( MockRead(SYNCHRONOUS, 0, 5) // EOF }; - const spdy::SpdyStreamId kStreamId = 1; - scoped_ptr<spdy::SpdyFrame> request_frame( + const SpdyStreamId kStreamId = 1; + scoped_ptr<SpdyFrame> request_frame( ConstructSpdyWebSocketHandshakeRequestFrame( kHandshakeRequestForSpdy, arraysize(kHandshakeRequestForSpdy) / 2, kStreamId, MEDIUM)); - scoped_ptr<spdy::SpdyFrame> response_frame( + scoped_ptr<SpdyFrame> response_frame( ConstructSpdyWebSocketHandshakeResponseFrame( kHandshakeResponseForSpdy, arraysize(kHandshakeResponseForSpdy) / 2, kStreamId, MEDIUM)); - scoped_ptr<spdy::SpdyFrame> data_hello_frame( + scoped_ptr<SpdyFrame> data_hello_frame( ConstructSpdyWebSocketDataFrame( kDataHello, kDataHelloLength, kStreamId, false)); - scoped_ptr<spdy::SpdyFrame> data_world_frame( + scoped_ptr<SpdyFrame> data_world_frame( ConstructSpdyWebSocketDataFrame( kDataWorld, kDataWorldLength, diff --git a/net/websockets/websocket_job_spdy3_unittest.cc b/net/websockets/websocket_job_spdy3_unittest.cc index 7f7491c..2c846ec 100644 --- a/net/websockets/websocket_job_spdy3_unittest.cc +++ b/net/websockets/websocket_job_spdy3_unittest.cc @@ -909,26 +909,26 @@ void WebSocketJobSpdy3Test::TestConnectBySpdy( MockRead(SYNCHRONOUS, 0, 5) // EOF }; - const spdy::SpdyStreamId kStreamId = 1; - scoped_ptr<spdy::SpdyFrame> request_frame( + const SpdyStreamId kStreamId = 1; + scoped_ptr<SpdyFrame> request_frame( ConstructSpdyWebSocketHandshakeRequestFrame( kHandshakeRequestForSpdy, arraysize(kHandshakeRequestForSpdy) / 2, kStreamId, MEDIUM)); - scoped_ptr<spdy::SpdyFrame> response_frame( + scoped_ptr<SpdyFrame> response_frame( ConstructSpdyWebSocketHandshakeResponseFrame( kHandshakeResponseForSpdy, arraysize(kHandshakeResponseForSpdy) / 2, kStreamId, MEDIUM)); - scoped_ptr<spdy::SpdyFrame> data_hello_frame( + scoped_ptr<SpdyFrame> data_hello_frame( ConstructSpdyWebSocketDataFrame( kDataHello, kDataHelloLength, kStreamId, false)); - scoped_ptr<spdy::SpdyFrame> data_world_frame( + scoped_ptr<SpdyFrame> data_world_frame( ConstructSpdyWebSocketDataFrame( kDataWorld, kDataWorldLength, |