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

Side by Side Diff: Source/core/inspector/InspectorIndexedDBAgent.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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 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 21 matching lines...) Expand all
32 #define InspectorIndexedDBAgent_h 32 #define InspectorIndexedDBAgent_h
33 33
34 #include "core/inspector/InspectorBaseAgent.h" 34 #include "core/inspector/InspectorBaseAgent.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 InjectedScriptManager; 40 class InjectedScriptManager;
41 class InspectorPageAgent; 41 class InspectorPageAgent;
42 class InspectorPageFactory;
42 43
43 typedef String ErrorString; 44 typedef String ErrorString;
44 45
45 class InspectorIndexedDBAgent : public InspectorBaseAgent<InspectorIndexedDBAgen t>, public InspectorBackendDispatcher::IndexedDBCommandHandler { 46 class InspectorIndexedDBAgent : public InspectorBaseAgent, public InspectorBacke ndDispatcher::IndexedDBCommandHandler {
46 public: 47 public:
47 static PassOwnPtr<InspectorIndexedDBAgent> create(InstrumentingAgents* instr umentingAgents, InspectorCompositeState* state, InjectedScriptManager* injectedS criptManager, InspectorPageAgent* pageAgent) 48 static PassRefPtr<InspectorIndexedDBAgent> create(InstrumentingAgents*, Insp ectorState*, PassRefPtr<InspectorPageAgent>, InjectedScriptManager*);
48 { 49 virtual ~InspectorIndexedDBAgent();
49 return adoptPtr(new InspectorIndexedDBAgent(instrumentingAgents, state, injectedScriptManager, pageAgent));
50 }
51 ~InspectorIndexedDBAgent();
52 50
53 virtual void clearFrontend(); 51 virtual void clearFrontend();
54 virtual void restore(); 52 virtual void restore();
55 53
56 // Called from the front-end. 54 // Called from the front-end.
57 virtual void enable(ErrorString*); 55 virtual void enable(ErrorString*);
58 virtual void disable(ErrorString*); 56 virtual void disable(ErrorString*);
59 virtual void requestDatabaseNames(ErrorString*, const String& securityOrigin , PassRefPtr<RequestDatabaseNamesCallback>); 57 virtual void requestDatabaseNames(ErrorString*, const String& securityOrigin , PassRefPtr<RequestDatabaseNamesCallback>);
60 virtual void requestDatabase(ErrorString*, const String& securityOrigin, con st String& databaseName, PassRefPtr<RequestDatabaseCallback>); 58 virtual void requestDatabase(ErrorString*, const String& securityOrigin, con st String& databaseName, PassRefPtr<RequestDatabaseCallback>);
61 virtual void requestData(ErrorString*, const String& securityOrigin, const S tring& databaseName, const String& objectStoreName, const String& indexName, int skipCount, int pageSize, const RefPtr<InspectorObject>* keyRange, PassRefPtr<Re questDataCallback>); 59 virtual void requestData(ErrorString*, const String& securityOrigin, const S tring& databaseName, const String& objectStoreName, const String& indexName, int skipCount, int pageSize, const RefPtr<InspectorObject>* keyRange, PassRefPtr<Re questDataCallback>);
62 virtual void clearObjectStore(ErrorString*, const String& in_securityOrigin, const String& in_databaseName, const String& in_objectStoreName, PassRefPtr<Cle arObjectStoreCallback>); 60 virtual void clearObjectStore(ErrorString*, const String& in_securityOrigin, const String& in_databaseName, const String& in_objectStoreName, PassRefPtr<Cle arObjectStoreCallback>);
63 61
64 private: 62 private:
65 InspectorIndexedDBAgent(InstrumentingAgents*, InspectorCompositeState*, Inje ctedScriptManager*, InspectorPageAgent*); 63 InspectorIndexedDBAgent(InstrumentingAgents*, InspectorState*, PassRefPtr<In spectorPageAgent>, InjectedScriptManager*);
66 64
67 InjectedScriptManager* m_injectedScriptManager; 65 InjectedScriptManager* m_injectedScriptManager;
68 InspectorPageAgent* m_pageAgent; 66 RefPtr<InspectorPageAgent> m_pageAgent;
67 };
68
69 class InspectorIndexedDBFactory : public InspectorBaseFactory<InspectorIndexedDB Factory, InspectorIndexedDBAgent> {
70 public:
71
72 static PassOwnPtr<InspectorIndexedDBFactory> create(InstrumentingAgents* ins trumentingAgents, InspectorCompositeState* compositeState, InspectorPageFactory* pageFactory, InjectedScriptManager* injectedScriptManager)
73 {
74 return adoptPtr(new InspectorIndexedDBFactory(instrumentingAgents, compo siteState, pageFactory, injectedScriptManager));
75 }
76
77 protected:
78 InspectorIndexedDBFactory(InstrumentingAgents*, InspectorCompositeState*, In spectorPageFactory*, InjectedScriptManager*);
69 }; 79 };
70 80
71 } // namespace WebCore 81 } // namespace WebCore
72 82
73 #endif // !defined(InspectorIndexedDBAgent_h) 83 #endif // !defined(InspectorIndexedDBAgent_h)
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorHeapProfilerAgent.cpp ('k') | Source/core/inspector/InspectorIndexedDBAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698