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

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

Issue 2193073003: Move shared files in net/quic/ into net/quic/core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: io_thread_unittest.cc Created 4 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "net/quic/quic_client_push_promise_index.h"
6
7 #include <string>
8
9 #include "net/quic/quic_client_promised_info.h"
10 #include "net/quic/spdy_utils.h"
11
12 using net::SpdyHeaderBlock;
13 using std::string;
14
15 namespace net {
16
17 QuicClientPushPromiseIndex::QuicClientPushPromiseIndex() {}
18
19 QuicClientPushPromiseIndex::~QuicClientPushPromiseIndex() {}
20
21 QuicClientPushPromiseIndex::TryHandle::~TryHandle() {}
22
23 QuicClientPromisedInfo* QuicClientPushPromiseIndex::GetPromised(
24 const string& url) {
25 QuicPromisedByUrlMap::iterator it = promised_by_url_.find(url);
26 if (it == promised_by_url_.end()) {
27 return nullptr;
28 }
29 return it->second;
30 }
31
32 QuicAsyncStatus QuicClientPushPromiseIndex::Try(
33 const SpdyHeaderBlock& request,
34 QuicClientPushPromiseIndex::Delegate* delegate,
35 TryHandle** handle) {
36 string url(SpdyUtils::GetUrlFromHeaderBlock(request));
37 QuicPromisedByUrlMap::iterator it = promised_by_url_.find(url);
38 if (it != promised_by_url_.end()) {
39 QuicClientPromisedInfo* promised = it->second;
40 QuicAsyncStatus rv = promised->HandleClientRequest(request, delegate);
41 if (rv == QUIC_PENDING) {
42 *handle = promised;
43 }
44 return rv;
45 }
46 return QUIC_FAILURE;
47 }
48
49 } // 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