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

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

Issue 1264333002: First step to refactor ServiceWorkerVersion to make event dispatching more modular. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rockot nits Created 4 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
« no previous file with comments | « no previous file | content/browser/navigator_connect/navigator_connect_context_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/navigator_connect/navigator_connect_context_impl.h
diff --git a/content/browser/navigator_connect/navigator_connect_context_impl.h b/content/browser/navigator_connect/navigator_connect_context_impl.h
index e57c2e804a7b257521b9bf226c93fd9e2e86495e..5337a338203ba4e3a5e41b1c13467bfa99241be3 100644
--- a/content/browser/navigator_connect/navigator_connect_context_impl.h
+++ b/content/browser/navigator_connect/navigator_connect_context_impl.h
@@ -9,6 +9,7 @@
#include "base/callback_forward.h"
#include "base/memory/scoped_vector.h"
#include "base/strings/string16.h"
+#include "content/common/service_port_service.mojom.h"
#include "content/common/service_worker/service_worker_status_code.h"
#include "content/public/browser/navigator_connect_context.h"
@@ -23,6 +24,7 @@ struct NavigatorConnectClient;
class ServicePortServiceImpl;
class ServiceWorkerContextWrapper;
class ServiceWorkerRegistration;
+class ServiceWorkerVersion;
struct TransferredMessagePort;
// Tracks all active navigator.services connections, as well as available
@@ -81,16 +83,30 @@ class NavigatorConnectContextImpl : public NavigatorConnectContext {
ServiceWorkerStatusCode status,
const scoped_refptr<ServiceWorkerRegistration>& registration);
- // Callback called by service factories when a connection succeeded or failed.
+ void DispatchConnectEvent(const ConnectCallback& callback,
+ int client_port_id,
+ int service_port_id,
+ const scoped_refptr<ServiceWorkerRegistration>&
+ service_worker_registration,
+ const scoped_refptr<ServiceWorkerVersion>& worker);
+
+ // Callback called when dispatching a connect event failed.
+ void OnConnectError(const ConnectCallback& calback,
+ int client_port_id,
+ int service_port_id,
+ ServiceWorkerStatusCode status);
+
+ // Callback called with the response to a connect event.
void OnConnectResult(const ConnectCallback& callback,
int client_port_id,
int service_port_id,
const scoped_refptr<ServiceWorkerRegistration>&
service_worker_registration,
- ServiceWorkerStatusCode status,
- bool accept_connection,
- const base::string16& name,
- const base::string16& data);
+ const scoped_refptr<ServiceWorkerVersion>& worker,
+ int request_id,
+ ServicePortConnectResult result,
+ const mojo::String& name,
+ const mojo::String& data);
// Callback called when a ServiceWorkerRegistration has been located to
// deliver a message to.
« no previous file with comments | « no previous file | content/browser/navigator_connect/navigator_connect_context_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698