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

Unified Diff: Source/modules/cachestorage/InspectorCacheStorageAgent.h

Issue 1177983007: Cache Storage: restrict access to secure origins (Blink-side) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: DevTools: Skip enumeration if access denied Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/cachestorage/InspectorCacheStorageAgent.h
diff --git a/Source/modules/cachestorage/InspectorCacheStorageAgent.h b/Source/modules/cachestorage/InspectorCacheStorageAgent.h
index d2ca7b0d833a584501853eb2086b7c358a187cea..a7d378907767637b7b132f3739a4cd7ffae85d71 100644
--- a/Source/modules/cachestorage/InspectorCacheStorageAgent.h
+++ b/Source/modules/cachestorage/InspectorCacheStorageAgent.h
@@ -15,13 +15,18 @@ namespace blink {
typedef String ErrorString;
+class ExecutionContext;
+class Page;
+class SecurityOrigin;
+class WebServiceWorkerCacheStorage;
+
class MODULES_EXPORT InspectorCacheStorageAgent final : public InspectorBaseAgent<InspectorCacheStorageAgent, InspectorFrontend::CacheStorage>, public InspectorBackendDispatcher::CacheStorageCommandHandler {
WTF_MAKE_NONCOPYABLE(InspectorCacheStorageAgent);
public:
- static PassOwnPtrWillBeRawPtr<InspectorCacheStorageAgent> create()
+ static PassOwnPtrWillBeRawPtr<InspectorCacheStorageAgent> create(Page* page)
{
- return adoptPtrWillBeNoop(new InspectorCacheStorageAgent());
+ return adoptPtrWillBeNoop(new InspectorCacheStorageAgent(page));
}
~InspectorCacheStorageAgent() override;
@@ -34,7 +39,14 @@ public:
void deleteEntry(ErrorString*, const String& cacheId, const String& request, PassRefPtrWillBeRawPtr<DeleteEntryCallback>) override;
private:
- explicit InspectorCacheStorageAgent();
+ explicit InspectorCacheStorageAgent(Page*);
+
+ bool canAccessCacheStorage(const String& securityOrigin);
+ ExecutionContext* assertExecutionContextForOrigin(ErrorString*, SecurityOrigin*);
+ PassOwnPtr<WebServiceWorkerCacheStorage> assertCacheStorage(ErrorString*, const String& securityOrigin);
+ PassOwnPtr<WebServiceWorkerCacheStorage> assertCacheStorageAndNameForId(ErrorString*, const String& cacheId, String* cacheName);
+
+ RawPtrWillBeMember<Page> m_page;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698