| OLD | NEW |
| 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 Loading... |
| 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 InspectorPageController; |
| 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 InspectorFileSystemController: public InspectorBaseController<InspectorFil
eSystemController, InspectorFileSystemAgent> { |
| 74 public: |
| 75 |
| 76 static PassOwnPtr<InspectorFileSystemController> create(InstrumentingAgents*
instrumentingAgents, InspectorCompositeState* compositeState, InspectorPageCont
roller* pageController) |
| 77 { |
| 78 return adoptPtr(new InspectorFileSystemController(instrumentingAgents, c
ompositeState, pageController)); |
| 79 } |
| 80 |
| 81 protected: |
| 82 InspectorFileSystemController(InstrumentingAgents*, InspectorCompositeState*
, InspectorPageController*); |
| 83 }; |
| 84 |
| 72 } // namespace WebCore | 85 } // namespace WebCore |
| 73 | 86 |
| 74 #endif // InspectorFileSystemAgent_h | 87 #endif // InspectorFileSystemAgent_h |
| OLD | NEW |