Commit 92753e23 authored by sigbjornf@opera.com's avatar sigbjornf@opera.com

Oilpan: avoid using WeakPtr<> for heap residing objects.

GlobalFetch::ScopedFetcher instances are heap objects, so avoid using
WeakPtr<>s over those.

Also switch over to using WeakPtr* transition types where possible.

R=haraken
BUG=509911

Review URL: https://codereview.chromium.org/1320563003

git-svn-id: svn://svn.chromium.org/blink/trunk@201305 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d951679b
...@@ -48,11 +48,7 @@ public: ...@@ -48,11 +48,7 @@ public:
void run() override; void run() override;
private: private:
#if ENABLE(OILPAN) WeakPtrWillBeCrossThreadWeakPersistent<MainThreadTaskRunner> m_runner;
CrossThreadWeakPersistent<MainThreadTaskRunner> m_runner;
#else
WeakPtr<MainThreadTaskRunner> m_runner;
#endif
OwnPtr<ExecutionContextTask> m_task; OwnPtr<ExecutionContextTask> m_task;
bool m_isInspectorTask; bool m_isInspectorTask;
}; };
......
...@@ -162,11 +162,7 @@ void FormAssociatedElement::setForm(HTMLFormElement* newForm) ...@@ -162,11 +162,7 @@ void FormAssociatedElement::setForm(HTMLFormElement* newForm)
#endif #endif
m_form->associate(*this); m_form->associate(*this);
} else { } else {
#if ENABLE(OILPAN)
m_form = nullptr; m_form = nullptr;
#else
m_form = WeakPtr<HTMLFormElement>();
#endif
} }
didChangeForm(); didChangeForm();
} }
......
...@@ -126,11 +126,7 @@ private: ...@@ -126,11 +126,7 @@ private:
void resetFormAttributeTargetObserver(); void resetFormAttributeTargetObserver();
OwnPtrWillBeMember<FormAttributeTargetObserver> m_formAttributeTargetObserver; OwnPtrWillBeMember<FormAttributeTargetObserver> m_formAttributeTargetObserver;
#if ENABLE(OILPAN) WeakPtrWillBeMember<HTMLFormElement> m_form;
Member<HTMLFormElement> m_form;
#else
WeakPtr<HTMLFormElement> m_form;
#endif
OwnPtrWillBeMember<ValidityState> m_validityState; OwnPtrWillBeMember<ValidityState> m_validityState;
String m_customValidationMessage; String m_customValidationMessage;
// Non-Oilpan: Even if m_formWasSetByParser is true, m_form can be null // Non-Oilpan: Even if m_formWasSetByParser is true, m_form can be null
......
...@@ -157,11 +157,7 @@ private: ...@@ -157,11 +157,7 @@ private:
OwnPtrWillBeMember<HTMLImageLoader> m_imageLoader; OwnPtrWillBeMember<HTMLImageLoader> m_imageLoader;
RefPtrWillBeMember<ViewportChangeListener> m_listener; RefPtrWillBeMember<ViewportChangeListener> m_listener;
#if ENABLE(OILPAN) WeakPtrWillBeMember<HTMLFormElement> m_form;
Member<HTMLFormElement> m_form;
#else
WeakPtr<HTMLFormElement> m_form;
#endif
AtomicString m_bestFitImageURL; AtomicString m_bestFitImageURL;
float m_imageDevicePixelRatio; float m_imageDevicePixelRatio;
unsigned m_formWasSetByParser : 1; unsigned m_formWasSetByParser : 1;
......
...@@ -277,7 +277,7 @@ private: ...@@ -277,7 +277,7 @@ private:
WebServiceWorkerResponse m_webResponse; WebServiceWorkerResponse m_webResponse;
}; };
Cache* Cache::create(WeakPtr<GlobalFetch::ScopedFetcher> fetcher, PassOwnPtr<WebServiceWorkerCache> webCache) Cache* Cache::create(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> fetcher, PassOwnPtr<WebServiceWorkerCache> webCache)
{ {
return new Cache(fetcher, webCache); return new Cache(fetcher, webCache);
} }
...@@ -389,9 +389,16 @@ WebServiceWorkerCache::QueryParams Cache::toWebQueryParams(const CacheQueryOptio ...@@ -389,9 +389,16 @@ WebServiceWorkerCache::QueryParams Cache::toWebQueryParams(const CacheQueryOptio
return webQueryParams; return webQueryParams;
} }
Cache::Cache(WeakPtr<GlobalFetch::ScopedFetcher> fetcher, PassOwnPtr<WebServiceWorkerCache> webCache) Cache::Cache(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> fetcher, PassOwnPtr<WebServiceWorkerCache> webCache)
: m_scopedFetcher(fetcher) : m_scopedFetcher(fetcher)
, m_webCache(webCache) { } , m_webCache(webCache)
{
}
DEFINE_TRACE(Cache)
{
visitor->trace(m_scopedFetcher);
}
ScriptPromise Cache::matchImpl(ScriptState* scriptState, const Request* request, const CacheQueryOptions& options) ScriptPromise Cache::matchImpl(ScriptState* scriptState, const Request* request, const CacheQueryOptions& options)
{ {
......
...@@ -32,7 +32,7 @@ class MODULES_EXPORT Cache final : public GarbageCollectedFinalized<Cache>, publ ...@@ -32,7 +32,7 @@ class MODULES_EXPORT Cache final : public GarbageCollectedFinalized<Cache>, publ
DEFINE_WRAPPERTYPEINFO(); DEFINE_WRAPPERTYPEINFO();
WTF_MAKE_NONCOPYABLE(Cache); WTF_MAKE_NONCOPYABLE(Cache);
public: public:
static Cache* create(WeakPtr<GlobalFetch::ScopedFetcher>, PassOwnPtr<WebServiceWorkerCache>); static Cache* create(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher>, PassOwnPtr<WebServiceWorkerCache>);
// From Cache.idl: // From Cache.idl:
ScriptPromise match(ScriptState*, const RequestInfo&, const CacheQueryOptions&, ExceptionState&); ScriptPromise match(ScriptState*, const RequestInfo&, const CacheQueryOptions&, ExceptionState&);
...@@ -47,14 +47,14 @@ public: ...@@ -47,14 +47,14 @@ public:
static WebServiceWorkerCache::QueryParams toWebQueryParams(const CacheQueryOptions&); static WebServiceWorkerCache::QueryParams toWebQueryParams(const CacheQueryOptions&);
DEFINE_INLINE_TRACE() { } DECLARE_TRACE();
private: private:
class BarrierCallbackForPut; class BarrierCallbackForPut;
class BlobHandleCallbackForPut; class BlobHandleCallbackForPut;
class FetchResolvedForAdd; class FetchResolvedForAdd;
friend class FetchResolvedForAdd; friend class FetchResolvedForAdd;
Cache(WeakPtr<GlobalFetch::ScopedFetcher>, PassOwnPtr<WebServiceWorkerCache>); Cache(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher>, PassOwnPtr<WebServiceWorkerCache>);
ScriptPromise matchImpl(ScriptState*, const Request*, const CacheQueryOptions&); ScriptPromise matchImpl(ScriptState*, const Request*, const CacheQueryOptions&);
ScriptPromise matchAllImpl(ScriptState*); ScriptPromise matchAllImpl(ScriptState*);
...@@ -67,7 +67,7 @@ private: ...@@ -67,7 +67,7 @@ private:
WebServiceWorkerCache* webCache() const; WebServiceWorkerCache* webCache() const;
WeakPtr<GlobalFetch::ScopedFetcher> m_scopedFetcher; WeakPtrWillBeMember<GlobalFetch::ScopedFetcher> m_scopedFetcher;
OwnPtr<WebServiceWorkerCache> m_webCache; OwnPtr<WebServiceWorkerCache> m_webCache;
}; };
......
...@@ -203,7 +203,7 @@ private: ...@@ -203,7 +203,7 @@ private:
Persistent<ScriptPromiseResolver> m_resolver; Persistent<ScriptPromiseResolver> m_resolver;
}; };
CacheStorage* CacheStorage::create(WeakPtr<GlobalFetch::ScopedFetcher> fetcher, WebServiceWorkerCacheStorage* webCacheStorage) CacheStorage* CacheStorage::create(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> fetcher, WebServiceWorkerCacheStorage* webCacheStorage)
{ {
return new CacheStorage(fetcher, adoptPtr(webCacheStorage)); return new CacheStorage(fetcher, adoptPtr(webCacheStorage));
} }
...@@ -313,7 +313,7 @@ ScriptPromise CacheStorage::matchImpl(ScriptState* scriptState, const Request* r ...@@ -313,7 +313,7 @@ ScriptPromise CacheStorage::matchImpl(ScriptState* scriptState, const Request* r
return promise; return promise;
} }
CacheStorage::CacheStorage(WeakPtr<GlobalFetch::ScopedFetcher> fetcher, PassOwnPtr<WebServiceWorkerCacheStorage> webCacheStorage) CacheStorage::CacheStorage(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> fetcher, PassOwnPtr<WebServiceWorkerCacheStorage> webCacheStorage)
: m_scopedFetcher(fetcher) : m_scopedFetcher(fetcher)
, m_webCacheStorage(webCacheStorage) , m_webCacheStorage(webCacheStorage)
{ {
...@@ -330,6 +330,7 @@ void CacheStorage::dispose() ...@@ -330,6 +330,7 @@ void CacheStorage::dispose()
DEFINE_TRACE(CacheStorage) DEFINE_TRACE(CacheStorage)
{ {
visitor->trace(m_scopedFetcher);
visitor->trace(m_nameToCacheMap); visitor->trace(m_nameToCacheMap);
} }
......
...@@ -25,7 +25,7 @@ class CacheStorage final : public GarbageCollectedFinalized<CacheStorage>, publi ...@@ -25,7 +25,7 @@ class CacheStorage final : public GarbageCollectedFinalized<CacheStorage>, publi
DEFINE_WRAPPERTYPEINFO(); DEFINE_WRAPPERTYPEINFO();
WTF_MAKE_NONCOPYABLE(CacheStorage); WTF_MAKE_NONCOPYABLE(CacheStorage);
public: public:
static CacheStorage* create(WeakPtr<GlobalFetch::ScopedFetcher>, WebServiceWorkerCacheStorage*); static CacheStorage* create(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher>, WebServiceWorkerCacheStorage*);
~CacheStorage(); ~CacheStorage();
void dispose(); void dispose();
...@@ -47,10 +47,10 @@ private: ...@@ -47,10 +47,10 @@ private:
friend class WithCacheCallbacks; friend class WithCacheCallbacks;
friend class DeleteCallbacks; friend class DeleteCallbacks;
CacheStorage(WeakPtr<GlobalFetch::ScopedFetcher>, PassOwnPtr<WebServiceWorkerCacheStorage>); CacheStorage(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher>, PassOwnPtr<WebServiceWorkerCacheStorage>);
ScriptPromise matchImpl(ScriptState*, const Request*, const CacheQueryOptions&); ScriptPromise matchImpl(ScriptState*, const Request*, const CacheQueryOptions&);
WeakPtr<GlobalFetch::ScopedFetcher> m_scopedFetcher; WeakPtrWillBeMember<GlobalFetch::ScopedFetcher> m_scopedFetcher;
OwnPtr<WebServiceWorkerCacheStorage> m_webCacheStorage; OwnPtr<WebServiceWorkerCacheStorage> m_webCacheStorage;
HeapHashMap<String, Member<Cache>> m_nameToCacheMap; HeapHashMap<String, Member<Cache>> m_nameToCacheMap;
}; };
......
...@@ -33,13 +33,12 @@ namespace { ...@@ -33,13 +33,12 @@ namespace {
const char kNotImplementedString[] = "NotSupportedError: Method is not implemented."; const char kNotImplementedString[] = "NotSupportedError: Method is not implemented.";
class ScopedFetcherForTests final : public GlobalFetch::ScopedFetcher { class ScopedFetcherForTests final : public NoBaseWillBeGarbageCollectedFinalized<ScopedFetcherForTests>, public GlobalFetch::ScopedFetcher {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScopedFetcherForTests);
public: public:
ScopedFetcherForTests() static PassOwnPtrWillBeRawPtr<ScopedFetcherForTests> create()
: m_fetchCount(0)
, m_expectedUrl(nullptr)
, m_weakFactory(this)
{ {
return adoptPtrWillBeNoop(new ScopedFetcherForTests);
} }
ScriptPromise fetch(ScriptState* scriptState, const RequestInfo& requestInfo, const Dictionary&, ExceptionState&) override ScriptPromise fetch(ScriptState* scriptState, const RequestInfo& requestInfo, const Dictionary&, ExceptionState&) override
...@@ -63,9 +62,13 @@ public: ...@@ -63,9 +62,13 @@ public:
return ScriptPromise::reject(scriptState, V8ThrowException::createTypeError(scriptState->isolate(), "Unexpected call to fetch, no response available.")); return ScriptPromise::reject(scriptState, V8ThrowException::createTypeError(scriptState->isolate(), "Unexpected call to fetch, no response available."));
} }
WeakPtr<GlobalFetch::ScopedFetcher> weakPtr() WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> weakPtr()
{ {
#if ENABLE(OILPAN)
return this;
#else
return m_weakFactory.createWeakPtr(); return m_weakFactory.createWeakPtr();
#endif
} }
// This does not take ownership of its parameter. The provided sample object is used to check the parameter when called. // This does not take ownership of its parameter. The provided sample object is used to check the parameter when called.
...@@ -74,12 +77,29 @@ public: ...@@ -74,12 +77,29 @@ public:
int fetchCount() const { return m_fetchCount; } int fetchCount() const { return m_fetchCount; }
DEFINE_INLINE_TRACE()
{
visitor->trace(m_response);
GlobalFetch::ScopedFetcher::trace(visitor);
}
private: private:
ScopedFetcherForTests()
: m_fetchCount(0)
, m_expectedUrl(nullptr)
#if !ENABLE(OILPAN)
, m_weakFactory(this)
#endif
{
}
int m_fetchCount; int m_fetchCount;
const String* m_expectedUrl; const String* m_expectedUrl;
Persistent<Response> m_response; PersistentWillBeMember<Response> m_response;
#if !ENABLE(OILPAN)
WeakPtrFactory<GlobalFetch::ScopedFetcher> m_weakFactory; WeakPtrFactory<GlobalFetch::ScopedFetcher> m_weakFactory;
#endif
}; };
// A test implementation of the WebServiceWorkerCache interface which returns a (provided) error for every operation, and optionally checks arguments // A test implementation of the WebServiceWorkerCache interface which returns a (provided) error for every operation, and optionally checks arguments
...@@ -322,7 +342,7 @@ RequestInfo requestToRequestInfo(Request* value) ...@@ -322,7 +342,7 @@ RequestInfo requestToRequestInfo(Request* value)
TEST_F(CacheStorageTest, Basics) TEST_F(CacheStorageTest, Basics)
{ {
ScriptState::Scope scope(scriptState()); ScriptState::Scope scope(scriptState());
OwnPtr<ScopedFetcherForTests> fetcher = adoptPtr(new ScopedFetcherForTests()); OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create();
ErrorWebCacheForTests* testCache; ErrorWebCacheForTests* testCache;
Cache* cache = createCache(fetcher.get(), testCache = new NotImplementedErrorCache()); Cache* cache = createCache(fetcher.get(), testCache = new NotImplementedErrorCache());
ASSERT(cache); ASSERT(cache);
...@@ -348,7 +368,7 @@ TEST_F(CacheStorageTest, Basics) ...@@ -348,7 +368,7 @@ TEST_F(CacheStorageTest, Basics)
TEST_F(CacheStorageTest, BasicArguments) TEST_F(CacheStorageTest, BasicArguments)
{ {
ScriptState::Scope scope(scriptState()); ScriptState::Scope scope(scriptState());
OwnPtr<ScopedFetcherForTests> fetcher = adoptPtr(new ScopedFetcherForTests()); OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create();
ErrorWebCacheForTests* testCache; ErrorWebCacheForTests* testCache;
Cache* cache = createCache(fetcher.get(), testCache = new NotImplementedErrorCache()); Cache* cache = createCache(fetcher.get(), testCache = new NotImplementedErrorCache());
ASSERT(cache); ASSERT(cache);
...@@ -404,7 +424,7 @@ TEST_F(CacheStorageTest, BasicArguments) ...@@ -404,7 +424,7 @@ TEST_F(CacheStorageTest, BasicArguments)
TEST_F(CacheStorageTest, BatchOperationArguments) TEST_F(CacheStorageTest, BatchOperationArguments)
{ {
ScriptState::Scope scope(scriptState()); ScriptState::Scope scope(scriptState());
OwnPtr<ScopedFetcherForTests> fetcher = adoptPtr(new ScopedFetcherForTests()); OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create();
ErrorWebCacheForTests* testCache; ErrorWebCacheForTests* testCache;
Cache* cache = createCache(fetcher.get(), testCache = new NotImplementedErrorCache()); Cache* cache = createCache(fetcher.get(), testCache = new NotImplementedErrorCache());
ASSERT(cache); ASSERT(cache);
...@@ -484,7 +504,7 @@ private: ...@@ -484,7 +504,7 @@ private:
TEST_F(CacheStorageTest, MatchResponseTest) TEST_F(CacheStorageTest, MatchResponseTest)
{ {
ScriptState::Scope scope(scriptState()); ScriptState::Scope scope(scriptState());
OwnPtr<ScopedFetcherForTests> fetcher = adoptPtr(new ScopedFetcherForTests()); OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create();
const String requestUrl = "http://request.url/"; const String requestUrl = "http://request.url/";
const String responseUrl = "http://match.response.test/"; const String responseUrl = "http://match.response.test/";
...@@ -520,7 +540,7 @@ private: ...@@ -520,7 +540,7 @@ private:
TEST_F(CacheStorageTest, KeysResponseTest) TEST_F(CacheStorageTest, KeysResponseTest)
{ {
ScriptState::Scope scope(scriptState()); ScriptState::Scope scope(scriptState());
OwnPtr<ScopedFetcherForTests> fetcher = adoptPtr(new ScopedFetcherForTests()); OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create();
const String url1 = "http://first.request/"; const String url1 = "http://first.request/";
const String url2 = "http://second.request/"; const String url2 = "http://second.request/";
...@@ -571,7 +591,7 @@ private: ...@@ -571,7 +591,7 @@ private:
TEST_F(CacheStorageTest, MatchAllAndBatchResponseTest) TEST_F(CacheStorageTest, MatchAllAndBatchResponseTest)
{ {
ScriptState::Scope scope(scriptState()); ScriptState::Scope scope(scriptState());
OwnPtr<ScopedFetcherForTests> fetcher = adoptPtr(new ScopedFetcherForTests()); OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create();
const String url1 = "http://first.response/"; const String url1 = "http://first.response/";
const String url2 = "http://second.response/"; const String url2 = "http://second.response/";
...@@ -609,7 +629,7 @@ TEST_F(CacheStorageTest, MatchAllAndBatchResponseTest) ...@@ -609,7 +629,7 @@ TEST_F(CacheStorageTest, MatchAllAndBatchResponseTest)
TEST_F(CacheStorageTest, Add) TEST_F(CacheStorageTest, Add)
{ {
ScriptState::Scope scope(scriptState()); ScriptState::Scope scope(scriptState());
OwnPtr<ScopedFetcherForTests> fetcher = adoptPtr(new ScopedFetcherForTests()); OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create();
const String url = "http://www.cacheadd.test/"; const String url = "http://www.cacheadd.test/";
const KURL kurl(ParsedURLString, url); const KURL kurl(ParsedURLString, url);
......
...@@ -23,14 +23,18 @@ template <typename T> ...@@ -23,14 +23,18 @@ template <typename T>
class GlobalFetchImpl final : public NoBaseWillBeGarbageCollectedFinalized<GlobalFetchImpl<T>>, public GlobalFetch::ScopedFetcher, public WillBeHeapSupplement<T> { class GlobalFetchImpl final : public NoBaseWillBeGarbageCollectedFinalized<GlobalFetchImpl<T>>, public GlobalFetch::ScopedFetcher, public WillBeHeapSupplement<T> {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(GlobalFetchImpl); WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(GlobalFetchImpl);
public: public:
static WeakPtr<ScopedFetcher> from(T& supplementable, ExecutionContext* executionContext) static WeakPtrWillBeRawPtr<ScopedFetcher> from(T& supplementable, ExecutionContext* executionContext)
{ {
GlobalFetchImpl* supplement = static_cast<GlobalFetchImpl*>(WillBeHeapSupplement<T>::from(supplementable, name())); GlobalFetchImpl* supplement = static_cast<GlobalFetchImpl*>(WillBeHeapSupplement<T>::from(supplementable, supplementName()));
if (!supplement) { if (!supplement) {
supplement = new GlobalFetchImpl(executionContext); supplement = new GlobalFetchImpl(executionContext);
WillBeHeapSupplement<T>::provideTo(supplementable, name(), adoptPtrWillBeNoop(supplement)); WillBeHeapSupplement<T>::provideTo(supplementable, supplementName(), adoptPtrWillBeNoop(supplement));
} }
#if ENABLE(OILPAN)
return supplement;
#else
return supplement->m_weakFactory.createWeakPtr(); return supplement->m_weakFactory.createWeakPtr();
#endif
} }
ScriptPromise fetch(ScriptState* scriptState, const RequestInfo& input, const Dictionary& init, ExceptionState& exceptionState) override ScriptPromise fetch(ScriptState* scriptState, const RequestInfo& input, const Dictionary& init, ExceptionState& exceptionState) override
...@@ -90,14 +94,18 @@ private: ...@@ -90,14 +94,18 @@ private:
explicit GlobalFetchImpl(ExecutionContext* executionContext) explicit GlobalFetchImpl(ExecutionContext* executionContext)
: m_fetchManager(FetchManager::create(executionContext)) : m_fetchManager(FetchManager::create(executionContext))
, m_stopDetector(StopDetector::create(executionContext, m_fetchManager.get())) , m_stopDetector(StopDetector::create(executionContext, m_fetchManager.get()))
#if !ENABLE(OILPAN)
, m_weakFactory(this) , m_weakFactory(this)
#endif
{ {
} }
static const char* name() { return "GlobalFetch"; } static const char* supplementName() { return "GlobalFetch"; }
OwnPtrWillBeMember<FetchManager> m_fetchManager; OwnPtrWillBeMember<FetchManager> m_fetchManager;
OwnPtrWillBeMember<StopDetector> m_stopDetector; OwnPtrWillBeMember<StopDetector> m_stopDetector;
#if !ENABLE(OILPAN)
WeakPtrFactory<ScopedFetcher> m_weakFactory; WeakPtrFactory<ScopedFetcher> m_weakFactory;
#endif
}; };
} // namespace } // namespace
...@@ -106,12 +114,12 @@ GlobalFetch::ScopedFetcher::~ScopedFetcher() ...@@ -106,12 +114,12 @@ GlobalFetch::ScopedFetcher::~ScopedFetcher()
{ {
} }
WeakPtr<GlobalFetch::ScopedFetcher> GlobalFetch::ScopedFetcher::from(DOMWindow& window) WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> GlobalFetch::ScopedFetcher::from(DOMWindow& window)
{ {
return GlobalFetchImpl<LocalDOMWindow>::from(toLocalDOMWindow(window), window.executionContext()); return GlobalFetchImpl<LocalDOMWindow>::from(toLocalDOMWindow(window), window.executionContext());
} }
WeakPtr<GlobalFetch::ScopedFetcher> GlobalFetch::ScopedFetcher::from(WorkerGlobalScope& worker) WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> GlobalFetch::ScopedFetcher::from(WorkerGlobalScope& worker)
{ {
return GlobalFetchImpl<WorkerGlobalScope>::from(worker, worker.executionContext()); return GlobalFetchImpl<WorkerGlobalScope>::from(worker, worker.executionContext());
} }
......
...@@ -20,14 +20,14 @@ class WorkerGlobalScope; ...@@ -20,14 +20,14 @@ class WorkerGlobalScope;
class GlobalFetch { class GlobalFetch {
public: public:
class MODULES_EXPORT ScopedFetcher { class MODULES_EXPORT ScopedFetcher : public WillBeGarbageCollectedMixin {
public: public:
virtual ~ScopedFetcher(); virtual ~ScopedFetcher();
virtual ScriptPromise fetch(ScriptState*, const RequestInfo&, const Dictionary&, ExceptionState&) = 0; virtual ScriptPromise fetch(ScriptState*, const RequestInfo&, const Dictionary&, ExceptionState&) = 0;
static WeakPtr<ScopedFetcher> from(DOMWindow&); static WeakPtrWillBeRawPtr<ScopedFetcher> from(DOMWindow&);
static WeakPtr<ScopedFetcher> from(WorkerGlobalScope&); static WeakPtrWillBeRawPtr<ScopedFetcher> from(WorkerGlobalScope&);
DECLARE_VIRTUAL_TRACE(); DECLARE_VIRTUAL_TRACE();
}; };
......
...@@ -759,6 +759,7 @@ public: ...@@ -759,6 +759,7 @@ public:
#define OwnPtrWillBePersistent blink::Persistent #define OwnPtrWillBePersistent blink::Persistent
#define OwnPtrWillBeRawPtr WTF::RawPtr #define OwnPtrWillBeRawPtr WTF::RawPtr
#define PassOwnPtrWillBeRawPtr WTF::RawPtr #define PassOwnPtrWillBeRawPtr WTF::RawPtr
#define WeakPtrWillBeCrossThreadWeakPersistent blink::CrossThreadWeakPersistent
#define WeakPtrWillBeMember blink::Member #define WeakPtrWillBeMember blink::Member
#define WeakPtrWillBeRawPtr WTF::RawPtr #define WeakPtrWillBeRawPtr WTF::RawPtr
#define WeakPtrWillBeWeakMember blink::WeakMember #define WeakPtrWillBeWeakMember blink::WeakMember
...@@ -841,6 +842,7 @@ template<typename T> T* adoptPtrWillBeNoop(T* ptr) ...@@ -841,6 +842,7 @@ template<typename T> T* adoptPtrWillBeNoop(T* ptr)
#define OwnPtrWillBePersistent WTF::OwnPtr #define OwnPtrWillBePersistent WTF::OwnPtr
#define OwnPtrWillBeRawPtr WTF::OwnPtr #define OwnPtrWillBeRawPtr WTF::OwnPtr
#define PassOwnPtrWillBeRawPtr WTF::PassOwnPtr #define PassOwnPtrWillBeRawPtr WTF::PassOwnPtr
#define WeakPtrWillBeCrossThreadWeakPersistent WTF::WeakPtr
#define WeakPtrWillBeMember WTF::WeakPtr #define WeakPtrWillBeMember WTF::WeakPtr
#define WeakPtrWillBeRawPtr WTF::WeakPtr #define WeakPtrWillBeRawPtr WTF::WeakPtr
#define WeakPtrWillBeWeakMember WTF::WeakPtr #define WeakPtrWillBeWeakMember WTF::WeakPtr
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment