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

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

Issue 1135373002: Updated NetLog::ParametersCallback & all related calbacks returning value as scoped_ptr<base::Value… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « net/quic/quic_http_utils.h ('k') | net/sdch/sdch_owner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_http_utils.h" 5 #include "net/quic/quic_http_utils.h"
6 6
7 namespace net { 7 namespace net {
8 8
9 QuicPriority ConvertRequestPriorityToQuicPriority( 9 QuicPriority ConvertRequestPriorityToQuicPriority(
10 const RequestPriority priority) { 10 const RequestPriority priority) {
11 DCHECK_GE(priority, MINIMUM_PRIORITY); 11 DCHECK_GE(priority, MINIMUM_PRIORITY);
12 DCHECK_LE(priority, MAXIMUM_PRIORITY); 12 DCHECK_LE(priority, MAXIMUM_PRIORITY);
13 return static_cast<QuicPriority>(HIGHEST - priority); 13 return static_cast<QuicPriority>(HIGHEST - priority);
14 } 14 }
15 15
16 NET_EXPORT_PRIVATE RequestPriority ConvertQuicPriorityToRequestPriority( 16 NET_EXPORT_PRIVATE RequestPriority ConvertQuicPriorityToRequestPriority(
17 QuicPriority priority) { 17 QuicPriority priority) {
18 // Handle invalid values gracefully. 18 // Handle invalid values gracefully.
19 return (priority >= 5) ? 19 return (priority >= 5) ?
20 IDLE : static_cast<RequestPriority>(HIGHEST - priority); 20 IDLE : static_cast<RequestPriority>(HIGHEST - priority);
21 } 21 }
22 22
23 base::Value* QuicRequestNetLogCallback(QuicStreamId stream_id, 23 scoped_ptr<base::Value> QuicRequestNetLogCallback(
24 const SpdyHeaderBlock* headers, 24 QuicStreamId stream_id,
25 QuicPriority priority, 25 const SpdyHeaderBlock* headers,
26 NetLogCaptureMode capture_mode) { 26 QuicPriority priority,
27 base::DictionaryValue* dict = static_cast<base::DictionaryValue*>( 27 NetLogCaptureMode capture_mode) {
28 SpdyHeaderBlockNetLogCallback(headers, capture_mode)); 28 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
29 dict.reset(static_cast<base::DictionaryValue*>(
30 SpdyHeaderBlockNetLogCallback(headers, capture_mode).release()));
29 dict->SetInteger("quic_priority", static_cast<int>(priority)); 31 dict->SetInteger("quic_priority", static_cast<int>(priority));
30 dict->SetInteger("quic_stream_id", static_cast<int>(stream_id)); 32 dict->SetInteger("quic_stream_id", static_cast<int>(stream_id));
31 return dict; 33 return dict.Pass();
32 } 34 }
33 35
34 } // namespace net 36 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_http_utils.h ('k') | net/sdch/sdch_owner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698