| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/linked_ptr.h" | 9 #include "base/memory/linked_ptr.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 break; | 672 break; |
| 673 } | 673 } |
| 674 default: | 674 default: |
| 675 NOTREACHED(); | 675 NOTREACHED(); |
| 676 } | 676 } |
| 677 | 677 |
| 678 spdy::SpdyCredential credential; | 678 spdy::SpdyCredential credential; |
| 679 GURL origin_url(origin); | 679 GURL origin_url(origin); |
| 680 credential.slot = | 680 credential.slot = |
| 681 credential_state_.SetHasCredential(HostPortPair::FromURL(origin_url)); | 681 credential_state_.SetHasCredential(HostPortPair::FromURL(origin_url)); |
| 682 credential.origin = origin; | |
| 683 credential.certs.push_back(cert); | 682 credential.certs.push_back(cert); |
| 684 credential.proof.assign(proof.begin(), proof.end()); | 683 credential.proof.assign(proof.begin(), proof.end()); |
| 685 | 684 |
| 686 scoped_ptr<spdy::SpdyCredentialControlFrame> credential_frame( | 685 scoped_ptr<spdy::SpdyCredentialControlFrame> credential_frame( |
| 687 spdy::SpdyFramer::CreateCredentialFrame(credential)); | 686 spdy::SpdyFramer::CreateCredentialFrame(credential)); |
| 688 QueueFrame(credential_frame.get(), priority, NULL); | 687 QueueFrame(credential_frame.get(), priority, NULL); |
| 689 | 688 |
| 690 if (net_log().IsLoggingAllEvents()) { | 689 if (net_log().IsLoggingAllEvents()) { |
| 691 net_log().AddEvent( | 690 net_log().AddEvent( |
| 692 NetLog::TYPE_SPDY_SESSION_SEND_CREDENTIAL, | 691 NetLog::TYPE_SPDY_SESSION_SEND_CREDENTIAL, |
| 693 make_scoped_refptr( | 692 make_scoped_refptr( |
| 694 new NetLogSpdyCredentialParameter(credential.slot, | 693 new NetLogSpdyCredentialParameter(credential.slot, |
| 695 credential.origin))); | 694 origin))); |
| 696 } | 695 } |
| 697 return ERR_IO_PENDING; | 696 return ERR_IO_PENDING; |
| 698 } | 697 } |
| 699 | 698 |
| 700 int SpdySession::WriteStreamData(spdy::SpdyStreamId stream_id, | 699 int SpdySession::WriteStreamData(spdy::SpdyStreamId stream_id, |
| 701 net::IOBuffer* data, int len, | 700 net::IOBuffer* data, int len, |
| 702 spdy::SpdyDataFlags flags) { | 701 spdy::SpdyDataFlags flags) { |
| 703 // Find our stream | 702 // Find our stream |
| 704 DCHECK(IsStreamActive(stream_id)); | 703 DCHECK(IsStreamActive(stream_id)); |
| 705 scoped_refptr<SpdyStream> stream = active_streams_[stream_id]; | 704 scoped_refptr<SpdyStream> stream = active_streams_[stream_id]; |
| (...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1890 if (it == pending_callback_map_.end()) | 1889 if (it == pending_callback_map_.end()) |
| 1891 return; | 1890 return; |
| 1892 | 1891 |
| 1893 CompletionCallback callback = it->second.callback; | 1892 CompletionCallback callback = it->second.callback; |
| 1894 int result = it->second.result; | 1893 int result = it->second.result; |
| 1895 pending_callback_map_.erase(it); | 1894 pending_callback_map_.erase(it); |
| 1896 callback.Run(result); | 1895 callback.Run(result); |
| 1897 } | 1896 } |
| 1898 | 1897 |
| 1899 } // namespace net | 1898 } // namespace net |
| OLD | NEW |