Modified: trunk/Source/WebCore/loader/ProgressTracker.cpp (166301 => 166302)
--- trunk/Source/WebCore/loader/ProgressTracker.cpp 2014-03-26 18:20:15 UTC (rev 166301)
+++ trunk/Source/WebCore/loader/ProgressTracker.cpp 2014-03-26 18:31:58 UTC (rev 166302)
@@ -73,6 +73,8 @@
long long estimatedLength;
};
+unsigned long ProgressTracker::s_uniqueIdentifier = 0;
+
ProgressTracker::ProgressTracker(ProgressTrackerClient& client)
: m_client(client)
, m_totalPageAndResourceBytesToLoad(0)
@@ -82,7 +84,6 @@
, m_progressNotificationTimeInterval(std::chrono::milliseconds(100))
, m_finalProgressChangedSent(false)
, m_progressValue(0)
- , m_nextUniqueIdentifier(1)
, m_numProgressTrackedFrames(0)
, m_progressHeartbeatTimer(this, &ProgressTracker::progressHeartbeatTimerFired)
, m_heartbeatsWithNoProgress(0)
@@ -113,7 +114,6 @@
m_finalProgressChangedSent = false;
m_numProgressTrackedFrames = 0;
m_originatingProgressFrame = 0;
- // Don't reset m_nextUniqueIdentifier. More loads could start after reset() is called.
m_heartbeatsWithNoProgress = 0;
m_totalBytesReceivedBeforePreviousHeartbeat = 0;
@@ -294,7 +294,7 @@
unsigned long ProgressTracker::createUniqueIdentifier()
{
- return m_nextUniqueIdentifier++;
+ return ++s_uniqueIdentifier;
}
bool ProgressTracker::isMainLoadProgressing() const
Modified: trunk/Source/WebCore/loader/ProgressTracker.h (166301 => 166302)
--- trunk/Source/WebCore/loader/ProgressTracker.h 2014-03-26 18:20:15 UTC (rev 166301)
+++ trunk/Source/WebCore/loader/ProgressTracker.h 2014-03-26 18:31:58 UTC (rev 166302)
@@ -46,7 +46,7 @@
explicit ProgressTracker(ProgressTrackerClient&);
~ProgressTracker();
- unsigned long createUniqueIdentifier();
+ static unsigned long createUniqueIdentifier();
double estimatedProgress() const;
@@ -68,6 +68,8 @@
void progressHeartbeatTimerFired(Timer<ProgressTracker>&);
+ static unsigned long s_uniqueIdentifier;
+
ProgressTrackerClient& m_client;
long long m_totalPageAndResourceBytesToLoad;
long long m_totalBytesReceived;
@@ -78,7 +80,6 @@
bool m_finalProgressChangedSent;
double m_progressValue;
RefPtr<Frame> m_originatingProgressFrame;
- unsigned long m_nextUniqueIdentifier;
int m_numProgressTrackedFrames;
HashMap<unsigned long, std::unique_ptr<ProgressItem>> m_progressItems;
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (166301 => 166302)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp 2014-03-26 18:20:15 UTC (rev 166301)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp 2014-03-26 18:31:58 UTC (rev 166302)
@@ -254,13 +254,12 @@
return toWTFString(adoptWK(WKURLCopyLastPathComponent(fileUrl))); // We lose some information here, but it's better than exposing a full path, which is always machine specific.
}
-static HashMap<std::pair<WKBundleFrameRef, uint64_t>, String> assignedUrlsCache;
+static HashMap<uint64_t, String> assignedUrlsCache;
-static inline void dumpResourceURL(WKBundleFrameRef frame, uint64_t identifier, StringBuilder& stringBuilder)
+static inline void dumpResourceURL(uint64_t identifier, StringBuilder& stringBuilder)
{
- std::pair<WKBundleFrameRef, uint64_t> key = std::make_pair(frame, identifier);
- if (assignedUrlsCache.contains(key))
- stringBuilder.append(assignedUrlsCache.get(key));
+ if (assignedUrlsCache.contains(identifier))
+ stringBuilder.append(assignedUrlsCache.get(identifier));
else
stringBuilder.appendLiteral("<unknown>");
}
@@ -1028,15 +1027,13 @@
InjectedBundle::shared().outputText("didDetectXSS\n");
}
-void InjectedBundlePage::didInitiateLoadForResource(WKBundlePageRef page, WKBundleFrameRef frame, uint64_t identifier, WKURLRequestRef request, bool)
+void InjectedBundlePage::didInitiateLoadForResource(WKBundlePageRef page, WKBundleFrameRef, uint64_t identifier, WKURLRequestRef request, bool)
{
if (!InjectedBundle::shared().isTestRunning())
return;
WKRetainPtr<WKURLRef> url = ""
- auto result = assignedUrlsCache.add(std::make_pair(frame, identifier), pathSuitableForTestResult(url.get()));
- // It is a bug in WebCore if multiple resources had the same frame/identifier pair.
- ASSERT_UNUSED(result, result.isNewEntry);
+ assignedUrlsCache.add(identifier, pathSuitableForTestResult(url.get()));
}
// Resource Load Client Callbacks
@@ -1056,7 +1053,7 @@
if (InjectedBundle::shared().isTestRunning()
&& InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks()) {
StringBuilder stringBuilder;
- dumpResourceURL(frame, identifier, stringBuilder);
+ dumpResourceURL(identifier, stringBuilder);
stringBuilder.appendLiteral(" - willSendRequest ");
dumpRequestDescriptionSuitableForTestResult(request, stringBuilder);
stringBuilder.appendLiteral(" redirectResponse ");
@@ -1107,14 +1104,14 @@
return request;
}
-void InjectedBundlePage::didReceiveResponseForResource(WKBundlePageRef page, WKBundleFrameRef frame, uint64_t identifier, WKURLResponseRef response)
+void InjectedBundlePage::didReceiveResponseForResource(WKBundlePageRef page, WKBundleFrameRef, uint64_t identifier, WKURLResponseRef response)
{
if (!InjectedBundle::shared().isTestRunning())
return;
if (InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks()) {
StringBuilder stringBuilder;
- dumpResourceURL(frame, identifier, stringBuilder);
+ dumpResourceURL(identifier, stringBuilder);
stringBuilder.appendLiteral(" - didReceiveResponse ");
dumpResponseDescriptionSuitableForTestResult(response, stringBuilder);
stringBuilder.append('\n');
@@ -1141,7 +1138,7 @@
{
}
-void InjectedBundlePage::didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef frame, uint64_t identifier)
+void InjectedBundlePage::didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier)
{
if (!InjectedBundle::shared().isTestRunning())
return;
@@ -1150,12 +1147,12 @@
return;
StringBuilder stringBuilder;
- dumpResourceURL(frame, identifier, stringBuilder);
+ dumpResourceURL(identifier, stringBuilder);
stringBuilder.appendLiteral(" - didFinishLoading\n");
InjectedBundle::shared().outputText(stringBuilder.toString());
}
-void InjectedBundlePage::didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef frame, uint64_t identifier, WKErrorRef error)
+void InjectedBundlePage::didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKErrorRef error)
{
if (!InjectedBundle::shared().isTestRunning())
return;
@@ -1164,7 +1161,7 @@
return;
StringBuilder stringBuilder;
- dumpResourceURL(frame, identifier, stringBuilder);
+ dumpResourceURL(identifier, stringBuilder);
stringBuilder.appendLiteral(" - didFailLoadingWithError: ");
dumpErrorDescriptionSuitableForTestResult(error, stringBuilder);