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

Side by Side Diff: Source/core/inspector/InspectorApplicationCacheAgent.h

Issue 17030009: Inspector: wrapped inspector agent instances into factory-like wrappers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 21 matching lines...) Expand all
32 #include <wtf/Noncopyable.h> 32 #include <wtf/Noncopyable.h>
33 #include <wtf/PassOwnPtr.h> 33 #include <wtf/PassOwnPtr.h>
34 34
35 namespace WebCore { 35 namespace WebCore {
36 36
37 class Frame; 37 class Frame;
38 class InspectorArray; 38 class InspectorArray;
39 class InspectorFrontend; 39 class InspectorFrontend;
40 class InspectorObject; 40 class InspectorObject;
41 class InspectorPageAgent; 41 class InspectorPageAgent;
42 class InspectorPageFactory;
42 class InspectorValue; 43 class InspectorValue;
43 class InspectorState; 44 class InspectorState;
44 class InstrumentingAgents; 45 class InstrumentingAgents;
45 class Page; 46 class Page;
46 class ResourceResponse; 47 class ResourceResponse;
47 48
48 typedef String ErrorString; 49 typedef String ErrorString;
49 50
50 class InspectorApplicationCacheAgent : public InspectorBaseAgent<InspectorApplic ationCacheAgent>, public InspectorBackendDispatcher::ApplicationCacheCommandHand ler { 51 class InspectorApplicationCacheAgent : public InspectorBaseAgent, public Inspect orBackendDispatcher::ApplicationCacheCommandHandler {
51 WTF_MAKE_NONCOPYABLE(InspectorApplicationCacheAgent); WTF_MAKE_FAST_ALLOCATE D; 52 WTF_MAKE_NONCOPYABLE(InspectorApplicationCacheAgent); WTF_MAKE_FAST_ALLOCATE D;
52 public: 53 public:
53 static PassOwnPtr<InspectorApplicationCacheAgent> create(InstrumentingAgents * instrumentingAgents, InspectorCompositeState* state, InspectorPageAgent* pageA gent) 54 static PassRefPtr<InspectorApplicationCacheAgent> create(InstrumentingAgents *, InspectorState*, PassRefPtr<InspectorPageAgent>);
54 { 55 virtual ~InspectorApplicationCacheAgent();
55 return adoptPtr(new InspectorApplicationCacheAgent(instrumentingAgents, state, pageAgent));
56 }
57 ~InspectorApplicationCacheAgent() { }
58 56
59 // InspectorBaseAgent 57 // InspectorBaseAgent
60 virtual void setFrontend(InspectorFrontend*); 58 virtual void setFrontend(InspectorFrontend*);
61 virtual void clearFrontend(); 59 virtual void clearFrontend();
62 virtual void restore(); 60 virtual void restore();
63 61
64 // InspectorInstrumentation API 62 // InspectorInstrumentation API
65 void updateApplicationCacheStatus(Frame*); 63 void updateApplicationCacheStatus(Frame*);
66 void networkStateChanged(); 64 void networkStateChanged();
67 65
68 // ApplicationCache API for InspectorFrontend 66 // ApplicationCache API for InspectorFrontend
69 virtual void enable(ErrorString*); 67 virtual void enable(ErrorString*);
70 virtual void getFramesWithManifests(ErrorString*, RefPtr<TypeBuilder::Array< TypeBuilder::ApplicationCache::FrameWithManifest> >& result); 68 virtual void getFramesWithManifests(ErrorString*, RefPtr<TypeBuilder::Array< TypeBuilder::ApplicationCache::FrameWithManifest> >& result);
71 virtual void getManifestForFrame(ErrorString*, const String& frameId, String * manifestURL); 69 virtual void getManifestForFrame(ErrorString*, const String& frameId, String * manifestURL);
72 virtual void getApplicationCacheForFrame(ErrorString*, const String& frameId , RefPtr<TypeBuilder::ApplicationCache::ApplicationCache>&); 70 virtual void getApplicationCacheForFrame(ErrorString*, const String& frameId , RefPtr<TypeBuilder::ApplicationCache::ApplicationCache>&);
73 71
74 private: 72 private:
75 InspectorApplicationCacheAgent(InstrumentingAgents*, InspectorCompositeState *, InspectorPageAgent*); 73 InspectorApplicationCacheAgent(InstrumentingAgents*, InspectorState*, PassRe fPtr<InspectorPageAgent>);
76 PassRefPtr<TypeBuilder::ApplicationCache::ApplicationCache> buildObjectForAp plicationCache(const ApplicationCacheHost::ResourceInfoList&, const ApplicationC acheHost::CacheInfo&); 74 PassRefPtr<TypeBuilder::ApplicationCache::ApplicationCache> buildObjectForAp plicationCache(const ApplicationCacheHost::ResourceInfoList&, const ApplicationC acheHost::CacheInfo&);
77 PassRefPtr<TypeBuilder::Array<TypeBuilder::ApplicationCache::ApplicationCach eResource> > buildArrayForApplicationCacheResources(const ApplicationCacheHost:: ResourceInfoList&); 75 PassRefPtr<TypeBuilder::Array<TypeBuilder::ApplicationCache::ApplicationCach eResource> > buildArrayForApplicationCacheResources(const ApplicationCacheHost:: ResourceInfoList&);
78 PassRefPtr<TypeBuilder::ApplicationCache::ApplicationCacheResource> buildObj ectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo&); 76 PassRefPtr<TypeBuilder::ApplicationCache::ApplicationCacheResource> buildObj ectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo&);
79 77
80 DocumentLoader* assertFrameWithDocumentLoader(ErrorString*, String frameId); 78 DocumentLoader* assertFrameWithDocumentLoader(ErrorString*, String frameId);
81 79
82 InspectorPageAgent* m_pageAgent; 80 RefPtr<InspectorPageAgent> m_pageAgent;
83 InspectorFrontend::ApplicationCache* m_frontend; 81 InspectorFrontend::ApplicationCache* m_frontend;
84 }; 82 };
85 83
84 class InspectorApplicationCacheFactory : public InspectorBaseFactory<InspectorAp plicationCacheFactory, InspectorApplicationCacheAgent> {
85 public:
86
87 static PassOwnPtr<InspectorApplicationCacheFactory> create(InstrumentingAgen ts* instrumentingAgents, InspectorCompositeState* compositeState, InspectorPageF actory* pageFactory)
88 {
89 return adoptPtr(new InspectorApplicationCacheFactory(instrumentingAgents , compositeState, pageFactory));
90 }
91
92 protected:
93 InspectorApplicationCacheFactory(InstrumentingAgents*, InspectorCompositeSta te*, InspectorPageFactory*);
94 };
95
86 } // namespace WebCore 96 } // namespace WebCore
87 97
88 #endif // InspectorApplicationCacheAgent_h 98 #endif // InspectorApplicationCacheAgent_h
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorAgent.cpp ('k') | Source/core/inspector/InspectorApplicationCacheAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698