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

Side by Side Diff: third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp

Issue 2141383002: [Fetch API] Remove HandleScope to protect local handles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 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 // 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 #include "modules/cachestorage/CacheStorage.h" 5 #include "modules/cachestorage/CacheStorage.h"
6 6
7 #include "bindings/core/v8/ScriptPromiseResolver.h" 7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "bindings/core/v8/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "core/dom/DOMException.h" 9 #include "core/dom/DOMException.h"
10 #include "core/dom/ExceptionCode.h" 10 #include "core/dom/ExceptionCode.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 class CacheStorage::MatchCallbacks : public WebServiceWorkerCacheStorage::CacheS torageMatchCallbacks { 124 class CacheStorage::MatchCallbacks : public WebServiceWorkerCacheStorage::CacheS torageMatchCallbacks {
125 WTF_MAKE_NONCOPYABLE(MatchCallbacks); 125 WTF_MAKE_NONCOPYABLE(MatchCallbacks);
126 public: 126 public:
127 explicit MatchCallbacks(ScriptPromiseResolver* resolver) 127 explicit MatchCallbacks(ScriptPromiseResolver* resolver)
128 : m_resolver(resolver) { } 128 : m_resolver(resolver) { }
129 129
130 void onSuccess(const WebServiceWorkerResponse& webResponse) override 130 void onSuccess(const WebServiceWorkerResponse& webResponse) override
131 { 131 {
132 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex t()->activeDOMObjectsAreStopped()) 132 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex t()->activeDOMObjectsAreStopped())
133 return; 133 return;
134 ScriptState::Scope scope(m_resolver->getScriptState());
134 m_resolver->resolve(Response::create(m_resolver->getScriptState(), webRe sponse)); 135 m_resolver->resolve(Response::create(m_resolver->getScriptState(), webRe sponse));
135 m_resolver.clear(); 136 m_resolver.clear();
136 } 137 }
137 138
138 void onError(WebServiceWorkerCacheError reason) override 139 void onError(WebServiceWorkerCacheError reason) override
139 { 140 {
140 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex t()->activeDOMObjectsAreStopped()) 141 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex t()->activeDOMObjectsAreStopped())
141 return; 142 return;
142 if (reason == WebServiceWorkerCacheErrorNotFound) 143 if (reason == WebServiceWorkerCacheErrorNotFound)
143 m_resolver->resolve(); 144 m_resolver->resolve();
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 m_webCacheStorage.reset(); 343 m_webCacheStorage.reset();
343 } 344 }
344 345
345 DEFINE_TRACE(CacheStorage) 346 DEFINE_TRACE(CacheStorage)
346 { 347 {
347 visitor->trace(m_scopedFetcher); 348 visitor->trace(m_scopedFetcher);
348 visitor->trace(m_nameToCacheMap); 349 visitor->trace(m_nameToCacheMap);
349 } 350 }
350 351
351 } // namespace blink 352 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/cachestorage/Cache.cpp ('k') | third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698