Title: [125386] trunk/Source/WebCore
Revision
125386
Author
[email protected]
Date
2012-08-12 21:16:54 -0700 (Sun, 12 Aug 2012)

Log Message

Record metrics to measure the usage of WebKitBlobBuilder to eventually deprecate it
https://bugs.webkit.org/show_bug.cgi?id=90535

Reviewed by Eric Seidel.

No new tests as this has no functional changes.

* bindings/js/JSBlobCustom.cpp:
(WebCore::JSBlobConstructor::constructJSBlob):
* bindings/v8/custom/V8BlobCustom.cpp:
(WebCore::V8Blob::constructorCallback):
* fileapi/WebKitBlobBuilder.cpp:
(WebCore::WebKitBlobBuilder::getBlob):
* fileapi/WebKitBlobBuilder.h:
(WebKitBlobBuilder):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (125385 => 125386)


--- trunk/Source/WebCore/ChangeLog	2012-08-13 03:55:06 UTC (rev 125385)
+++ trunk/Source/WebCore/ChangeLog	2012-08-13 04:16:54 UTC (rev 125386)
@@ -1,3 +1,21 @@
+2012-07-04  Kinuko Yasuda  <[email protected]>
+
+        Record metrics to measure the usage of WebKitBlobBuilder to eventually deprecate it
+        https://bugs.webkit.org/show_bug.cgi?id=90535
+
+        Reviewed by Eric Seidel.
+
+        No new tests as this has no functional changes.
+
+        * bindings/js/JSBlobCustom.cpp:
+        (WebCore::JSBlobConstructor::constructJSBlob):
+        * bindings/v8/custom/V8BlobCustom.cpp:
+        (WebCore::V8Blob::constructorCallback):
+        * fileapi/WebKitBlobBuilder.cpp:
+        (WebCore::WebKitBlobBuilder::getBlob):
+        * fileapi/WebKitBlobBuilder.h:
+        (WebKitBlobBuilder):
+
 2012-08-12  Ojan Vafai  <[email protected]>
 
         Remove unnecessary null checks from pseudoStyleForElement and adjustRenderStyle

Modified: trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp (125385 => 125386)


--- trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp	2012-08-13 03:55:06 UTC (rev 125385)
+++ trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp	2012-08-13 04:16:54 UTC (rev 125386)
@@ -136,7 +136,7 @@
         }
     }
 
-    RefPtr<Blob> blob = blobBuilder->getBlob(type);
+    RefPtr<Blob> blob = blobBuilder->getBlob(type, BlobConstructedByConstructor);
     return JSValue::encode(CREATE_DOM_WRAPPER(exec, jsConstructor->globalObject(), Blob, blob.get()));
 }
 

Modified: trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp (125385 => 125386)


--- trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp	2012-08-13 03:55:06 UTC (rev 125385)
+++ trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp	2012-08-13 04:16:54 UTC (rev 125386)
@@ -138,7 +138,7 @@
         }
     }
 
-    RefPtr<Blob> blob = blobBuilder->getBlob(type);
+    RefPtr<Blob> blob = blobBuilder->getBlob(type, BlobConstructedByConstructor);
     return toV8(blob.get(), args.GetIsolate());
 }
 

Modified: trunk/Source/WebCore/fileapi/WebKitBlobBuilder.cpp (125385 => 125386)


--- trunk/Source/WebCore/fileapi/WebKitBlobBuilder.cpp	2012-08-13 03:55:06 UTC (rev 125385)
+++ trunk/Source/WebCore/fileapi/WebKitBlobBuilder.cpp	2012-08-13 04:16:54 UTC (rev 125386)
@@ -149,7 +149,6 @@
     }
 }
 
-
 void WebKitBlobBuilder::appendBytesData(const void* data, size_t length)
 {
     Vector<char>& buffer = getBuffer();
@@ -158,8 +157,10 @@
     m_size += buffer.size() - oldSize;
 }
 
-PassRefPtr<Blob> WebKitBlobBuilder::getBlob(const String& contentType)
+PassRefPtr<Blob> WebKitBlobBuilder::getBlob(const String& contentType, BlobConstructionReason constructionReason)
 {
+    HistogramSupport::histogramEnumeration("WebCore.BlobBuilder.getBlob", constructionReason, BlobConstructionReasonMax);
+
     OwnPtr<BlobData> blobData = BlobData::create();
     blobData->setContentType(contentType);
     blobData->swapItems(m_items);

Modified: trunk/Source/WebCore/fileapi/WebKitBlobBuilder.h (125385 => 125386)


--- trunk/Source/WebCore/fileapi/WebKitBlobBuilder.h	2012-08-13 03:55:06 UTC (rev 125385)
+++ trunk/Source/WebCore/fileapi/WebKitBlobBuilder.h	2012-08-13 04:16:54 UTC (rev 125386)
@@ -43,6 +43,12 @@
 
 typedef int ExceptionCode;
 
+enum BlobConstructionReason {
+    BlobConstructedByBlobBuilder,
+    BlobConstructedByConstructor,
+    BlobConstructionReasonMax,
+};
+
 class WebKitBlobBuilder : public RefCounted<WebKitBlobBuilder> {
 public:
     // Called when BlobBuilder is instantiated in JS API. We show deprecate warning message.
@@ -59,7 +65,7 @@
     void append(ArrayBufferView*);
 #endif
 
-    PassRefPtr<Blob> getBlob(const String& contentType = String());
+    PassRefPtr<Blob> getBlob(const String& contentType = String(), BlobConstructionReason = BlobConstructedByBlobBuilder);
 
 private:
     WebKitBlobBuilder();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to