| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "core/InspectorFrontend.h" | 28 #include "core/InspectorFrontend.h" |
| 29 #include "core/inspector/InspectorBaseAgent.h" | 29 #include "core/inspector/InspectorBaseAgent.h" |
| 30 #include "core/loader/appcache/ApplicationCacheHost.h" | 30 #include "core/loader/appcache/ApplicationCacheHost.h" |
| 31 #include "wtf/Noncopyable.h" | 31 #include "wtf/Noncopyable.h" |
| 32 #include "wtf/PassOwnPtr.h" | 32 #include "wtf/PassOwnPtr.h" |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 class LocalFrame; | 36 class LocalFrame; |
| 37 class InspectorFrontend; | 37 class InspectorFrontend; |
| 38 class InspectorPageAgent; |
| 38 | 39 |
| 39 typedef String ErrorString; | 40 typedef String ErrorString; |
| 40 | 41 |
| 41 class InspectorApplicationCacheAgent final : public InspectorBaseAgent<Inspector
ApplicationCacheAgent, InspectorFrontend::ApplicationCache>, public InspectorBac
kendDispatcher::ApplicationCacheCommandHandler { | 42 class InspectorApplicationCacheAgent final : public InspectorBaseAgent<Inspector
ApplicationCacheAgent, InspectorFrontend::ApplicationCache>, public InspectorBac
kendDispatcher::ApplicationCacheCommandHandler { |
| 42 WTF_MAKE_NONCOPYABLE(InspectorApplicationCacheAgent); | 43 WTF_MAKE_NONCOPYABLE(InspectorApplicationCacheAgent); |
| 43 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(InspectorApplicationCacheAgent); | 44 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(InspectorApplicationCacheAgent); |
| 44 public: | 45 public: |
| 45 static PassOwnPtrWillBeRawPtr<InspectorApplicationCacheAgent> create(LocalFr
ame* inspectedFrame) | 46 static PassOwnPtrWillBeRawPtr<InspectorApplicationCacheAgent> create(Inspect
orPageAgent* pageAgent) |
| 46 { | 47 { |
| 47 return adoptPtrWillBeNoop(new InspectorApplicationCacheAgent(inspectedFr
ame)); | 48 return adoptPtrWillBeNoop(new InspectorApplicationCacheAgent(pageAgent))
; |
| 48 } | 49 } |
| 49 virtual ~InspectorApplicationCacheAgent() { } | 50 virtual ~InspectorApplicationCacheAgent() { } |
| 50 DECLARE_VIRTUAL_TRACE(); | 51 DECLARE_VIRTUAL_TRACE(); |
| 51 | 52 |
| 52 // InspectorBaseAgent | 53 // InspectorBaseAgent |
| 53 void restore() override; | 54 void restore() override; |
| 54 void disable(ErrorString*) override; | 55 void disable(ErrorString*) override; |
| 55 | 56 |
| 56 // InspectorInstrumentation API | 57 // InspectorInstrumentation API |
| 57 void updateApplicationCacheStatus(LocalFrame*); | 58 void updateApplicationCacheStatus(LocalFrame*); |
| 58 void networkStateChanged(LocalFrame*, bool online); | 59 void networkStateChanged(LocalFrame*, bool online); |
| 59 | 60 |
| 60 // ApplicationCache API for InspectorFrontend | 61 // ApplicationCache API for InspectorFrontend |
| 61 virtual void enable(ErrorString*) override; | 62 virtual void enable(ErrorString*) override; |
| 62 virtual void getFramesWithManifests(ErrorString*, RefPtr<TypeBuilder::Array<
TypeBuilder::ApplicationCache::FrameWithManifest> >& result) override; | 63 virtual void getFramesWithManifests(ErrorString*, RefPtr<TypeBuilder::Array<
TypeBuilder::ApplicationCache::FrameWithManifest> >& result) override; |
| 63 virtual void getManifestForFrame(ErrorString*, const String& frameId, String
* manifestURL) override; | 64 virtual void getManifestForFrame(ErrorString*, const String& frameId, String
* manifestURL) override; |
| 64 virtual void getApplicationCacheForFrame(ErrorString*, const String& frameId
, RefPtr<TypeBuilder::ApplicationCache::ApplicationCache>&) override; | 65 virtual void getApplicationCacheForFrame(ErrorString*, const String& frameId
, RefPtr<TypeBuilder::ApplicationCache::ApplicationCache>&) override; |
| 65 | 66 |
| 66 private: | 67 private: |
| 67 explicit InspectorApplicationCacheAgent(LocalFrame*); | 68 InspectorApplicationCacheAgent(InspectorPageAgent*); |
| 68 PassRefPtr<TypeBuilder::ApplicationCache::ApplicationCache> buildObjectForAp
plicationCache(const ApplicationCacheHost::ResourceInfoList&, const ApplicationC
acheHost::CacheInfo&); | 69 PassRefPtr<TypeBuilder::ApplicationCache::ApplicationCache> buildObjectForAp
plicationCache(const ApplicationCacheHost::ResourceInfoList&, const ApplicationC
acheHost::CacheInfo&); |
| 69 PassRefPtr<TypeBuilder::Array<TypeBuilder::ApplicationCache::ApplicationCach
eResource> > buildArrayForApplicationCacheResources(const ApplicationCacheHost::
ResourceInfoList&); | 70 PassRefPtr<TypeBuilder::Array<TypeBuilder::ApplicationCache::ApplicationCach
eResource> > buildArrayForApplicationCacheResources(const ApplicationCacheHost::
ResourceInfoList&); |
| 70 PassRefPtr<TypeBuilder::ApplicationCache::ApplicationCacheResource> buildObj
ectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo&); | 71 PassRefPtr<TypeBuilder::ApplicationCache::ApplicationCacheResource> buildObj
ectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo&); |
| 71 | 72 |
| 72 DocumentLoader* assertFrameWithDocumentLoader(ErrorString*, String frameId); | 73 DocumentLoader* assertFrameWithDocumentLoader(ErrorString*, String frameId); |
| 73 | 74 |
| 74 RawPtrWillBeMember<LocalFrame> m_inspectedFrame; | 75 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 } // namespace blink | 78 } // namespace blink |
| 78 | 79 |
| 79 #endif // InspectorApplicationCacheAgent_h | 80 #endif // InspectorApplicationCacheAgent_h |
| OLD | NEW |