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 #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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 return running_hosted_version_.get(); | 99 return running_hosted_version_.get(); |
100 } | 100 } |
101 | 101 |
102 void SetDocumentUrl(const GURL& url); | 102 void SetDocumentUrl(const GURL& url); |
103 const GURL& document_url() const { return document_url_; } | 103 const GURL& document_url() const { return document_url_; } |
104 | 104 |
105 void SetTopmostFrameUrl(const GURL& url); | 105 void SetTopmostFrameUrl(const GURL& url); |
106 const GURL& topmost_frame_url() const { return topmost_frame_url_; } | 106 const GURL& topmost_frame_url() const { return topmost_frame_url_; } |
107 | 107 |
108 ServiceWorkerProviderType provider_type() const { return provider_type_; } | 108 ServiceWorkerProviderType provider_type() const { return provider_type_; } |
| 109 blink::WebServiceWorkerClientType client_type() const; |
109 | 110 |
110 // Associates to |registration| to listen for its version change events. | 111 // Associates to |registration| to listen for its version change events. |
111 void AssociateRegistration(ServiceWorkerRegistration* registration); | 112 void AssociateRegistration(ServiceWorkerRegistration* registration); |
112 | 113 |
113 // Clears the associated registration and stop listening to it. | 114 // Clears the associated registration and stop listening to it. |
114 void DisassociateRegistration(); | 115 void DisassociateRegistration(); |
115 | 116 |
116 // Returns false if the version is not in the expected STARTING in our | 117 // Returns false if the version is not in the expected STARTING in our |
117 // process state. That would be indicative of a bad IPC message. | 118 // process state. That would be indicative of a bad IPC message. |
118 bool SetHostedVersionId(int64 versions_id); | 119 bool SetHostedVersionId(int64 versions_id); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 void PostMessage( | 151 void PostMessage( |
151 const base::string16& message, | 152 const base::string16& message, |
152 const std::vector<TransferredMessagePort>& sent_message_ports); | 153 const std::vector<TransferredMessagePort>& sent_message_ports); |
153 | 154 |
154 // Activates the WebContents associated with | 155 // Activates the WebContents associated with |
155 // { render_process_id_, render_frame_id_ }. | 156 // { render_process_id_, render_frame_id_ }. |
156 // Runs the |callback| with the updated ServiceWorkerClientInfo in parameter. | 157 // Runs the |callback| with the updated ServiceWorkerClientInfo in parameter. |
157 void Focus(const GetClientInfoCallback& callback); | 158 void Focus(const GetClientInfoCallback& callback); |
158 | 159 |
159 // Asks the renderer to send back the document information. | 160 // Asks the renderer to send back the document information. |
160 void GetClientInfo(const GetClientInfoCallback& callback) const; | 161 void GetWindowClientInfo(const GetClientInfoCallback& callback) const; |
161 | 162 |
162 // Same as above but has to be called from the UI thread. | 163 // Same as above but has to be called from the UI thread. |
163 // It is taking the process and frame ids in parameter because |this| is meant | 164 // It is taking the process and frame ids in parameter because |this| is meant |
164 // to live on the IO thread. | 165 // to live on the IO thread. |
165 static ServiceWorkerClientInfo GetClientInfoOnUI(int render_process_id, | 166 static ServiceWorkerClientInfo GetWindowClientInfoOnUI(int render_process_id, |
166 int render_frame_id); | 167 int render_frame_id); |
167 | 168 |
168 // Adds reference of this host's process to the |pattern|, the reference will | 169 // Adds reference of this host's process to the |pattern|, the reference will |
169 // be removed in destructor. | 170 // be removed in destructor. |
170 void AddScopedProcessReferenceToPattern(const GURL& pattern); | 171 void AddScopedProcessReferenceToPattern(const GURL& pattern); |
171 | 172 |
172 // |registration| claims the document to be controlled. | 173 // |registration| claims the document to be controlled. |
173 void ClaimedByRegistration(ServiceWorkerRegistration* registration); | 174 void ClaimedByRegistration(ServiceWorkerRegistration* registration); |
174 | 175 |
175 // Called by dispatcher host to get the registration for the "ready" property. | 176 // Called by dispatcher host to get the registration for the "ready" property. |
176 // Returns false if there's a completed or ongoing request for the document. | 177 // Returns false if there's a completed or ongoing request for the document. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 bool is_claiming_; | 284 bool is_claiming_; |
284 | 285 |
285 std::vector<base::Closure> queued_events_; | 286 std::vector<base::Closure> queued_events_; |
286 | 287 |
287 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); | 288 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); |
288 }; | 289 }; |
289 | 290 |
290 } // namespace content | 291 } // namespace content |
291 | 292 |
292 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 293 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
OLD | NEW |