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

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

Issue 2915863003: [Not for review] Add traces for crbug.com/726626
Patch Set: Created 3 years, 7 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/BodyStreamBuffer.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp b/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
index a35e4abb23ec351cf59634c0cd2f189174ea91a3..0700734cb78cdd2c731eba6066272e1d38a157f2 100644
--- a/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
+++ b/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
@@ -18,6 +18,7 @@
#include "platform/bindings/V8PrivateProperty.h"
#include "platform/bindings/V8ThrowException.h"
#include "platform/blob/BlobData.h"
+#include "platform/instrumentation/tracing/TraceEvent.h"
#include "platform/network/EncodedFormData.h"
namespace blink {
@@ -93,17 +94,27 @@ BodyStreamBuffer::BodyStreamBuffer(ScriptState* script_state,
script_state_(script_state),
consumer_(consumer),
made_from_readable_stream_(false) {
+ TRACE_EVENT0("ServiceWorker", "BodyStreamBuffer::BodyStreamBuffer");
v8::Local<v8::Value> body_value = ToV8(this, script_state);
DCHECK(!body_value.IsEmpty());
DCHECK(body_value->IsObject());
v8::Local<v8::Object> body = body_value.As<v8::Object>();
- ScriptValue readable_stream = ReadableStreamOperations::CreateReadableStream(
- script_state, this,
- ReadableStreamOperations::CreateCountQueuingStrategy(script_state, 0));
+ ScriptValue readable_stream;
+ {
+ TRACE_EVENT0("ServiceWorker",
+ "BodyStreamBuffer::BodyStreamBuffer CreateReadableStream");
+ readable_stream = ReadableStreamOperations::CreateReadableStream(
+ script_state, this,
+ ReadableStreamOperations::CreateCountQueuingStrategy(script_state, 0));
+ }
DCHECK(!readable_stream.IsEmpty());
- V8PrivateProperty::GetInternalBodyStream(script_state->GetIsolate())
- .Set(body, readable_stream.V8Value());
+ {
+ TRACE_EVENT0("ServiceWorker",
+ "BodyStreamBuffer::BodyStreamBuffer GetInternalBodyStream");
+ V8PrivateProperty::GetInternalBodyStream(script_state->GetIsolate())
+ .Set(body, readable_stream.V8Value());
+ }
consumer_->SetClient(this);
OnStateChange();
}

Powered by Google App Engine
This is Rietveld 408576698