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

Side by Side Diff: Source/modules/serviceworkers/ServiceWorkerGlobalScopeClient.h

Issue 180843003: Start to implement FetchEvent for ServiceWorker (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: patch for landing Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 20 matching lines...) Expand all
31 #ifndef ServiceWorkerGlobalScopeClient_h 31 #ifndef ServiceWorkerGlobalScopeClient_h
32 #define ServiceWorkerGlobalScopeClient_h 32 #define ServiceWorkerGlobalScopeClient_h
33 33
34 #include "core/workers/WorkerClients.h" 34 #include "core/workers/WorkerClients.h"
35 #include "wtf/Forward.h" 35 #include "wtf/Forward.h"
36 #include "wtf/Noncopyable.h" 36 #include "wtf/Noncopyable.h"
37 37
38 namespace WebCore { 38 namespace WebCore {
39 39
40 class ExecutionContext; 40 class ExecutionContext;
41 class Response;
41 class WorkerClients; 42 class WorkerClients;
42 43
43 class ServiceWorkerGlobalScopeClient : public Supplement<WorkerClients> { 44 class ServiceWorkerGlobalScopeClient : public Supplement<WorkerClients> {
44 WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeClient); 45 WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeClient);
45 public: 46 public:
46 virtual ~ServiceWorkerGlobalScopeClient() { } 47 virtual ~ServiceWorkerGlobalScopeClient() { }
47 48
48 virtual void didHandleInstallEvent(int installEventID) = 0; 49 virtual void didHandleInstallEvent(int installEventID) = 0;
50 // A null response means no valid response was provided by the service worke r, so fallback to native.
51 virtual void didHandleFetchEvent(int fetchEventID, PassRefPtr<Response> = nu llptr) = 0;
49 52
50 static const char* supplementName(); 53 static const char* supplementName();
51 static ServiceWorkerGlobalScopeClient* from(ExecutionContext*); 54 static ServiceWorkerGlobalScopeClient* from(ExecutionContext*);
52 55
53 protected: 56 protected:
54 ServiceWorkerGlobalScopeClient() { } 57 ServiceWorkerGlobalScopeClient() { }
55 }; 58 };
56 59
57 void provideServiceWorkerGlobalScopeClientToWorker(WorkerClients*, PassOwnPtr<Se rviceWorkerGlobalScopeClient>); 60 void provideServiceWorkerGlobalScopeClientToWorker(WorkerClients*, PassOwnPtr<Se rviceWorkerGlobalScopeClient>);
58 61
59 } // namespace WebCore 62 } // namespace WebCore
60 63
61 #endif // ServiceWorkerGlobalScopeClient_h 64 #endif // ServiceWorkerGlobalScopeClient_h
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerGlobalScope.h ('k') | Source/web/ServiceWorkerGlobalScopeClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698