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

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

Issue 411973004: Stitch CacheStorage messages to implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cache_storage_stitch
Patch Set: Addresses all comments from PS5 Created 6 years, 4 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
« no previous file with comments | « content/browser/service_worker/service_worker_version.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_version.h" 5 #include "content/browser/service_worker/service_worker_version.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "content/browser/service_worker/embedded_worker_instance.h" 10 #include "content/browser/service_worker/embedded_worker_instance.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 DCHECK(context_); 103 DCHECK(context_);
104 DCHECK(registration); 104 DCHECK(registration);
105 if (registration) { 105 if (registration) {
106 registration_id_ = registration->id(); 106 registration_id_ = registration->id();
107 script_url_ = registration->script_url(); 107 script_url_ = registration->script_url();
108 scope_ = registration->pattern(); 108 scope_ = registration->pattern();
109 } 109 }
110 context_->AddLiveVersion(this); 110 context_->AddLiveVersion(this);
111 embedded_worker_ = context_->embedded_worker_registry()->CreateWorker(); 111 embedded_worker_ = context_->embedded_worker_registry()->CreateWorker();
112 embedded_worker_->AddListener(this); 112 embedded_worker_->AddListener(this);
113 stores_listener_.reset(new ServiceWorkerStoresListener(this)); 113 cache_listener_.reset(new ServiceWorkerCacheListener(this, context));
114 embedded_worker_->AddListener(stores_listener_.get()); 114 embedded_worker_->AddListener(cache_listener_.get());
115 } 115 }
116 116
117 ServiceWorkerVersion::~ServiceWorkerVersion() { 117 ServiceWorkerVersion::~ServiceWorkerVersion() {
118 embedded_worker_->RemoveListener(this); 118 embedded_worker_->RemoveListener(this);
119 if (context_) 119 if (context_)
120 context_->RemoveLiveVersion(version_id_); 120 context_->RemoveLiveVersion(version_id_);
121 // EmbeddedWorker's dtor sends StopWorker if it's still running. 121 // EmbeddedWorker's dtor sends StopWorker if it's still running.
122 } 122 }
123 123
124 void ServiceWorkerVersion::SetStatus(Status status) { 124 void ServiceWorkerVersion::SetStatus(Status status) {
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 SetStatus(REDUNDANT); 690 SetStatus(REDUNDANT);
691 StopWorker(base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); 691 StopWorker(base::Bind(&ServiceWorkerUtils::NoOpStatusCallback));
692 if (!context_) 692 if (!context_)
693 return; 693 return;
694 std::vector<ServiceWorkerDatabase::ResourceRecord> resources; 694 std::vector<ServiceWorkerDatabase::ResourceRecord> resources;
695 script_cache_map_.GetResources(&resources); 695 script_cache_map_.GetResources(&resources);
696 context_->storage()->PurgeResources(resources); 696 context_->storage()->PurgeResources(resources);
697 } 697 }
698 698
699 } // namespace content 699 } // namespace content
OLDNEW
« 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