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

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

Issue 852463002: Keep track of ServiceWorkerContext's BrowserContext and expose it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nullptr
Patch Set: Created 5 years, 11 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 <vector> 8 #include <vector>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 // DeleteForOrigin with completion callback. Does not exit early, and returns 82 // DeleteForOrigin with completion callback. Does not exit early, and returns
83 // false if one or more of the deletions fail. 83 // false if one or more of the deletions fail.
84 virtual void DeleteForOrigin(const GURL& origin_url, 84 virtual void DeleteForOrigin(const GURL& origin_url,
85 const ResultCallback& done); 85 const ResultCallback& done);
86 86
87 void AddObserver(ServiceWorkerContextObserver* observer); 87 void AddObserver(ServiceWorkerContextObserver* observer);
88 void RemoveObserver(ServiceWorkerContextObserver* observer); 88 void RemoveObserver(ServiceWorkerContextObserver* observer);
89 89
90 bool is_incognito() const { return is_incognito_; } 90 bool is_incognito() const { return is_incognito_; }
91 BrowserContext* browser_context() const { return browser_context_; }
michaeln 2015/01/12 20:19:13 Ah... I see why you're wanting to add this, to tra
91 92
92 // The URLRequestContext doesn't exist until after the StoragePartition is 93 // The URLRequestContext doesn't exist until after the StoragePartition is
93 // made (which is after this object is made). This function must be called 94 // made (which is after this object is made). This function must be called
94 // after this object is created but before any ServiceWorkerCache operations. 95 // after this object is created but before any ServiceWorkerCache operations.
95 // It must be called on the IO thread. If either parameter is NULL the 96 // It must be called on the IO thread. If either parameter is NULL the
96 // function immediately returns without forwarding to the 97 // function immediately returns without forwarding to the
97 // ServiceWorkerCacheStorageManager. 98 // ServiceWorkerCacheStorageManager.
98 void SetBlobParametersForCache( 99 void SetBlobParametersForCache(
99 net::URLRequestContextGetter* request_context, 100 net::URLRequestContextGetter* request_context,
100 ChromeBlobStorageContext* blob_storage_context); 101 ChromeBlobStorageContext* blob_storage_context);
(...skipping 22 matching lines...) Expand all
123 const std::vector<ServiceWorkerRegistrationInfo>& registrations); 124 const std::vector<ServiceWorkerRegistrationInfo>& registrations);
124 125
125 const scoped_refptr<ObserverListThreadSafe<ServiceWorkerContextObserver> > 126 const scoped_refptr<ObserverListThreadSafe<ServiceWorkerContextObserver> >
126 observer_list_; 127 observer_list_;
127 const scoped_ptr<ServiceWorkerProcessManager> process_manager_; 128 const scoped_ptr<ServiceWorkerProcessManager> process_manager_;
128 // Cleared in Shutdown(): 129 // Cleared in Shutdown():
129 scoped_ptr<ServiceWorkerContextCore> context_core_; 130 scoped_ptr<ServiceWorkerContextCore> context_core_;
130 131
131 // Initialized in Init(); true if the user data directory is empty. 132 // Initialized in Init(); true if the user data directory is empty.
132 bool is_incognito_; 133 bool is_incognito_;
134
135 // BrowserContext associated with the instance. Can be null during shutdown.
michaeln 2015/01/12 20:19:13 where does it get set to nullptr?
136 BrowserContext* browser_context_;
133 }; 137 };
134 138
135 } // namespace content 139 } // namespace content
136 140
137 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ 141 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698