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

Side by Side Diff: net/quic/quic_client_push_promise_index.cc

Issue 1692253004: QUIC - chromium server push support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review feedback round 2. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/quic/quic_client_push_promise_index.h" 5 #include "net/quic/quic_client_push_promise_index.h"
6 6
7 #include "net/quic/quic_client_promised_info.h" 7 #include "net/quic/quic_client_promised_info.h"
8 #include "net/quic/spdy_utils.h" 8 #include "net/quic/spdy_utils.h"
9 9
10 using net::SpdyHeaderBlock; 10 using net::SpdyHeaderBlock;
11 11
12 namespace net { 12 namespace net {
13 13
14 QuicClientPushPromiseIndex::QuicClientPushPromiseIndex() {} 14 QuicClientPushPromiseIndex::QuicClientPushPromiseIndex() {}
15 15
16 QuicClientPushPromiseIndex::~QuicClientPushPromiseIndex() {} 16 QuicClientPushPromiseIndex::~QuicClientPushPromiseIndex() {}
17 17
18 QuicClientPushPromiseIndex::TryHandle::~TryHandle() {} 18 QuicClientPushPromiseIndex::TryHandle::~TryHandle() {}
19 19
20 QuicClientPromisedInfo* QuicClientPushPromiseIndex::GetPromised(
21 const string& url) {
22 QuicPromisedByUrlMap::iterator it = promised_by_url_.find(url);
23 if (it == promised_by_url_.end()) {
24 return nullptr;
25 }
26 return it->second;
27 }
28
20 QuicAsyncStatus QuicClientPushPromiseIndex::Try( 29 QuicAsyncStatus QuicClientPushPromiseIndex::Try(
21 const SpdyHeaderBlock& request, 30 const SpdyHeaderBlock& request,
22 QuicClientPushPromiseIndex::Delegate* delegate, 31 QuicClientPushPromiseIndex::Delegate* delegate,
23 TryHandle** handle) { 32 TryHandle** handle) {
24 string url(SpdyUtils::GetUrlFromHeaderBlock(request)); 33 string url(SpdyUtils::GetUrlFromHeaderBlock(request));
25 QuicPromisedByUrlMap::iterator it = promised_by_url_.find(url); 34 QuicPromisedByUrlMap::iterator it = promised_by_url_.find(url);
26 if (it != promised_by_url_.end()) { 35 if (it != promised_by_url_.end()) {
27 QuicClientPromisedInfo* promised = it->second; 36 QuicClientPromisedInfo* promised = it->second;
28 QuicAsyncStatus rv = promised->HandleClientRequest(request, delegate); 37 QuicAsyncStatus rv = promised->HandleClientRequest(request, delegate);
29 if (rv == QUIC_PENDING) { 38 if (rv == QUIC_PENDING) {
30 *handle = promised; 39 *handle = promised;
31 } 40 }
32 return rv; 41 return rv;
33 } 42 }
34 return QUIC_FAILURE; 43 return QUIC_FAILURE;
35 } 44 }
36 45
37 } // namespace net 46 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_client_push_promise_index.h ('k') | net/quic/quic_client_push_promise_index_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698