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

Unified Diff: content/browser/navigator_connect/navigator_connect_dispatcher_host.h

Issue 861373002: Refactor navigator.connect code to make it more flexible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lower similarity threshold Created 5 years, 11 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/navigator_connect/navigator_connect_dispatcher_host.h
diff --git a/content/browser/navigator_connect/navigator_connect_dispatcher_host.h b/content/browser/navigator_connect/navigator_connect_dispatcher_host.h
index 86350a7d5f744d5d9f7662489938c6b31919fcf3..f916928ec55b2f3fec01fa3f6da53ed1bc72317d 100644
--- a/content/browser/navigator_connect/navigator_connect_dispatcher_host.h
+++ b/content/browser/navigator_connect/navigator_connect_dispatcher_host.h
@@ -5,17 +5,14 @@
#ifndef CONTENT_BROWSER_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_DISPATCHER_HOST_H_
#define CONTENT_BROWSER_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_DISPATCHER_HOST_H_
-#include "content/common/service_worker/service_worker_status_code.h"
#include "content/public/browser/browser_message_filter.h"
class GURL;
namespace content {
-struct CrossOriginServiceWorkerClient;
+struct NavigatorConnectClient;
class NavigatorConnectContext;
-class ServiceWorkerContextWrapper;
-class ServiceWorkerRegistration;
// Receives navigator.connect connection attempts from a child process.
// Attempts to find a service that serves the URL the connection is made to
@@ -27,8 +24,7 @@ class ServiceWorkerRegistration;
// if it is still handling a connection attempt).
class NavigatorConnectDispatcherHost : public BrowserMessageFilter {
public:
- NavigatorConnectDispatcherHost(
- const scoped_refptr<ServiceWorkerContextWrapper>& service_worker_context,
+ explicit NavigatorConnectDispatcherHost(
const scoped_refptr<NavigatorConnectContext>& navigator_connect_context);
private:
@@ -40,28 +36,15 @@ class NavigatorConnectDispatcherHost : public BrowserMessageFilter {
// IPC Message handlers.
void OnConnect(int thread_id,
int request_id,
- const CrossOriginServiceWorkerClient& client);
-
- // Callback called when the Service Worker context found (or didn't find) a
- // service worker registration to serve a particular URL.
- void GotServiceWorkerRegistration(
- int thread_id,
- int request_id,
- const CrossOriginServiceWorkerClient& client,
- ServiceWorkerStatusCode status,
- const scoped_refptr<ServiceWorkerRegistration>& registration);
+ const NavigatorConnectClient& client);
// Callback called when the service worker finished handling the cross origin
// connection event.
void OnConnectResult(
int thread_id,
int request_id,
- const CrossOriginServiceWorkerClient& client,
- const scoped_refptr<ServiceWorkerRegistration>& registration,
- ServiceWorkerStatusCode status,
bool accept_connection);
- scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
scoped_refptr<NavigatorConnectContext> navigator_connect_context_;
DISALLOW_COPY_AND_ASSIGN(NavigatorConnectDispatcherHost);

Powered by Google App Engine
This is Rietveld 408576698