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

Unified Diff: content/browser/service_worker/service_worker_provider_host.h

Issue 2653493009: Add two interfaces for ServiceWorkerProviderContext/ProviderHost (Closed)
Patch Set: Rebase Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_provider_host.h
diff --git a/content/browser/service_worker/service_worker_provider_host.h b/content/browser/service_worker/service_worker_provider_host.h
index 585bc591b6ffc705fd4da1733201cb3391e6e761..43090b02a561f6739877b331d45c336b123eb43d 100644
--- a/content/browser/service_worker/service_worker_provider_host.h
+++ b/content/browser/service_worker/service_worker_provider_host.h
@@ -21,10 +21,12 @@
#include "content/browser/service_worker/service_worker_registration.h"
#include "content/common/content_export.h"
#include "content/common/service_worker/service_worker_provider_host_info.h"
+#include "content/common/service_worker/service_worker_provider_interfaces.mojom.h"
#include "content/common/service_worker/service_worker_types.h"
#include "content/public/common/request_context_frame_type.h"
#include "content/public/common/request_context_type.h"
#include "content/public/common/resource_type.h"
+#include "mojo/public/cpp/bindings/associated_binding.h"
namespace storage {
class BlobStorageContext;
@@ -54,7 +56,8 @@ class WebContents;
// resource loads made directly by the service worker.
class CONTENT_EXPORT ServiceWorkerProviderHost
: public NON_EXPORTED_BASE(ServiceWorkerRegistration::Listener),
- public base::SupportsWeakPtr<ServiceWorkerProviderHost> {
+ public base::SupportsWeakPtr<ServiceWorkerProviderHost>,
+ public NON_EXPORTED_BASE(mojom::ServiceWorkerProviderHost) {
public:
using GetRegistrationForReadyCallback =
base::Callback<void(ServiceWorkerRegistration* reigstration)>;
@@ -82,7 +85,7 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
base::WeakPtr<ServiceWorkerContextCore> context,
ServiceWorkerDispatcherHost* dispatcher_host);
- virtual ~ServiceWorkerProviderHost();
+ ~ServiceWorkerProviderHost() override;
const std::string& client_uuid() const { return client_uuid_; }
int process_id() const { return render_process_id_; }
@@ -315,13 +318,16 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
~OneShotGetReadyCallback();
};
- ServiceWorkerProviderHost(int render_process_id,
- int route_id,
- int provider_id,
- ServiceWorkerProviderType provider_type,
- bool is_parent_frame_secure,
- base::WeakPtr<ServiceWorkerContextCore> context,
- ServiceWorkerDispatcherHost* dispatcher_host);
+ ServiceWorkerProviderHost(
+ int render_process_id,
+ int route_id,
+ int provider_id,
+ ServiceWorkerProviderType provider_type,
+ bool is_parent_frame_secure,
+ mojom::ServiceWorkerProviderAssociatedPtrInfo client_info,
+ mojom::ServiceWorkerProviderHostAssociatedRequest request,
falken 2017/03/28 06:29:43 Can ServiceWorkerProviderHost just take a ServiceW
shimazu 2017/05/08 08:34:29 Done.
+ base::WeakPtr<ServiceWorkerContextCore> context,
+ ServiceWorkerDispatcherHost* dispatcher_host);
// ServiceWorkerRegistration::Listener overrides.
void OnVersionAttributesChanged(
@@ -404,6 +410,9 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
ServiceWorkerDispatcherHost* dispatcher_host_;
bool allow_association_;
+ mojom::ServiceWorkerProviderAssociatedPtr client_;
+ mojo::AssociatedBinding<mojom::ServiceWorkerProviderHost> binding_;
+
std::vector<base::Closure> queued_events_;
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost);

Powered by Google App Engine
This is Rietveld 408576698