Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef Cache_h | 5 #ifndef Cache_h |
| 6 #define Cache_h | 6 #define Cache_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
| 10 #include "bindings/modules/v8/UnionTypesModules.h" | 10 #include "bindings/modules/v8/UnionTypesModules.h" |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 class Response; | 25 class Response; |
| 26 class Request; | 26 class Request; |
| 27 class ScriptState; | 27 class ScriptState; |
| 28 | 28 |
| 29 typedef RequestOrUSVString RequestInfo; | 29 typedef RequestOrUSVString RequestInfo; |
| 30 | 30 |
| 31 class MODULES_EXPORT Cache final : public GarbageCollectedFinalized<Cache>, publ ic ScriptWrappable { | 31 class MODULES_EXPORT Cache final : public GarbageCollectedFinalized<Cache>, publ ic ScriptWrappable { |
| 32 DEFINE_WRAPPERTYPEINFO(); | 32 DEFINE_WRAPPERTYPEINFO(); |
| 33 WTF_MAKE_NONCOPYABLE(Cache); | 33 WTF_MAKE_NONCOPYABLE(Cache); |
| 34 public: | 34 public: |
| 35 static Cache* create(WeakPtr<GlobalFetch::ScopedFetcher>, PassOwnPtr<WebServ iceWorkerCache>); | 35 static Cache* create(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher>, PassOw nPtr<WebServiceWorkerCache>); |
| 36 | 36 |
| 37 // From Cache.idl: | 37 // From Cache.idl: |
| 38 ScriptPromise match(ScriptState*, const RequestInfo&, const CacheQueryOption s&, ExceptionState&); | 38 ScriptPromise match(ScriptState*, const RequestInfo&, const CacheQueryOption s&, ExceptionState&); |
| 39 ScriptPromise matchAll(ScriptState*, ExceptionState&); | 39 ScriptPromise matchAll(ScriptState*, ExceptionState&); |
| 40 ScriptPromise matchAll(ScriptState*, const RequestInfo&, const CacheQueryOpt ions&, ExceptionState&); | 40 ScriptPromise matchAll(ScriptState*, const RequestInfo&, const CacheQueryOpt ions&, ExceptionState&); |
| 41 ScriptPromise add(ScriptState*, const RequestInfo&, ExceptionState&); | 41 ScriptPromise add(ScriptState*, const RequestInfo&, ExceptionState&); |
| 42 ScriptPromise addAll(ScriptState*, const HeapVector<RequestInfo>&, Exception State&); | 42 ScriptPromise addAll(ScriptState*, const HeapVector<RequestInfo>&, Exception State&); |
| 43 ScriptPromise deleteFunction(ScriptState*, const RequestInfo&, const CacheQu eryOptions&, ExceptionState&); | 43 ScriptPromise deleteFunction(ScriptState*, const RequestInfo&, const CacheQu eryOptions&, ExceptionState&); |
| 44 ScriptPromise put(ScriptState*, const RequestInfo&, Response*, ExceptionStat e&); | 44 ScriptPromise put(ScriptState*, const RequestInfo&, Response*, ExceptionStat e&); |
| 45 ScriptPromise keys(ScriptState*, ExceptionState&); | 45 ScriptPromise keys(ScriptState*, ExceptionState&); |
| 46 ScriptPromise keys(ScriptState*, const RequestInfo&, const CacheQueryOptions &, ExceptionState&); | 46 ScriptPromise keys(ScriptState*, const RequestInfo&, const CacheQueryOptions &, ExceptionState&); |
| 47 | 47 |
| 48 static WebServiceWorkerCache::QueryParams toWebQueryParams(const CacheQueryO ptions&); | 48 static WebServiceWorkerCache::QueryParams toWebQueryParams(const CacheQueryO ptions&); |
| 49 | 49 |
| 50 DEFINE_INLINE_TRACE() { } | 50 DECLARE_TRACE(); |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 class BarrierCallbackForPut; | 53 class BarrierCallbackForPut; |
| 54 class BlobHandleCallbackForPut; | 54 class BlobHandleCallbackForPut; |
| 55 class FetchResolvedForAdd; | 55 class FetchResolvedForAdd; |
| 56 friend class FetchResolvedForAdd; | 56 friend class FetchResolvedForAdd; |
| 57 Cache(WeakPtr<GlobalFetch::ScopedFetcher>, PassOwnPtr<WebServiceWorkerCache> ); | 57 Cache(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher>, PassOwnPtr<WebService WorkerCache>); |
| 58 | 58 |
| 59 ScriptPromise matchImpl(ScriptState*, const Request*, const CacheQueryOption s&); | 59 ScriptPromise matchImpl(ScriptState*, const Request*, const CacheQueryOption s&); |
| 60 ScriptPromise matchAllImpl(ScriptState*); | 60 ScriptPromise matchAllImpl(ScriptState*); |
| 61 ScriptPromise matchAllImpl(ScriptState*, const Request*, const CacheQueryOpt ions&); | 61 ScriptPromise matchAllImpl(ScriptState*, const Request*, const CacheQueryOpt ions&); |
| 62 ScriptPromise addAllImpl(ScriptState*, const HeapVector<Member<Request>>&, E xceptionState&); | 62 ScriptPromise addAllImpl(ScriptState*, const HeapVector<Member<Request>>&, E xceptionState&); |
| 63 ScriptPromise deleteImpl(ScriptState*, const Request*, const CacheQueryOptio ns&); | 63 ScriptPromise deleteImpl(ScriptState*, const Request*, const CacheQueryOptio ns&); |
| 64 ScriptPromise putImpl(ScriptState*, const HeapVector<Member<Request>>&, cons t HeapVector<Member<Response>>&); | 64 ScriptPromise putImpl(ScriptState*, const HeapVector<Member<Request>>&, cons t HeapVector<Member<Response>>&); |
| 65 ScriptPromise keysImpl(ScriptState*); | 65 ScriptPromise keysImpl(ScriptState*); |
| 66 ScriptPromise keysImpl(ScriptState*, const Request*, const CacheQueryOptions &); | 66 ScriptPromise keysImpl(ScriptState*, const Request*, const CacheQueryOptions &); |
| 67 | 67 |
| 68 WebServiceWorkerCache* webCache() const; | 68 WebServiceWorkerCache* webCache() const; |
| 69 | 69 |
| 70 WeakPtr<GlobalFetch::ScopedFetcher> m_scopedFetcher; | 70 WeakPtrWillBeMember<GlobalFetch::ScopedFetcher> m_scopedFetcher; |
|
haraken
2015/08/27 00:41:05
I'm wondering why this needs to be a WeakPtr in no
sof
2015/08/27 05:17:13
It's a WeakPtr<> because the GlobalFetcherImpl is
| |
| 71 OwnPtr<WebServiceWorkerCache> m_webCache; | 71 OwnPtr<WebServiceWorkerCache> m_webCache; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace blink | 74 } // namespace blink |
| 75 | 75 |
| 76 #endif // Cache_h | 76 #endif // Cache_h |
| OLD | NEW |