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

Unified Diff: content/browser/service_worker/service_worker_version.cc

Issue 1037933002: [DevTools] Send ServiceWorkerVersion.ScriptLastModified and ScriptResponseTime to DevTools window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test failure Created 5 years, 9 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/browser/service_worker/service_worker_version.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_version.cc
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc
index 98590e007ff616bc609461001276996baf621f5c..867df6735215356a123ac427d9fc09a86563d8e0 100644
--- a/content/browser/service_worker/service_worker_version.cc
+++ b/content/browser/service_worker/service_worker_version.cc
@@ -34,6 +34,7 @@
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/result_codes.h"
+#include "net/http/http_response_headers.h"
#include "net/http/http_response_info.h"
namespace content {
@@ -386,10 +387,17 @@ void ServiceWorkerVersion::RegisterStatusChangeCallback(
ServiceWorkerVersionInfo ServiceWorkerVersion::GetInfo() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- return ServiceWorkerVersionInfo(
+ ServiceWorkerVersionInfo info(
running_status(), status(), script_url(), registration_id(), version_id(),
embedded_worker()->process_id(), embedded_worker()->thread_id(),
embedded_worker()->worker_devtools_agent_route_id());
+ if (!main_script_http_info_)
+ return info;
+ info.script_response_time = main_script_http_info_->response_time;
+ if (main_script_http_info_->headers)
+ main_script_http_info_->headers->GetLastModifiedValue(
+ &info.script_last_modified);
+ return info;
}
void ServiceWorkerVersion::StartWorker(const StatusCallback& callback) {
@@ -832,6 +840,8 @@ void ServiceWorkerVersion::SetDevToolsAttached(bool attached) {
void ServiceWorkerVersion::SetMainScriptHttpResponseInfo(
const net::HttpResponseInfo& http_info) {
main_script_http_info_.reset(new net::HttpResponseInfo(http_info));
+ FOR_EACH_OBSERVER(Listener, listeners_,
+ OnMainScriptHttpResponseInfoSet(this));
}
const net::HttpResponseInfo*
« no previous file with comments | « content/browser/service_worker/service_worker_version.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698