Title: [179285] branches/safari-600.1.4.15-branch/Source/WebCore

Diff

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog (179284 => 179285)


--- branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog	2015-01-28 21:37:40 UTC (rev 179284)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog	2015-01-28 21:39:26 UTC (rev 179285)
@@ -1,5 +1,24 @@
 2015-01-28  Lucas Forschler  <[email protected]>
 
+        Merge r177681
+
+    2014-12-22  Chris Dumez  <[email protected]>
+
+            [iOS] Log which type of resources are commonly loaded using FeatureCounter
+            https://bugs.webkit.org/show_bug.cgi?id=139890
+
+            Reviewed by Darin Adler.
+
+            Log which type of resources are commonly loaded using FeatureCounter
+            (e.g. stylesheets, scripts, fonts, images, ...).
+
+            * loader/SubresourceLoader.cpp:
+            (WebCore::logResourceLoadedUsingFeatureCounter):
+            (WebCore::SubresourceLoader::didFinishLoading):
+            * platform/FeatureCounterKeys.h:
+
+2015-01-28  Lucas Forschler  <[email protected]>
+
         Merge r177680
 
     2014-12-22  Chris Dumez  <[email protected]>

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/loader/SubresourceLoader.cpp (179284 => 179285)


--- branches/safari-600.1.4.15-branch/Source/WebCore/loader/SubresourceLoader.cpp	2015-01-28 21:37:40 UTC (rev 179284)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/loader/SubresourceLoader.cpp	2015-01-28 21:39:26 UTC (rev 179285)
@@ -292,6 +292,47 @@
     return true;
 }
 
+static void logResourceLoadedUsingFeatureCounter(Page* page, CachedResource::Type type)
+{
+    const char* key;
+    switch (type) {
+    case CachedResource::MainResource:
+        key = FeatureCounterResourceLoadedMainResourceKey;
+        break;
+    case CachedResource::ImageResource:
+        key = FeatureCounterResourceLoadedImageKey;
+        break;
+#if ENABLE(XSLT)
+    case CachedResource::XSLStyleSheet:
+#endif
+    case CachedResource::CSSStyleSheet:
+        key = FeatureCounterResourceLoadedStyleSheetKey;
+        break;
+    case CachedResource::Script:
+        key = FeatureCounterResourceLoadedScriptKey;
+        break;
+    case CachedResource::FontResource:
+        key = FeatureCounterResourceLoadedFontKey;
+        break;
+    case CachedResource::RawResource:
+        key = FeatureCounterResourceLoadedRawKey;
+        break;
+    case CachedResource::SVGDocumentResource:
+        key = FeatureCounterResourceLoadedSVGDocumentKey;
+        break;
+#if ENABLE(LINK_PREFETCH)
+    case CachedResource::LinkPrefetch:
+    case CachedResource::LinkSubresource:
+#endif
+#if ENABLE(VIDEO_TRACK)
+    case CachedResource::TextTrackResource:
+#endif
+        key = FeatureCounterResourceLoadedOtherKey;
+        break;
+    }
+    FEATURE_COUNTER_INCREMENT_KEY(page, key);
+}
+
 void SubresourceLoader::didFinishLoading(double finishTime)
 {
     if (m_state != Initialized)
@@ -301,6 +342,7 @@
     // FIXME (129394): We should cancel the load when a decode error occurs instead of continuing the load to completion.
     ASSERT(!m_resource->errorOccurred() || m_resource->status() == CachedResource::DecodeError);
     LOG(ResourceLoading, "Received '%s'.", m_resource->url().string().latin1().data());
+    logResourceLoadedUsingFeatureCounter(m_frame ? m_frame->page() : nullptr, m_resource->type());
 
     Ref<SubresourceLoader> protect(*this);
 

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/platform/FeatureCounterKeys.h (179284 => 179285)


--- branches/safari-600.1.4.15-branch/Source/WebCore/platform/FeatureCounterKeys.h	2015-01-28 21:37:40 UTC (rev 179284)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/platform/FeatureCounterKeys.h	2015-01-28 21:39:26 UTC (rev 179285)
@@ -87,6 +87,16 @@
 static const char FeatureCounterNavigationSame[] = "com.apple.WebKit.navigation.same";
 static const char FeatureCounterNavigationReloadFromOrigin[] = "com.apple.WebKit.navigation.reloadFromOrigin";
 
+// Resource types.
+static const char FeatureCounterResourceLoadedFontKey[] = "com.apple.WebKit.resource.loaded.font";
+static const char FeatureCounterResourceLoadedImageKey[] = "com.apple.WebKit.resource.loaded.image";
+static const char FeatureCounterResourceLoadedMainResourceKey[] = "com.apple.WebKit.resource.loaded.mainResource";
+static const char FeatureCounterResourceLoadedRawKey[] = "com.apple.WebKit.resource.loaded.raw";
+static const char FeatureCounterResourceLoadedSVGDocumentKey[] = "com.apple.WebKit.resource.loaded.svgDocument";
+static const char FeatureCounterResourceLoadedScriptKey[] = "com.apple.WebKit.resource.loaded.script";
+static const char FeatureCounterResourceLoadedStyleSheetKey[] = "com.apple.WebKit.resource.loaded.styleSheet";
+static const char FeatureCounterResourceLoadedOtherKey[] = "com.apple.WebKit.resource.loaded.other";
+
 // Memory cache.
 static const char FeatureCounterResourceRequestInMemoryCacheKey[] = "com.apple.WebKit.resourceRequest.inMemoryCache";
 static const char FeatureCounterResourceRequestNotInMemoryCacheKey[] = "com.apple.WebKit.resourceRequest.notInMemoryCache";
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to