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

Side by Side Diff: net/spdy/spdy_alt_svc_wire_format.cc

Issue 1458163002: Remove |using base::StringPiece| from net/spdy header files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/spdy/spdy_alt_svc_wire_format.h ('k') | net/spdy/spdy_alt_svc_wire_format_test.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 (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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_alt_svc_wire_format.h" 5 #include "net/spdy/spdy_alt_svc_wire_format.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
12 12
13 namespace net { 13 namespace net {
14 14
15 using base::StringPiece;
16
15 namespace { 17 namespace {
16 18
17 template <class T> 19 template <class T>
18 bool ParsePositiveIntegerImpl(StringPiece::const_iterator c, 20 bool ParsePositiveIntegerImpl(StringPiece::const_iterator c,
19 StringPiece::const_iterator end, 21 StringPiece::const_iterator end,
20 T* value) { 22 T* value) {
21 *value = 0; 23 *value = 0;
22 for (; c != end && isdigit(*c); ++c) { 24 for (; c != end && isdigit(*c); ++c) {
23 if (*value > std::numeric_limits<T>::max() / 10) { 25 if (*value > std::numeric_limits<T>::max() / 10) {
24 return false; 26 return false;
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 ++c; 386 ++c;
385 double place_value = 0.1; 387 double place_value = 0.1;
386 for (; c != end && isdigit(*c); ++c) { 388 for (; c != end && isdigit(*c); ++c) {
387 *probability += place_value * (*c - '0'); 389 *probability += place_value * (*c - '0');
388 place_value *= 0.1; 390 place_value *= 0.1;
389 } 391 }
390 return (c == end && *probability <= 1.0); 392 return (c == end && *probability <= 1.0);
391 } 393 }
392 394
393 } // namespace net 395 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_alt_svc_wire_format.h ('k') | net/spdy/spdy_alt_svc_wire_format_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698