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

Side by Side Diff: content/browser/service_worker/service_worker_context_wrapper.h

Issue 2166523003: Add ref count to service workers for extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 void UpdateRegistration(const GURL& pattern); 179 void UpdateRegistration(const GURL& pattern);
180 void SetForceUpdateOnPageLoad(bool force_update_on_page_load); 180 void SetForceUpdateOnPageLoad(bool force_update_on_page_load);
181 void AddObserver(ServiceWorkerContextObserver* observer); 181 void AddObserver(ServiceWorkerContextObserver* observer);
182 void RemoveObserver(ServiceWorkerContextObserver* observer); 182 void RemoveObserver(ServiceWorkerContextObserver* observer);
183 183
184 bool is_incognito() const { return is_incognito_; } 184 bool is_incognito() const { return is_incognito_; }
185 185
186 // Must be called from the IO thread. 186 // Must be called from the IO thread.
187 bool OriginHasForeignFetchRegistrations(const GURL& origin); 187 bool OriginHasForeignFetchRegistrations(const GURL& origin);
188 188
189 static void IncrementEmbeddedWorkerRefCount(
190 StoragePartition* storage_partition,
191 int embedded_worker_id);
192 static void DecrementEmbeddedWorkerRefCount(
193 StoragePartition* storage_partition,
194 int embedded_worker_id);
195
189 private: 196 private:
190 friend class BackgroundSyncManagerTest; 197 friend class BackgroundSyncManagerTest;
191 friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>; 198 friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>;
192 friend class EmbeddedWorkerTestHelper; 199 friend class EmbeddedWorkerTestHelper;
193 friend class EmbeddedWorkerBrowserTest; 200 friend class EmbeddedWorkerBrowserTest;
194 friend class ServiceWorkerDispatcherHost; 201 friend class ServiceWorkerDispatcherHost;
195 friend class ServiceWorkerInternalsUI; 202 friend class ServiceWorkerInternalsUI;
196 friend class ServiceWorkerNavigationHandleCore; 203 friend class ServiceWorkerNavigationHandleCore;
197 friend class ServiceWorkerProcessManager; 204 friend class ServiceWorkerProcessManager;
198 friend class ServiceWorkerRequestHandler; 205 friend class ServiceWorkerRequestHandler;
199 friend class ServiceWorkerVersionBrowserTest; 206 friend class ServiceWorkerVersionBrowserTest;
200 friend class MockServiceWorkerContextWrapper; 207 friend class MockServiceWorkerContextWrapper;
201 208
202 ~ServiceWorkerContextWrapper() override; 209 ~ServiceWorkerContextWrapper() override;
210 void IncrementEmbeddedWorkerRefCountOnIO(int embedded_worker_id);
211 void DecrementEmbeddedWorkerRefCountOnIO(int embedded_worker_id);
203 212
204 void InitInternal( 213 void InitInternal(
205 const base::FilePath& user_data_directory, 214 const base::FilePath& user_data_directory,
206 std::unique_ptr<ServiceWorkerDatabaseTaskManager> database_task_manager, 215 std::unique_ptr<ServiceWorkerDatabaseTaskManager> database_task_manager,
207 const scoped_refptr<base::SingleThreadTaskRunner>& disk_cache_thread, 216 const scoped_refptr<base::SingleThreadTaskRunner>& disk_cache_thread,
208 storage::QuotaManagerProxy* quota_manager_proxy, 217 storage::QuotaManagerProxy* quota_manager_proxy,
209 storage::SpecialStoragePolicy* special_storage_policy); 218 storage::SpecialStoragePolicy* special_storage_policy);
210 void ShutdownOnIO(); 219 void ShutdownOnIO();
211 220
212 void DidFindRegistrationForFindReady( 221 void DidFindRegistrationForFindReady(
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 ResourceContext* resource_context_; 261 ResourceContext* resource_context_;
253 262
254 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; 263 scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
255 264
256 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextWrapper); 265 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextWrapper);
257 }; 266 };
258 267
259 } // namespace content 268 } // namespace content
260 269
261 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ 270 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698