| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 return; | 198 return; |
| 199 } | 199 } |
| 200 | 200 |
| 201 RefPtrWillBeRawPtr<InspectorDatabaseResource> resource = InspectorDatabaseRe
source::create(database, domain, name, version); | 201 RefPtrWillBeRawPtr<InspectorDatabaseResource> resource = InspectorDatabaseRe
source::create(database, domain, name, version); |
| 202 m_resources.set(resource->id(), resource); | 202 m_resources.set(resource->id(), resource); |
| 203 // Resources are only bound while visible. | 203 // Resources are only bound while visible. |
| 204 if (m_frontend && m_enabled) | 204 if (m_frontend && m_enabled) |
| 205 resource->bind(m_frontend); | 205 resource->bind(m_frontend); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void InspectorDatabaseAgent::didCommitLoad(LocalFrame* frame, DocumentLoader* lo
ader) | 208 void InspectorDatabaseAgent::didCommitLoadForMainFrame() |
| 209 { | 209 { |
| 210 // FIXME: If "frame" is always guarenteed to be in the same Page as loader->
frame() | |
| 211 // then all we need to check here is loader->frame()->isMainFrame() | |
| 212 // and we don't need "frame" at all. | |
| 213 if (loader->frame() != frame->page()->mainFrame()) | |
| 214 return; | |
| 215 | |
| 216 m_resources.clear(); | 210 m_resources.clear(); |
| 217 } | 211 } |
| 218 | 212 |
| 219 InspectorDatabaseAgent::InspectorDatabaseAgent() | 213 InspectorDatabaseAgent::InspectorDatabaseAgent() |
| 220 : InspectorBaseAgent<InspectorDatabaseAgent>("Database") | 214 : InspectorBaseAgent<InspectorDatabaseAgent>("Database") |
| 221 , m_frontend(0) | 215 , m_frontend(0) |
| 222 , m_enabled(false) | 216 , m_enabled(false) |
| 223 { | 217 { |
| 224 } | 218 } |
| 225 | 219 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 | 307 |
| 314 Database* InspectorDatabaseAgent::databaseForId(const String& databaseId) | 308 Database* InspectorDatabaseAgent::databaseForId(const String& databaseId) |
| 315 { | 309 { |
| 316 DatabaseResourcesHeapMap::iterator it = m_resources.find(databaseId); | 310 DatabaseResourcesHeapMap::iterator it = m_resources.find(databaseId); |
| 317 if (it == m_resources.end()) | 311 if (it == m_resources.end()) |
| 318 return 0; | 312 return 0; |
| 319 return it->value->database(); | 313 return it->value->database(); |
| 320 } | 314 } |
| 321 | 315 |
| 322 } // namespace WebCore | 316 } // namespace WebCore |
| OLD | NEW |