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

Side by Side Diff: content/browser/service_worker/service_worker_storage.cc

Issue 304543002: Show the unregistered workers in chrome://serviceworker-internals and chrome://inspect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment Created 6 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/service_worker/service_worker_storage.h" 5 #include "content/browser/service_worker/service_worker_storage.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 DCHECK(pushed_registrations.insert(it->registration_id).second); 571 DCHECK(pushed_registrations.insert(it->registration_id).second);
572 ServiceWorkerRegistration* registration = 572 ServiceWorkerRegistration* registration =
573 context_->GetLiveRegistration(it->registration_id); 573 context_->GetLiveRegistration(it->registration_id);
574 if (registration) { 574 if (registration) {
575 infos.push_back(registration->GetInfo()); 575 infos.push_back(registration->GetInfo());
576 continue; 576 continue;
577 } 577 }
578 ServiceWorkerRegistrationInfo info; 578 ServiceWorkerRegistrationInfo info;
579 info.pattern = it->scope; 579 info.pattern = it->scope;
580 info.script_url = it->script; 580 info.script_url = it->script;
581 info.registration_id = it->registration_id;
581 info.active_version.is_null = false; 582 info.active_version.is_null = false;
582 if (it->is_active) 583 if (it->is_active)
583 info.active_version.status = ServiceWorkerVersion::ACTIVE; 584 info.active_version.status = ServiceWorkerVersion::ACTIVE;
584 else 585 else
585 info.active_version.status = ServiceWorkerVersion::INSTALLED; 586 info.active_version.status = ServiceWorkerVersion::INSTALLED;
586 info.active_version.version_id = it->version_id; 587 info.active_version.version_id = it->version_id;
587 infos.push_back(info); 588 infos.push_back(info);
588 } 589 }
589 590
590 // Add unstored registrations that are being installed. 591 // Add unstored registrations that are being installed.
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 const FindInDBCallback& callback) { 951 const FindInDBCallback& callback) {
951 ServiceWorkerDatabase::RegistrationData data; 952 ServiceWorkerDatabase::RegistrationData data;
952 ResourceList resources; 953 ResourceList resources;
953 ServiceWorkerDatabase::Status status = 954 ServiceWorkerDatabase::Status status =
954 database->ReadRegistration(registration_id, origin, &data, &resources); 955 database->ReadRegistration(registration_id, origin, &data, &resources);
955 original_task_runner->PostTask( 956 original_task_runner->PostTask(
956 FROM_HERE, base::Bind(callback, data, resources, status)); 957 FROM_HERE, base::Bind(callback, data, resources, status));
957 } 958 }
958 959
959 } // namespace content 960 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698