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 28 matching lines...) Expand all Loading... |
39 | 39 |
40 class Database; | 40 class Database; |
41 class DocumentLoader; | 41 class DocumentLoader; |
42 class Frame; | 42 class Frame; |
43 class InspectorDatabaseResource; | 43 class InspectorDatabaseResource; |
44 class InspectorFrontend; | 44 class InspectorFrontend; |
45 class InstrumentingAgents; | 45 class InstrumentingAgents; |
46 | 46 |
47 typedef String ErrorString; | 47 typedef String ErrorString; |
48 | 48 |
49 class InspectorDatabaseAgent : public InspectorBaseAgent<InspectorDatabaseAgent>
, public InspectorBackendDispatcher::DatabaseCommandHandler { | 49 class InspectorDatabaseAgent FINAL : public InspectorBaseAgent<InspectorDatabase
Agent>, public InspectorBackendDispatcher::DatabaseCommandHandler { |
50 public: | 50 public: |
51 static PassOwnPtr<InspectorDatabaseAgent> create(InstrumentingAgents* instru
mentingAgents, InspectorCompositeState* state) | 51 static PassOwnPtr<InspectorDatabaseAgent> create(InstrumentingAgents* instru
mentingAgents, InspectorCompositeState* state) |
52 { | 52 { |
53 return adoptPtr(new InspectorDatabaseAgent(instrumentingAgents, state)); | 53 return adoptPtr(new InspectorDatabaseAgent(instrumentingAgents, state)); |
54 } | 54 } |
55 ~InspectorDatabaseAgent(); | 55 virtual ~InspectorDatabaseAgent(); |
56 | 56 |
57 virtual void setFrontend(InspectorFrontend*); | 57 virtual void setFrontend(InspectorFrontend*) OVERRIDE; |
58 virtual void clearFrontend(); | 58 virtual void clearFrontend() OVERRIDE; |
59 virtual void restore(); | 59 virtual void restore() OVERRIDE; |
60 | 60 |
61 void didCommitLoad(Frame*, DocumentLoader*); | 61 void didCommitLoad(Frame*, DocumentLoader*); |
62 | 62 |
63 // Called from the front-end. | 63 // Called from the front-end. |
64 virtual void enable(ErrorString*); | 64 virtual void enable(ErrorString*) OVERRIDE; |
65 virtual void disable(ErrorString*); | 65 virtual void disable(ErrorString*) OVERRIDE; |
66 virtual void getDatabaseTableNames(ErrorString*, const String& databaseId, R
efPtr<TypeBuilder::Array<String> >& names); | 66 virtual void getDatabaseTableNames(ErrorString*, const String& databaseId, R
efPtr<TypeBuilder::Array<String> >& names) OVERRIDE; |
67 virtual void executeSQL(ErrorString*, const String& databaseId, const String
& query, PassRefPtr<ExecuteSQLCallback>); | 67 virtual void executeSQL(ErrorString*, const String& databaseId, const String
& query, PassRefPtr<ExecuteSQLCallback>) OVERRIDE; |
68 | 68 |
69 // Called from the injected script. | 69 // Called from the injected script. |
70 String databaseId(Database*); | 70 String databaseId(Database*); |
71 | 71 |
72 void didOpenDatabase(PassRefPtr<Database>, const String& domain, const Strin
g& name, const String& version); | 72 void didOpenDatabase(PassRefPtr<Database>, const String& domain, const Strin
g& name, const String& version); |
73 private: | 73 private: |
74 explicit InspectorDatabaseAgent(InstrumentingAgents*, InspectorCompositeStat
e*); | 74 explicit InspectorDatabaseAgent(InstrumentingAgents*, InspectorCompositeStat
e*); |
75 | 75 |
76 Database* databaseForId(const String& databaseId); | 76 Database* databaseForId(const String& databaseId); |
77 InspectorDatabaseResource* findByFileName(const String& fileName); | 77 InspectorDatabaseResource* findByFileName(const String& fileName); |
78 | 78 |
79 InspectorFrontend::Database* m_frontend; | 79 InspectorFrontend::Database* m_frontend; |
80 typedef HashMap<String, RefPtr<InspectorDatabaseResource> > DatabaseResource
sMap; | 80 typedef HashMap<String, RefPtr<InspectorDatabaseResource> > DatabaseResource
sMap; |
81 DatabaseResourcesMap m_resources; | 81 DatabaseResourcesMap m_resources; |
82 bool m_enabled; | 82 bool m_enabled; |
83 }; | 83 }; |
84 | 84 |
85 } // namespace WebCore | 85 } // namespace WebCore |
86 | 86 |
87 #endif // !defined(InspectorDatabaseAgent_h) | 87 #endif // !defined(InspectorDatabaseAgent_h) |
OLD | NEW |