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

Side by Side Diff: Source/platform/network/HTTPRequest.cpp

Issue 141273002: Code problems detected by cppcheck (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add a few more fixes Created 6 years, 11 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 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2011 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 // 2. Parse HTTP Headers. 54 // 2. Parse HTTP Headers.
55 size_t headersLength = request->parseHeaders(pos, remainingLength, failureRe ason); 55 size_t headersLength = request->parseHeaders(pos, remainingLength, failureRe ason);
56 if (!headersLength) 56 if (!headersLength)
57 return 0; 57 return 0;
58 pos += headersLength; 58 pos += headersLength;
59 remainingLength -= headersLength; 59 remainingLength -= headersLength;
60 60
61 // 3. Parse HTTP Data. 61 // 3. Parse HTTP Data.
62 size_t dataLength = request->parseRequestBody(pos, remainingLength); 62 size_t dataLength = request->parseRequestBody(pos, remainingLength);
63 pos += dataLength;
64 remainingLength -= dataLength; 63 remainingLength -= dataLength;
65 64
66 // We should have processed the entire input. 65 // We should have processed the entire input.
67 ASSERT(!remainingLength); 66 ASSERT(!remainingLength);
abarth-chromium 2014/01/17 06:59:08 Can you add pos to this ASSERT instead of deleting
68 return request.release(); 67 return request.release();
69 } 68 }
70 69
71 size_t HTTPRequest::parseRequestLine(const char* data, size_t length, String& fa ilureReason) 70 size_t HTTPRequest::parseRequestLine(const char* data, size_t length, String& fa ilureReason)
72 { 71 {
73 String url; 72 String url;
74 size_t result = parseHTTPRequestLine(data, length, failureReason, m_requestM ethod, url, m_httpVersion); 73 size_t result = parseHTTPRequestLine(data, length, failureReason, m_requestM ethod, url, m_httpVersion);
75 m_url = KURL(KURL(), url); 74 m_url = KURL(KURL(), url);
76 return result; 75 return result;
77 } 76 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 , m_httpVersion(version) 108 , m_httpVersion(version)
110 , m_requestMethod(requestMethod) 109 , m_requestMethod(requestMethod)
111 { 110 {
112 } 111 }
113 112
114 HTTPRequest::~HTTPRequest() 113 HTTPRequest::~HTTPRequest()
115 { 114 {
116 } 115 }
117 116
118 } // namespace WebCore 117 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698