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

Unified Diff: Source/core/loader/ProgressTracker.cpp

Issue 1187563005: Code cleanup in core/loader/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/loader/PingLoader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/ProgressTracker.cpp
diff --git a/Source/core/loader/ProgressTracker.cpp b/Source/core/loader/ProgressTracker.cpp
index b7fdd6d367356d45afeac659d3aca812ac6aa318..b1c5b2c0f36194d8d70131def113f6190896e873 100644
--- a/Source/core/loader/ProgressTracker.cpp
+++ b/Source/core/loader/ProgressTracker.cpp
@@ -37,7 +37,7 @@
#include "wtf/CurrentTime.h"
#include "wtf/text/CString.h"
-using std::min;
+using namespace std;
namespace blink {
@@ -151,8 +151,9 @@ void ProgressTracker::incrementProgress(unsigned long identifier, const Resource
if (ProgressItem* item = m_progressItems.get(identifier)) {
item->bytesReceived = 0;
item->estimatedLength = estimatedLength;
- } else
+ } else {
m_progressItems.set(identifier, adoptPtr(new ProgressItem(estimatedLength)));
+ }
}
void ProgressTracker::incrementProgress(unsigned long identifier, int length)
@@ -176,7 +177,7 @@ void ProgressTracker::incrementProgress(unsigned long identifier, int length)
int numPendingOrLoadingRequests = m_frame->document()->fetcher()->requestCount();
estimatedBytesForPendingRequests = progressItemDefaultEstimatedLength * numPendingOrLoadingRequests;
remainingBytes = ((m_totalPageAndResourceBytesToLoad + estimatedBytesForPendingRequests) - m_totalBytesReceived);
- if (remainingBytes > 0) // Prevent divide by 0.
+ if (remainingBytes > 0) // Prevent divide by 0.
percentOfRemainingBytes = (double)bytesReceived / (double)remainingBytes;
else
percentOfRemainingBytes = 1.0;
« no previous file with comments | « Source/core/loader/PingLoader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698