| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CLIENT_UTILS_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CLIENT_UTILS_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CLIENT_UTILS_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CLIENT_UTILS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "content/browser/service_worker/service_worker_provider_host.h" |
| 13 #include "content/common/service_worker/service_worker_status_code.h" | 14 #include "content/common/service_worker/service_worker_status_code.h" |
| 14 | 15 |
| 15 class GURL; | 16 class GURL; |
| 16 | 17 |
| 17 namespace content { | 18 namespace content { |
| 18 | 19 |
| 19 class ServiceWorkerContextCore; | 20 class ServiceWorkerContextCore; |
| 20 class ServiceWorkerVersion; | 21 class ServiceWorkerVersion; |
| 21 struct ServiceWorkerClientInfo; | 22 struct ServiceWorkerClientInfo; |
| 22 struct ServiceWorkerClientQueryOptions; | 23 struct ServiceWorkerClientQueryOptions; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 40 | 41 |
| 41 // Navigates the client specified by |process_id| and |frame_id| to |url|. | 42 // Navigates the client specified by |process_id| and |frame_id| to |url|. |
| 42 // |callback| is called with the client information on completion. | 43 // |callback| is called with the client information on completion. |
| 43 void NavigateClient(const GURL& url, | 44 void NavigateClient(const GURL& url, |
| 44 const GURL& script_url, | 45 const GURL& script_url, |
| 45 int process_id, | 46 int process_id, |
| 46 int frame_id, | 47 int frame_id, |
| 47 const base::WeakPtr<ServiceWorkerContextCore>& context, | 48 const base::WeakPtr<ServiceWorkerContextCore>& context, |
| 48 const NavigationCallback& callback); | 49 const NavigationCallback& callback); |
| 49 | 50 |
| 51 // Gets a client matched by |client_uuid|. |callback| is called with the client |
| 52 // information on completion. |
| 53 void GetClient( |
| 54 const base::WeakPtr<ServiceWorkerVersion>& controller, |
| 55 const std::string& client_uuid, |
| 56 const base::WeakPtr<ServiceWorkerContextCore>& context, |
| 57 const ServiceWorkerProviderHost::GetClientInfoCallback& callback); |
| 58 |
| 50 // Collects clients matched with |options|. |callback| is called with the client | 59 // Collects clients matched with |options|. |callback| is called with the client |
| 51 // information sorted in MRU order (most recently focused order) on completion. | 60 // information sorted in MRU order (most recently focused order) on completion. |
| 52 void GetClients(const base::WeakPtr<ServiceWorkerVersion>& controller, | 61 void GetClients(const base::WeakPtr<ServiceWorkerVersion>& controller, |
| 53 const ServiceWorkerClientQueryOptions& options, | 62 const ServiceWorkerClientQueryOptions& options, |
| 54 const ClientsCallback& callback); | 63 const ClientsCallback& callback); |
| 55 | 64 |
| 56 } // namespace service_worker_client_utils | 65 } // namespace service_worker_client_utils |
| 57 | 66 |
| 58 } // namespace content | 67 } // namespace content |
| 59 | 68 |
| 60 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CLIENT_UTILS_H_ | 69 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CLIENT_UTILS_H_ |
| OLD | NEW |