OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include <wtf/HashMap.h> | 34 #include <wtf/HashMap.h> |
35 #include <wtf/PassOwnPtr.h> | 35 #include <wtf/PassOwnPtr.h> |
36 #include <wtf/text/WTFString.h> | 36 #include <wtf/text/WTFString.h> |
37 | 37 |
38 namespace WebCore { | 38 namespace WebCore { |
39 | 39 |
40 class Frame; | 40 class Frame; |
41 class InspectorArray; | 41 class InspectorArray; |
42 class InspectorFrontend; | 42 class InspectorFrontend; |
43 class InspectorPageAgent; | 43 class InspectorPageAgent; |
| 44 class InspectorPageFactory; |
44 class InspectorState; | 45 class InspectorState; |
45 class InstrumentingAgents; | 46 class InstrumentingAgents; |
46 class Page; | 47 class Page; |
47 class Storage; | 48 class Storage; |
48 class StorageArea; | 49 class StorageArea; |
49 | 50 |
50 typedef String ErrorString; | 51 typedef String ErrorString; |
51 | 52 |
52 class InspectorDOMStorageAgent : public InspectorBaseAgent<InspectorDOMStorageAg
ent>, public InspectorBackendDispatcher::DOMStorageCommandHandler { | 53 class InspectorDOMStorageAgent : public InspectorBaseAgent, public InspectorBack
endDispatcher::DOMStorageCommandHandler { |
53 public: | 54 public: |
54 static PassOwnPtr<InspectorDOMStorageAgent> create(InstrumentingAgents* inst
rumentingAgents, InspectorPageAgent* pageAgent, InspectorCompositeState* state) | 55 static PassRefPtr<InspectorDOMStorageAgent> create(InstrumentingAgents*, Ins
pectorState*, PassRefPtr<InspectorPageAgent>); |
55 { | 56 virtual ~InspectorDOMStorageAgent(); |
56 return adoptPtr(new InspectorDOMStorageAgent(instrumentingAgents, pageAg
ent, state)); | |
57 } | |
58 ~InspectorDOMStorageAgent(); | |
59 | 57 |
60 virtual void setFrontend(InspectorFrontend*); | 58 virtual void setFrontend(InspectorFrontend*); |
61 virtual void clearFrontend(); | 59 virtual void clearFrontend(); |
62 | 60 |
63 // Called from the front-end. | 61 // Called from the front-end. |
64 virtual void enable(ErrorString*); | 62 virtual void enable(ErrorString*); |
65 virtual void disable(ErrorString*); | 63 virtual void disable(ErrorString*); |
66 virtual void getDOMStorageItems(ErrorString*, const RefPtr<InspectorObject>&
storageId, RefPtr<TypeBuilder::Array<TypeBuilder::Array<String> > >& items); | 64 virtual void getDOMStorageItems(ErrorString*, const RefPtr<InspectorObject>&
storageId, RefPtr<TypeBuilder::Array<TypeBuilder::Array<String> > >& items); |
67 virtual void setDOMStorageItem(ErrorString*, const RefPtr<InspectorObject>&
storageId, const String& key, const String& value); | 65 virtual void setDOMStorageItem(ErrorString*, const RefPtr<InspectorObject>&
storageId, const String& key, const String& value); |
68 virtual void removeDOMStorageItem(ErrorString*, const RefPtr<InspectorObject
>& storageId, const String& key); | 66 virtual void removeDOMStorageItem(ErrorString*, const RefPtr<InspectorObject
>& storageId, const String& key); |
69 | 67 |
70 // Called from the injected script. | 68 // Called from the injected script. |
71 String storageId(Storage*); | 69 String storageId(Storage*); |
72 PassRefPtr<TypeBuilder::DOMStorage::StorageId> storageId(SecurityOrigin*, bo
ol isLocalStorage); | 70 PassRefPtr<TypeBuilder::DOMStorage::StorageId> storageId(SecurityOrigin*, bo
ol isLocalStorage); |
73 | 71 |
74 // Called from InspectorInstrumentation | 72 // Called from InspectorInstrumentation |
75 void didDispatchDOMStorageEvent(const String& key, const String& oldValue, c
onst String& newValue, StorageType, SecurityOrigin*); | 73 void didDispatchDOMStorageEvent(const String& key, const String& oldValue, c
onst String& newValue, StorageType, SecurityOrigin*); |
76 | 74 |
77 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; | 75 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; |
78 | 76 |
79 private: | 77 private: |
80 | 78 |
81 InspectorDOMStorageAgent(InstrumentingAgents*, InspectorPageAgent*, Inspecto
rCompositeState*); | 79 InspectorDOMStorageAgent(InstrumentingAgents*, InspectorState*, PassRefPtr<I
nspectorPageAgent>); |
82 | 80 |
83 bool isEnabled() const; | 81 bool isEnabled() const; |
84 PassRefPtr<StorageArea> findStorageArea(ErrorString*, const RefPtr<Inspector
Object>&, Frame*&); | 82 PassRefPtr<StorageArea> findStorageArea(ErrorString*, const RefPtr<Inspector
Object>&, Frame*&); |
85 | 83 |
86 InspectorPageAgent* m_pageAgent; | 84 RefPtr<InspectorPageAgent> m_pageAgent; |
87 InspectorFrontend* m_frontend; | 85 InspectorFrontend* m_frontend; |
88 }; | 86 }; |
89 | 87 |
| 88 class InspectorDOMStorageFactory : public InspectorBaseFactory<InspectorDOMStora
geFactory, InspectorDOMStorageAgent> { |
| 89 public: |
| 90 |
| 91 static PassOwnPtr<InspectorDOMStorageFactory> create(InstrumentingAgents* in
strumentingAgents, InspectorCompositeState* compositeState, InspectorPageFactory
* pageFactory) |
| 92 { |
| 93 return adoptPtr(new InspectorDOMStorageFactory(instrumentingAgents, comp
ositeState, pageFactory)); |
| 94 } |
| 95 |
| 96 protected: |
| 97 InspectorDOMStorageFactory(InstrumentingAgents*, InspectorCompositeState*, I
nspectorPageFactory*); |
| 98 }; |
| 99 |
90 } // namespace WebCore | 100 } // namespace WebCore |
91 | 101 |
92 #endif // !defined(InspectorDOMStorageAgent_h) | 102 #endif // !defined(InspectorDOMStorageAgent_h) |
OLD | NEW |