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

Unified Diff: third_party/WebKit/Source/core/fileapi/URLFileAPI.cpp

Issue 2383503002: Measure usage of createObjectURL and srcObject (Closed)
Patch Set: oops Created 4 years, 3 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 | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fileapi/URLFileAPI.cpp
diff --git a/third_party/WebKit/Source/core/fileapi/URLFileAPI.cpp b/third_party/WebKit/Source/core/fileapi/URLFileAPI.cpp
index 985a576fc2f4c8507fe9e99d7b9c304267533fce..9c3883462a54ee50ca0fc03080574a5d6ffea8ed 100644
--- a/third_party/WebKit/Source/core/fileapi/URLFileAPI.cpp
+++ b/third_party/WebKit/Source/core/fileapi/URLFileAPI.cpp
@@ -8,6 +8,7 @@
#include "core/dom/DOMURL.h"
#include "core/dom/ExecutionContext.h"
#include "core/fileapi/Blob.h"
+#include "core/frame/UseCounter.h"
#include "core/html/PublicURLManager.h"
namespace blink {
@@ -19,9 +20,13 @@ String URLFileAPI::createObjectURL(ExecutionContext* executionContext, Blob* blo
DCHECK(executionContext);
if (blob->isClosed()) {
+ // TODO(jsbell): The spec doesn't throw, but rather returns a blob: URL
+ // without adding it to the store.
exceptionState.throwDOMException(InvalidStateError, String(blob->isFile() ? "File" : "Blob") + " has been closed.");
return String();
}
+
+ UseCounter::count(executionContext, UseCounter::CreateObjectURLBlob);
return DOMURL::createPublicURL(executionContext, blob, blob->uuid());
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698