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

Side by Side Diff: Source/core/inspector/InspectorFileSystemAgent.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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 22 matching lines...) Expand all
33 33
34 #include "core/inspector/InspectorBaseAgent.h" 34 #include "core/inspector/InspectorBaseAgent.h"
35 35
36 #include <wtf/PassOwnPtr.h> 36 #include <wtf/PassOwnPtr.h>
37 #include <wtf/PassRefPtr.h> 37 #include <wtf/PassRefPtr.h>
38 38
39 namespace WebCore { 39 namespace WebCore {
40 40
41 class InspectorFrontend; 41 class InspectorFrontend;
42 class InspectorPageAgent; 42 class InspectorPageAgent;
43 class InspectorPageFactory;
43 class ScriptExecutionContext; 44 class ScriptExecutionContext;
44 class SecurityOrigin; 45 class SecurityOrigin;
45 46
46 class InspectorFileSystemAgent : public InspectorBaseAgent<InspectorFileSystemAg ent>, public InspectorBackendDispatcher::FileSystemCommandHandler { 47 class InspectorFileSystemAgent : public InspectorBaseAgent, public InspectorBack endDispatcher::FileSystemCommandHandler {
47 public: 48 public:
48 static PassOwnPtr<InspectorFileSystemAgent> create(InstrumentingAgents*, Ins pectorPageAgent*, InspectorCompositeState*); 49 static PassRefPtr<InspectorFileSystemAgent> create(InstrumentingAgents*, Ins pectorState*, PassRefPtr<InspectorPageAgent>);
49 virtual ~InspectorFileSystemAgent(); 50 virtual ~InspectorFileSystemAgent();
50 51
51 virtual void enable(ErrorString*) OVERRIDE; 52 virtual void enable(ErrorString*) OVERRIDE;
52 virtual void disable(ErrorString*) OVERRIDE; 53 virtual void disable(ErrorString*) OVERRIDE;
53 54
54 virtual void requestFileSystemRoot(ErrorString*, const String& origin, const String& typeString, PassRefPtr<RequestFileSystemRootCallback>) OVERRIDE; 55 virtual void requestFileSystemRoot(ErrorString*, const String& origin, const String& typeString, PassRefPtr<RequestFileSystemRootCallback>) OVERRIDE;
55 virtual void requestDirectoryContent(ErrorString*, const String& url, PassRe fPtr<RequestDirectoryContentCallback>) OVERRIDE; 56 virtual void requestDirectoryContent(ErrorString*, const String& url, PassRe fPtr<RequestDirectoryContentCallback>) OVERRIDE;
56 virtual void requestMetadata(ErrorString*, const String& url, PassRefPtr<Req uestMetadataCallback>) OVERRIDE; 57 virtual void requestMetadata(ErrorString*, const String& url, PassRefPtr<Req uestMetadataCallback>) OVERRIDE;
57 virtual void requestFileContent(ErrorString*, const String& url, bool readAs Text, const int* start, const int* end, const String* charset, PassRefPtr<Reques tFileContentCallback>) OVERRIDE; 58 virtual void requestFileContent(ErrorString*, const String& url, bool readAs Text, const int* start, const int* end, const String* charset, PassRefPtr<Reques tFileContentCallback>) OVERRIDE;
58 virtual void deleteEntry(ErrorString*, const String& url, PassRefPtr<DeleteE ntryCallback>) OVERRIDE; 59 virtual void deleteEntry(ErrorString*, const String& url, PassRefPtr<DeleteE ntryCallback>) OVERRIDE;
59 60
60 virtual void clearFrontend() OVERRIDE; 61 virtual void clearFrontend() OVERRIDE;
61 virtual void restore() OVERRIDE; 62 virtual void restore() OVERRIDE;
62 63
63 private: 64 private:
64 InspectorFileSystemAgent(InstrumentingAgents*, InspectorPageAgent*, Inspecto rCompositeState*); 65 InspectorFileSystemAgent(InstrumentingAgents*, InspectorState*, PassRefPtr<I nspectorPageAgent>);
65 bool assertEnabled(ErrorString*); 66 bool assertEnabled(ErrorString*);
66 ScriptExecutionContext* assertScriptExecutionContextForOrigin(ErrorString*, SecurityOrigin*); 67 ScriptExecutionContext* assertScriptExecutionContextForOrigin(ErrorString*, SecurityOrigin*);
67 68
68 InspectorPageAgent* m_pageAgent; 69 RefPtr<InspectorPageAgent> m_pageAgent;
69 bool m_enabled; 70 bool m_enabled;
70 }; 71 };
71 72
73 class InspectorFileSystemFactory : public InspectorBaseFactory<InspectorFileSyst emFactory, InspectorFileSystemAgent> {
74 public:
75
76 static PassOwnPtr<InspectorFileSystemFactory> create(InstrumentingAgents* in strumentingAgents, InspectorCompositeState* compositeState, InspectorPageFactory * pageFactory)
77 {
78 return adoptPtr(new InspectorFileSystemFactory(instrumentingAgents, comp ositeState, pageFactory));
79 }
80
81 protected:
82 InspectorFileSystemFactory(InstrumentingAgents*, InspectorCompositeState*, I nspectorPageFactory*);
83 };
84
72 } // namespace WebCore 85 } // namespace WebCore
73 86
74 #endif // InspectorFileSystemAgent_h 87 #endif // InspectorFileSystemAgent_h
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorDebuggerAgent.cpp ('k') | Source/core/inspector/InspectorFileSystemAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698