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

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

Issue 399543002: [ServiceWorker] Make fetch() method better conformance with the spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 18 matching lines...) Expand all
29 */ 29 */
30 #ifndef ServiceWorkerGlobalScope_h 30 #ifndef ServiceWorkerGlobalScope_h
31 #define ServiceWorkerGlobalScope_h 31 #define ServiceWorkerGlobalScope_h
32 32
33 #include "core/workers/WorkerGlobalScope.h" 33 #include "core/workers/WorkerGlobalScope.h"
34 #include "platform/heap/Handle.h" 34 #include "platform/heap/Handle.h"
35 #include "wtf/Assertions.h" 35 #include "wtf/Assertions.h"
36 36
37 namespace WebCore { 37 namespace WebCore {
38 38
39 class Dictionary;
39 class FetchManager; 40 class FetchManager;
40 class Request; 41 class Request;
41 class ScriptPromise; 42 class ScriptPromise;
42 class ScriptState; 43 class ScriptState;
43 class ServiceWorkerThread; 44 class ServiceWorkerThread;
44 class ServiceWorkerClients; 45 class ServiceWorkerClients;
45 class WorkerThreadStartupData; 46 class WorkerThreadStartupData;
46 47
47 class ServiceWorkerGlobalScope FINAL : public WorkerGlobalScope { 48 class ServiceWorkerGlobalScope FINAL : public WorkerGlobalScope {
48 public: 49 public:
49 static PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> create(ServiceWorker Thread*, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData>); 50 static PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> create(ServiceWorker Thread*, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData>);
50 51
51 virtual ~ServiceWorkerGlobalScope(); 52 virtual ~ServiceWorkerGlobalScope();
52 virtual bool isServiceWorkerGlobalScope() const OVERRIDE { return true; } 53 virtual bool isServiceWorkerGlobalScope() const OVERRIDE { return true; }
53 virtual void stopFetch() OVERRIDE; 54 virtual void stopFetch() OVERRIDE;
54 55
55 // ServiceWorkerGlobalScope.idl 56 // ServiceWorkerGlobalScope.idl
56 PassRefPtrWillBeRawPtr<ServiceWorkerClients> clients(); 57 PassRefPtrWillBeRawPtr<ServiceWorkerClients> clients();
57 String scope(ExecutionContext*); 58 String scope(ExecutionContext*);
58 ScriptPromise fetch(ScriptState*, Request*); 59 ScriptPromise fetch(ScriptState*, Request*);
60 ScriptPromise fetch(ScriptState*, Request*, const Dictionary&);
59 ScriptPromise fetch(ScriptState*, const String&); 61 ScriptPromise fetch(ScriptState*, const String&);
62 ScriptPromise fetch(ScriptState*, const String&, const Dictionary&);
60 63
61 // EventTarget 64 // EventTarget
62 virtual const AtomicString& interfaceName() const OVERRIDE; 65 virtual const AtomicString& interfaceName() const OVERRIDE;
63 66
64 DEFINE_ATTRIBUTE_EVENT_LISTENER(install); 67 DEFINE_ATTRIBUTE_EVENT_LISTENER(install);
65 DEFINE_ATTRIBUTE_EVENT_LISTENER(activate); 68 DEFINE_ATTRIBUTE_EVENT_LISTENER(activate);
66 DEFINE_ATTRIBUTE_EVENT_LISTENER(fetch); 69 DEFINE_ATTRIBUTE_EVENT_LISTENER(fetch);
67 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); 70 DEFINE_ATTRIBUTE_EVENT_LISTENER(message);
68 DEFINE_ATTRIBUTE_EVENT_LISTENER(sync); 71 DEFINE_ATTRIBUTE_EVENT_LISTENER(sync);
69 72
70 virtual void trace(Visitor*) OVERRIDE; 73 virtual void trace(Visitor*) OVERRIDE;
71 74
72 private: 75 private:
73 ServiceWorkerGlobalScope(const KURL&, const String& userAgent, ServiceWorker Thread*, double timeOrigin, PassOwnPtrWillBeRawPtr<WorkerClients>); 76 ServiceWorkerGlobalScope(const KURL&, const String& userAgent, ServiceWorker Thread*, double timeOrigin, PassOwnPtrWillBeRawPtr<WorkerClients>);
74 virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallS tack>) OVERRIDE; 77 virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallS tack>) OVERRIDE;
78 ScriptPromise fetch(ScriptState*, PassRefPtr<Request>);
yhirano 2014/07/16 13:12:27 Can you rename this function to another name (e.g.
horo 2014/07/18 09:12:18 It should be deleted. I deleted it.
75 79
76 RefPtrWillBeMember<ServiceWorkerClients> m_clients; 80 RefPtrWillBeMember<ServiceWorkerClients> m_clients;
77 OwnPtr<FetchManager> m_fetchManager; 81 OwnPtr<FetchManager> m_fetchManager;
78 }; 82 };
79 83
80 } // namespace WebCore 84 } // namespace WebCore
81 85
82 #endif // ServiceWorkerGlobalScope_h 86 #endif // ServiceWorkerGlobalScope_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698