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

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

Issue 893783002: Revert of Gather the ServiceWorker client information in the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rfh_getvisibilitystate
Patch Set: Created 5 years, 10 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 | « no previous file | content/browser/service_worker/service_worker_provider_host.cc » ('j') | 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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_
7 7
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 27 matching lines...) Expand all
38 // object is tied to the lifetime of its document in the renderer process. 38 // object is tied to the lifetime of its document in the renderer process.
39 // This class holds service worker state that is scoped to an individual 39 // This class holds service worker state that is scoped to an individual
40 // document. 40 // document.
41 // 41 //
42 // Note this class can also host a running service worker, in which 42 // Note this class can also host a running service worker, in which
43 // case it will observe resource loads made directly by the service worker. 43 // case it will observe resource loads made directly by the service worker.
44 class CONTENT_EXPORT ServiceWorkerProviderHost 44 class CONTENT_EXPORT ServiceWorkerProviderHost
45 : public NON_EXPORTED_BASE(ServiceWorkerRegistration::Listener), 45 : public NON_EXPORTED_BASE(ServiceWorkerRegistration::Listener),
46 public base::SupportsWeakPtr<ServiceWorkerProviderHost> { 46 public base::SupportsWeakPtr<ServiceWorkerProviderHost> {
47 public: 47 public:
48 using FocusCallback = base::Callback<void(bool)>; 48 typedef base::Callback<void(bool)> FocusCallback;
49 using GetClientInfoCallback =
50 base::Callback<void(const ServiceWorkerClientInfo&)>;
51 49
52 // If |render_frame_id| is MSG_ROUTING_NONE, this provider host works for the 50 // If |render_frame_id| is MSG_ROUTING_NONE, this provider host works for the
53 // worker context. 51 // worker context.
54 ServiceWorkerProviderHost(int render_process_id, 52 ServiceWorkerProviderHost(int render_process_id,
55 int render_frame_id, 53 int render_frame_id,
56 int provider_id, 54 int provider_id,
57 base::WeakPtr<ServiceWorkerContextCore> context, 55 base::WeakPtr<ServiceWorkerContextCore> context,
58 ServiceWorkerDispatcherHost* dispatcher_host); 56 ServiceWorkerDispatcherHost* dispatcher_host);
59 virtual ~ServiceWorkerProviderHost(); 57 virtual ~ServiceWorkerProviderHost();
60 58
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 void PostMessage(const base::string16& message, 139 void PostMessage(const base::string16& message,
142 const std::vector<int>& sent_message_port_ids); 140 const std::vector<int>& sent_message_port_ids);
143 141
144 // Activates the WebContents associated with 142 // Activates the WebContents associated with
145 // { render_process_id_, render_frame_id_ }. 143 // { render_process_id_, render_frame_id_ }.
146 // Runs the |callback| with the result in parameter describing whether the 144 // Runs the |callback| with the result in parameter describing whether the
147 // focusing action was successful. 145 // focusing action was successful.
148 void Focus(const FocusCallback& callback); 146 void Focus(const FocusCallback& callback);
149 147
150 // Asks the renderer to send back the document information. 148 // Asks the renderer to send back the document information.
151 void GetClientInfo(const GetClientInfoCallback& callback); 149 void GetClientInfo(int embedded_worker_id, int request_id);
152 150
153 // Adds reference of this host's process to the |pattern|, the reference will 151 // Adds reference of this host's process to the |pattern|, the reference will
154 // be removed in destructor. 152 // be removed in destructor.
155 void AddScopedProcessReferenceToPattern(const GURL& pattern); 153 void AddScopedProcessReferenceToPattern(const GURL& pattern);
156 154
157 // Methods to support cross site navigations. 155 // Methods to support cross site navigations.
158 void PrepareForCrossSiteTransfer(); 156 void PrepareForCrossSiteTransfer();
159 void CompleteCrossSiteTransfer( 157 void CompleteCrossSiteTransfer(
160 int new_process_id, 158 int new_process_id,
161 int new_frame_id, 159 int new_frame_id,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 bool allow_association_; 222 bool allow_association_;
225 223
226 std::vector<base::Closure> queued_events_; 224 std::vector<base::Closure> queued_events_;
227 225
228 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); 226 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost);
229 }; 227 };
230 228
231 } // namespace content 229 } // namespace content
232 230
233 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ 231 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_provider_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698