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

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

Issue 2638313002: Manage ServiceWorkerDispatcherHost in ServiceWorkerContextCore (Closed)
Patch Set: Remove a break line Created 3 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 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 3ed67ba33f4abb82da49716386d9da2e94b86508..baeee8534a93136624fb7a5e75c276d7e8303f6f 100644
--- a/content/browser/service_worker/service_worker_provider_host.h
+++ b/content/browser/service_worker/service_worker_provider_host.h
@@ -20,6 +20,7 @@
#include "base/memory/weak_ptr.h"
#include "content/browser/service_worker/service_worker_registration.h"
#include "content/common/content_export.h"
+#include "content/common/service_worker/service_worker_provider.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"
@@ -71,22 +72,17 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
bool are_ancestors_secure,
const WebContentsGetter& web_contents_getter);
- enum class FrameSecurityLevel { UNINITIALIZED, INSECURE, SECURE };
+ // Used to create a ServiceWorkerProviderHost when the renderer-side provider
+ // is created. This ProviderHost will be created for the process specified by
+ // |process_id|.
+ static std::unique_ptr<ServiceWorkerProviderHost> Create(
+ int process_id,
+ ServiceWorkerProviderHostInfo info,
+ base::WeakPtr<ServiceWorkerContextCore> context,
+ ServiceWorkerDispatcherHost* dispatcher_host);
+
+ enum class FrameSecurityLevel { INSECURE, SECURE };
horo 2017/02/08 02:14:11 you can remove this.
shimazu 2017/02/13 03:25:56 Done.
- // When this provider host is for a Service Worker context, |route_id| is
- // MSG_ROUTING_NONE. When this provider host is for a Document,
- // |route_id| is the frame ID of the Document. When this provider host is for
- // a Shared Worker, |route_id| is the Shared Worker route ID.
- // |provider_type| gives additional information whether the provider is
- // created for controller (ServiceWorker) or controllee (Document or
- // SharedWorker).
- ServiceWorkerProviderHost(int render_process_id,
- int route_id,
- int provider_id,
- ServiceWorkerProviderType provider_type,
- FrameSecurityLevel parent_frame_security_level,
- base::WeakPtr<ServiceWorkerContextCore> context,
- ServiceWorkerDispatcherHost* dispatcher_host);
virtual ~ServiceWorkerProviderHost();
const std::string& client_uuid() const { return client_uuid_; }
@@ -101,12 +97,6 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
bool is_parent_frame_secure() const {
return parent_frame_security_level_ == FrameSecurityLevel::SECURE;
}
- void set_parent_frame_secure(bool is_parent_frame_secure) {
- CHECK_EQ(parent_frame_security_level_, FrameSecurityLevel::UNINITIALIZED);
- parent_frame_security_level_ = is_parent_frame_secure
- ? FrameSecurityLevel::SECURE
- : FrameSecurityLevel::INSECURE;
- }
// Returns whether this provider host is secure enough to have a service
// worker controller.
@@ -247,7 +237,7 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
bool GetRegistrationForReady(const GetRegistrationForReadyCallback& callback);
// Methods to support cross site navigations.
- void PrepareForCrossSiteTransfer();
+ std::unique_ptr<ServiceWorkerProviderHost> PrepareForCrossSiteTransfer();
void CompleteCrossSiteTransfer(
int new_process_id,
int new_frame_id,
@@ -324,6 +314,14 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
~OneShotGetReadyCallback();
};
+ ServiceWorkerProviderHost(int render_process_id,
+ int route_id,
+ int provider_id,
+ ServiceWorkerProviderType provider_type,
+ FrameSecurityLevel parent_frame_security_level,
+ base::WeakPtr<ServiceWorkerContextCore> context,
+ ServiceWorkerDispatcherHost* dispatcher_host);
+
// ServiceWorkerRegistration::Listener overrides.
void OnVersionAttributesChanged(
ServiceWorkerRegistration* registration,
@@ -383,7 +381,7 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
WebContentsGetter web_contents_getter_;
ServiceWorkerProviderType provider_type_;
- FrameSecurityLevel parent_frame_security_level_;
+ const FrameSecurityLevel parent_frame_security_level_;
horo 2017/02/08 02:14:11 "const bool is_parent_frame_secure;" is enough?
shimazu 2017/02/13 03:25:56 Done.
GURL document_url_;
GURL topmost_frame_url_;

Powered by Google App Engine
This is Rietveld 408576698