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

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

Issue 2653493009: Add two interfaces for ServiceWorkerProviderContext/ProviderHost (Closed)
Patch Set: Addressed comments from falken Created 3 years, 7 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 8d5fee4ae4ce73d8e25dbf95a8821f8d689d734c..252545466b39b2e8336557cb127d772444552768 100644
--- a/content/browser/service_worker/service_worker_provider_host.h
+++ b/content/browser/service_worker/service_worker_provider_host.h
@@ -22,11 +22,13 @@
#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/common/worker_url_loader_factory_provider.mojom.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;
@@ -56,7 +58,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)>;
@@ -84,7 +87,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_; }
@@ -250,7 +253,7 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
// Completes initialization of provider hosts used for navigation requests.
void CompleteNavigationInitialized(
int process_id,
- int frame_routing_id,
+ ServiceWorkerProviderHostInfo info,
ServiceWorkerDispatcherHost* dispatcher_host);
// Sends event messages to the renderer. Events for the worker are queued up
@@ -318,7 +321,7 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
~OneShotGetReadyCallback();
};
- ServiceWorkerProviderHost(int render_process_id,
+ ServiceWorkerProviderHost(int process_id,
ServiceWorkerProviderHostInfo info,
base::WeakPtr<ServiceWorkerContextCore> context,
ServiceWorkerDispatcherHost* dispatcher_host);
@@ -403,6 +406,10 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
ServiceWorkerDispatcherHost* dispatcher_host_;
bool allow_association_;
+ // The renderer-side Mojo endpoint for this provider.
falken 2017/05/22 08:28:12 Can you docu binding_ also? // |provider_| is the
shimazu 2017/05/23 06:29:34 Done.
+ mojom::ServiceWorkerProviderAssociatedPtr provider_;
+ mojo::AssociatedBinding<mojom::ServiceWorkerProviderHost> binding_;
+
std::vector<base::Closure> queued_events_;
// Keeps ServiceWorkerWorkerClient pointers of dedicated or shared workers

Powered by Google App Engine
This is Rietveld 408576698