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

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

Issue 164753006: Start of Chrome-side plumbing for ServiceWorker fetch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove empty line Created 6 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_version.h
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h
index aab6178f97271c94ccc5b46a0c2f1684712b2c18..c577ac30c2c0d0271cbf83359a3df49a1da8888a 100644
--- a/content/browser/service_worker/service_worker_version.h
+++ b/content/browser/service_worker/service_worker_version.h
@@ -24,6 +24,7 @@ namespace content {
class EmbeddedWorkerRegistry;
class ServiceWorkerRegistration;
struct ServiceWorkerFetchRequest;
+struct ServiceWorkerFetchResponse;
// This class corresponds to a specific version of a ServiceWorker
// script for a given pattern. When a script is upgraded, there may be
@@ -64,6 +65,9 @@ class CONTENT_EXPORT ServiceWorkerVersion
typedef base::Callback<void(ServiceWorkerStatusCode)> StatusCallback;
typedef base::Callback<void(ServiceWorkerStatusCode,
const IPC::Message& message)> MessageCallback;
+ typedef base::Callback<void(ServiceWorkerStatusCode,
+ const ServiceWorkerFetchResponse& response)>
+ FetchCallback;
enum Status {
STOPPED = EmbeddedWorkerInstance::STOPPED,
@@ -120,11 +124,10 @@ class CONTENT_EXPORT ServiceWorkerVersion
void DispatchInstallEvent(int active_version_embedded_worker_id,
const StatusCallback& callback);
- // Sends fetch event to the associated embedded worker.
- // This immediately returns false if the worker is not running
- // or sending a message to the child process fails.
- // TODO(kinuko): Make this take callback as well.
- bool DispatchFetchEvent(const ServiceWorkerFetchRequest& request);
+ // Sends fetch event to the associated embedded worker and calls
+ // |callback| with the response from the worker.
+ void DispatchFetchEvent(const ServiceWorkerFetchRequest& request,
+ const FetchCallback& callback);
// These are expected to be called when a renderer process host for the
// same-origin as for this ServiceWorkerVersion is created. The added
« no previous file with comments | « content/browser/service_worker/service_worker_browsertest.cc ('k') | content/browser/service_worker/service_worker_version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698