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

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

Issue 280423005: Adds class ServiceWorkerScriptCacheMap and new ServiceWorkerVersion::Listener methods related to sc… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « content/browser/service_worker/service_worker_version.h ('k') | content/content_browser.gypi » ('j') | 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 66ca8830756abe28ea8e8b848c9ece3a822a8e9d..0bcec8983900ca78b5beb9bd25191707c4c7138b 100644
--- a/content/browser/service_worker/service_worker_version.cc
+++ b/content/browser/service_worker/service_worker_version.cc
@@ -88,8 +88,10 @@ ServiceWorkerVersion::ServiceWorkerVersion(
registration_id_(kInvalidServiceWorkerVersionId),
status_(NEW),
context_(context),
+ script_cache_map_(this),
weak_factory_(this) {
DCHECK(context_);
+ DCHECK(registration);
if (registration) {
registration_id_ = registration->id();
script_url_ = registration->script_url();
@@ -550,20 +552,6 @@ void ServiceWorkerVersion::OnSyncEventFinished(
sync_callbacks_.Remove(request_id);
}
-void ServiceWorkerVersion::AddToScriptCache(
- const GURL& url, int64 resource_id) {
- DCHECK_EQ(kInvalidServiceWorkerResponseId, LookupInScriptCache(url));
- DCHECK_EQ(NEW, status_);
- script_cache_map_[url] = resource_id;
-}
-
-int64 ServiceWorkerVersion::LookupInScriptCache(const GURL& url) {
- ResourceIDMap::const_iterator found = script_cache_map_.find(url);
- if (found == script_cache_map_.end())
- return kInvalidServiceWorkerResponseId;
- return found->second;
-}
-
void ServiceWorkerVersion::OnPostMessageToDocument(
int client_id,
const base::string16& message,
« no previous file with comments | « content/browser/service_worker/service_worker_version.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698