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

Side by Side Diff: Source/core/inspector/InspectorResourceAgent.cpp

Issue 618583002: Correct data size argument type in resource loading path to unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 bool useDetector = false; 110 bool useDetector = false;
111 if (!textEncoding.isValid()) { 111 if (!textEncoding.isValid()) {
112 textEncoding = UTF8Encoding(); 112 textEncoding = UTF8Encoding();
113 useDetector = true; 113 useDetector = true;
114 } 114 }
115 m_decoder = TextResourceDecoder::create("text/plain", textEncoding, useD etector); 115 m_decoder = TextResourceDecoder::create("text/plain", textEncoding, useD etector);
116 m_statusCode = response.httpStatusCode(); 116 m_statusCode = response.httpStatusCode();
117 m_responseHeaders = response.httpHeaderFields(); 117 m_responseHeaders = response.httpHeaderFields();
118 } 118 }
119 119
120 virtual void didReceiveData(const char* data, int dataLength) OVERRIDE 120 virtual void didReceiveData(const char* data, unsigned dataLength) OVERRIDE
121 { 121 {
122 if (!dataLength) 122 if (!dataLength)
123 return; 123 return;
124 124
125 if (dataLength == -1)
126 dataLength = strlen(data);
127
128 m_responseText = m_responseText.concatenateWith(m_decoder->decode(data, dataLength)); 125 m_responseText = m_responseText.concatenateWith(m_decoder->decode(data, dataLength));
129 } 126 }
130 127
131 virtual void didFinishLoading(unsigned long /*identifier*/, double /*finishT ime*/) OVERRIDE 128 virtual void didFinishLoading(unsigned long /*identifier*/, double /*finishT ime*/) OVERRIDE
132 { 129 {
133 if (m_decoder) 130 if (m_decoder)
134 m_responseText = m_responseText.concatenateWith(m_decoder->flush()); 131 m_responseText = m_responseText.concatenateWith(m_decoder->flush());
135 m_callback->sendSuccess(m_statusCode, buildObjectForHeaders(m_responseHe aders), m_responseText.flattenToString()); 132 m_callback->sendSuccess(m_statusCode, buildObjectForHeaders(m_responseHe aders), m_responseText.flattenToString());
136 dispose(); 133 dispose();
137 } 134 }
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired) 880 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired)
884 { 881 {
885 } 882 }
886 883
887 bool InspectorResourceAgent::shouldForceCORSPreflight() 884 bool InspectorResourceAgent::shouldForceCORSPreflight()
888 { 885 {
889 return m_state->getBoolean(ResourceAgentState::cacheDisabled); 886 return m_state->getBoolean(ResourceAgentState::cacheDisabled);
890 } 887 }
891 888
892 } // namespace blink 889 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698