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

Side by Side Diff: Source/core/fetch/ResourceLoader.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) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved.
3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 // Reference the object in this method since the additional processing can d o 430 // Reference the object in this method since the additional processing can d o
431 // anything including removing the last reference to this object. 431 // anything including removing the last reference to this object.
432 RefPtrWillBeRawPtr<ResourceLoader> protect(this); 432 RefPtrWillBeRawPtr<ResourceLoader> protect(this);
433 433
434 // FIXME: If we get a resource with more than 2B bytes, this code won't do t he right thing. 434 // FIXME: If we get a resource with more than 2B bytes, this code won't do t he right thing.
435 // However, with today's computers and networking speeds, this won't happen in practice. 435 // However, with today's computers and networking speeds, this won't happen in practice.
436 // Could be an issue with a giant local file. 436 // Could be an issue with a giant local file.
437 m_host->didReceiveData(m_resource, data, length, encodedDataLength); 437 m_host->didReceiveData(m_resource, data, length, encodedDataLength);
438 if (m_state == Terminated) 438 if (m_state == Terminated)
439 return; 439 return;
440 ASSERT(length >= 0);
kouhei (in TOK) 2014/09/30 07:23:03 is ASSERT safe enough? should we do RELEASE_ASSERT
tyoshino (SeeGerritForStatus) 2014/09/30 08:14:28 Agreed. When negative value is passed to appendDat
440 m_resource->appendData(data, length); 441 m_resource->appendData(data, length);
441 } 442 }
442 443
443 void ResourceLoader::didFinishLoading(blink::WebURLLoader*, double finishTime, i nt64 encodedDataLength) 444 void ResourceLoader::didFinishLoading(blink::WebURLLoader*, double finishTime, i nt64 encodedDataLength)
444 { 445 {
445 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse || m_con nectionState == ConnectionStateReceivingData); 446 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse || m_con nectionState == ConnectionStateReceivingData);
446 m_connectionState = ConnectionStateFinishedLoading; 447 m_connectionState = ConnectionStateFinishedLoading;
447 if (m_state != Initialized) 448 if (m_state != Initialized)
448 return; 449 return;
449 ASSERT(m_state != Terminated); 450 ASSERT(m_state != Terminated);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); 532 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength);
532 } 533 }
533 534
534 ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const 535 ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const
535 { 536 {
536 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC redentials); 537 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC redentials);
537 return request; 538 return request;
538 } 539 }
539 540
540 } 541 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698