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

Unified Diff: content/renderer/service_worker/service_worker_script_context.cc

Issue 538913002: ServiceWorker: Insert TRACE_EVENT to watch a breakdown of the ServiceWorker's performance on chome:… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary include Created 6 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 | « content/renderer/service_worker/embedded_worker_dispatcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/service_worker/service_worker_script_context.cc
diff --git a/content/renderer/service_worker/service_worker_script_context.cc b/content/renderer/service_worker/service_worker_script_context.cc
index 30b8153018673df7284d1828740d94ec61ccfccc..479545ccdd00796dc5814ced37fb6e30ca4a70e7 100644
--- a/content/renderer/service_worker/service_worker_script_context.cc
+++ b/content/renderer/service_worker/service_worker_script_context.cc
@@ -6,6 +6,7 @@
#include <map>
+#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "content/child/thread_safe_sender.h"
#include "content/child/webmessageportchannel_impl.h"
@@ -128,11 +129,15 @@ int ServiceWorkerScriptContext::GetRoutingID() const {
}
void ServiceWorkerScriptContext::OnActivateEvent(int request_id) {
+ TRACE_EVENT0("ServiceWorker",
+ "ServiceWorkerScriptContext::OnActivateEvent");
proxy_->dispatchActivateEvent(request_id);
}
void ServiceWorkerScriptContext::OnInstallEvent(int request_id,
int active_version_id) {
+ TRACE_EVENT0("ServiceWorker",
+ "ServiceWorkerScriptContext::OnInstallEvent");
proxy_->dispatchInstallEvent(request_id);
}
@@ -140,6 +145,8 @@ void ServiceWorkerScriptContext::OnFetchEvent(
int request_id,
const ServiceWorkerFetchRequest& request) {
blink::WebServiceWorkerRequest webRequest;
+ TRACE_EVENT0("ServiceWorker",
+ "ServiceWorkerScriptContext::OnFetchEvent");
webRequest.setURL(blink::WebURL(request.url));
webRequest.setMethod(blink::WebString::fromUTF8(request.method));
for (std::map<std::string, std::string>::const_iterator it =
@@ -160,11 +167,15 @@ void ServiceWorkerScriptContext::OnFetchEvent(
}
void ServiceWorkerScriptContext::OnSyncEvent(int request_id) {
+ TRACE_EVENT0("ServiceWorker",
+ "ServiceWorkerScriptContext::OnSyncEvent");
proxy_->dispatchSyncEvent(request_id);
}
void ServiceWorkerScriptContext::OnPushEvent(int request_id,
const std::string& data) {
+ TRACE_EVENT0("ServiceWorker",
+ "ServiceWorkerScriptContext::OnPushEvent");
proxy_->dispatchPushEvent(request_id, blink::WebString::fromUTF8(data));
Send(new ServiceWorkerHostMsg_PushEventFinished(
GetRoutingID(), request_id));
@@ -174,6 +185,8 @@ void ServiceWorkerScriptContext::OnPostMessage(
const base::string16& message,
const std::vector<int>& sent_message_port_ids,
const std::vector<int>& new_routing_ids) {
+ TRACE_EVENT0("ServiceWorker",
+ "ServiceWorkerScriptContext::OnPostEvent");
std::vector<WebMessagePortChannelImpl*> ports;
if (!sent_message_port_ids.empty()) {
base::MessageLoopProxy* loop_proxy = embedded_context_->main_thread_proxy();
@@ -189,6 +202,8 @@ void ServiceWorkerScriptContext::OnPostMessage(
void ServiceWorkerScriptContext::OnDidGetClientDocuments(
int request_id, const std::vector<int>& client_ids) {
+ TRACE_EVENT0("ServiceWorker",
+ "ServiceWorkerScriptContext::OnDidGetClientDocuments");
blink::WebServiceWorkerClientsCallbacks* callbacks =
pending_clients_callbacks_.Lookup(request_id);
if (!callbacks) {
« no previous file with comments | « content/renderer/service_worker/embedded_worker_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698