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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 RefPtr<InspectorDatabaseResource> resource = InspectorDatabaseResource::crea
te(database, domain, name, version); | 202 RefPtr<InspectorDatabaseResource> resource = InspectorDatabaseResource::crea
te(database, domain, name, version); |
203 m_resources.set(resource->id(), resource); | 203 m_resources.set(resource->id(), resource); |
204 // Resources are only bound while visible. | 204 // Resources are only bound while visible. |
205 if (m_frontend && m_enabled) | 205 if (m_frontend && m_enabled) |
206 resource->bind(m_frontend); | 206 resource->bind(m_frontend); |
207 } | 207 } |
208 | 208 |
209 void InspectorDatabaseAgent::didCommitLoad(Frame* frame, DocumentLoader* loader) | 209 void InspectorDatabaseAgent::didCommitLoad(Frame* frame, DocumentLoader* loader) |
210 { | 210 { |
| 211 // FIXME: If "frame" is always guarenteed to be in the same Page as loader->
frame() |
| 212 // then all we need to check here is loader->frame()->isMainFrame() |
| 213 // and we don't need "frame" at all. |
211 if (loader->frame() != frame->page()->mainFrame()) | 214 if (loader->frame() != frame->page()->mainFrame()) |
212 return; | 215 return; |
213 | 216 |
214 m_resources.clear(); | 217 m_resources.clear(); |
215 } | 218 } |
216 | 219 |
217 InspectorDatabaseAgent::InspectorDatabaseAgent(InstrumentingAgents* instrumentin
gAgents, InspectorCompositeState* state) | 220 InspectorDatabaseAgent::InspectorDatabaseAgent(InstrumentingAgents* instrumentin
gAgents, InspectorCompositeState* state) |
218 : InspectorBaseAgent<InspectorDatabaseAgent>("Database", instrumentingAgents
, state) | 221 : InspectorBaseAgent<InspectorDatabaseAgent>("Database", instrumentingAgents
, state) |
219 , m_frontend(0) | 222 , m_frontend(0) |
220 , m_enabled(false) | 223 , m_enabled(false) |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 | 325 |
323 Database* InspectorDatabaseAgent::databaseForId(const String& databaseId) | 326 Database* InspectorDatabaseAgent::databaseForId(const String& databaseId) |
324 { | 327 { |
325 DatabaseResourcesMap::iterator it = m_resources.find(databaseId); | 328 DatabaseResourcesMap::iterator it = m_resources.find(databaseId); |
326 if (it == m_resources.end()) | 329 if (it == m_resources.end()) |
327 return 0; | 330 return 0; |
328 return it->value->database(); | 331 return it->value->database(); |
329 } | 332 } |
330 | 333 |
331 } // namespace WebCore | 334 } // namespace WebCore |
OLD | NEW |