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

Unified Diff: third_party/WebKit/Source/modules/fetch/Response.cpp

Issue 2704443007: Count Response construction with ReadableStream (Closed)
Patch Set: fix Created 3 years, 10 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
Index: third_party/WebKit/Source/modules/fetch/Response.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/Response.cpp b/third_party/WebKit/Source/modules/fetch/Response.cpp
index 21c44bf70c68b05b2cda4090ff67ad1bde38e306..d5319f453f05869de885768408521d50bf6970f7 100644
--- a/third_party/WebKit/Source/modules/fetch/Response.cpp
+++ b/third_party/WebKit/Source/modules/fetch/Response.cpp
@@ -4,6 +4,7 @@
#include "modules/fetch/Response.h"
+#include <memory>
#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/ScriptState.h"
@@ -19,6 +20,7 @@
#include "core/dom/DOMArrayBufferView.h"
#include "core/dom/URLSearchParams.h"
#include "core/fileapi/Blob.h"
+#include "core/frame/UseCounter.h"
#include "core/html/FormData.h"
#include "core/streams/ReadableStreamOperations.h"
#include "modules/fetch/BlobBytesConsumer.h"
@@ -31,7 +33,6 @@
#include "platform/network/NetworkUtils.h"
#include "public/platform/modules/serviceworker/WebServiceWorkerResponse.h"
#include "wtf/RefPtr.h"
-#include <memory>
namespace blink {
@@ -172,6 +173,8 @@ Response* Response::create(ScriptState* scriptState,
contentType = "application/x-www-form-urlencoded;charset=UTF-8";
} else if (ReadableStreamOperations::isReadableStream(scriptState,
bodyValue)) {
+ UseCounter::count(executionContext,
+ UseCounter::FetchResponseConstructionWithStream);
bodyBuffer = new BodyStreamBuffer(scriptState, bodyValue);
} else {
String string = toUSVString(isolate, body, exceptionState);
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/Body.cpp ('k') | third_party/WebKit/Source/modules/fetch/Response.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698