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

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: Factor out common checks Created 5 years, 6 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 250bcd2d51a6d3f63d25fdc5246e3bb7418b0ff1..51f89dc2e4c05f2cc1ece2f6a599cbfee3a4bb9e 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));
}
virtual ~InspectorCacheStorageAgent();
@@ -34,7 +39,13 @@ public:
virtual void deleteEntry(ErrorString*, const String& cacheId, const String& request, PassRefPtrWillBeRawPtr<DeleteEntryCallback>) override;
private:
- explicit InspectorCacheStorageAgent();
+ explicit InspectorCacheStorageAgent(Page*);
+
+ 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