OLD | NEW |
---|---|
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 const GURL& script_url, | 94 const GURL& script_url, |
95 int64 version_id, | 95 int64 version_id, |
96 base::WeakPtr<ServiceWorkerContextCore> context) | 96 base::WeakPtr<ServiceWorkerContextCore> context) |
97 : version_id_(version_id), | 97 : version_id_(version_id), |
98 registration_id_(kInvalidServiceWorkerVersionId), | 98 registration_id_(kInvalidServiceWorkerVersionId), |
99 script_url_(script_url), | 99 script_url_(script_url), |
100 status_(NEW), | 100 status_(NEW), |
101 context_(context), | 101 context_(context), |
102 script_cache_map_(this, context), | 102 script_cache_map_(this, context), |
103 is_doomed_(false), | 103 is_doomed_(false), |
104 creation_time_(base::Time::Now()), | |
michaeln
2014/10/08 23:09:16
oh, i thought this would mean when version was cre
dmurph
2014/10/11 00:02:26
Mind if I do this in a next patch?
| |
104 weak_factory_(this) { | 105 weak_factory_(this) { |
105 DCHECK(context_); | 106 DCHECK(context_); |
106 DCHECK(registration); | 107 DCHECK(registration); |
107 if (registration) { | 108 if (registration) { |
108 registration_id_ = registration->id(); | 109 registration_id_ = registration->id(); |
109 scope_ = registration->pattern(); | 110 scope_ = registration->pattern(); |
110 } | 111 } |
111 context_->AddLiveVersion(this); | 112 context_->AddLiveVersion(this); |
112 embedded_worker_ = context_->embedded_worker_registry()->CreateWorker(); | 113 embedded_worker_ = context_->embedded_worker_registry()->CreateWorker(); |
113 embedded_worker_->AddListener(this); | 114 embedded_worker_->AddListener(this); |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
689 SetStatus(REDUNDANT); | 690 SetStatus(REDUNDANT); |
690 StopWorker(base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); | 691 StopWorker(base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); |
691 if (!context_) | 692 if (!context_) |
692 return; | 693 return; |
693 std::vector<ServiceWorkerDatabase::ResourceRecord> resources; | 694 std::vector<ServiceWorkerDatabase::ResourceRecord> resources; |
694 script_cache_map_.GetResources(&resources); | 695 script_cache_map_.GetResources(&resources); |
695 context_->storage()->PurgeResources(resources); | 696 context_->storage()->PurgeResources(resources); |
696 } | 697 } |
697 | 698 |
698 } // namespace content | 699 } // namespace content |
OLD | NEW |