| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 InspectorDatabaseAgent::~InspectorDatabaseAgent() {} | 266 InspectorDatabaseAgent::~InspectorDatabaseAgent() {} |
| 267 | 267 |
| 268 Response InspectorDatabaseAgent::enable() { | 268 Response InspectorDatabaseAgent::enable() { |
| 269 if (m_enabled) | 269 if (m_enabled) |
| 270 return Response::OK(); | 270 return Response::OK(); |
| 271 m_enabled = true; | 271 m_enabled = true; |
| 272 m_state->setBoolean(DatabaseAgentState::databaseAgentEnabled, m_enabled); | 272 m_state->setBoolean(DatabaseAgentState::databaseAgentEnabled, m_enabled); |
| 273 if (DatabaseClient* client = DatabaseClient::fromPage(m_page)) | 273 if (DatabaseClient* client = DatabaseClient::fromPage(m_page)) |
| 274 client->setInspectorAgent(this); | 274 client->setInspectorAgent(this); |
| 275 DatabaseTracker::tracker().forEachOpenDatabaseInPage( | 275 DatabaseTracker::tracker().forEachOpenDatabaseInPage( |
| 276 m_page, WTF::bind(&InspectorDatabaseAgent::registerDatabaseOnCreation, | 276 m_page, |
| 277 wrapPersistent(this))); | 277 WTF::bind(&InspectorDatabaseAgent::registerDatabaseOnCreation, |
| 278 wrapPersistent(this))); |
| 278 return Response::OK(); | 279 return Response::OK(); |
| 279 } | 280 } |
| 280 | 281 |
| 281 Response InspectorDatabaseAgent::disable() { | 282 Response InspectorDatabaseAgent::disable() { |
| 282 if (!m_enabled) | 283 if (!m_enabled) |
| 283 return Response::OK(); | 284 return Response::OK(); |
| 284 m_enabled = false; | 285 m_enabled = false; |
| 285 m_state->setBoolean(DatabaseAgentState::databaseAgentEnabled, m_enabled); | 286 m_state->setBoolean(DatabaseAgentState::databaseAgentEnabled, m_enabled); |
| 286 if (DatabaseClient* client = DatabaseClient::fromPage(m_page)) | 287 if (DatabaseClient* client = DatabaseClient::fromPage(m_page)) |
| 287 client->setInspectorAgent(nullptr); | 288 client->setInspectorAgent(nullptr); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 return it->value->database(); | 362 return it->value->database(); |
| 362 } | 363 } |
| 363 | 364 |
| 364 DEFINE_TRACE(InspectorDatabaseAgent) { | 365 DEFINE_TRACE(InspectorDatabaseAgent) { |
| 365 visitor->trace(m_page); | 366 visitor->trace(m_page); |
| 366 visitor->trace(m_resources); | 367 visitor->trace(m_resources); |
| 367 InspectorBaseAgent::trace(visitor); | 368 InspectorBaseAgent::trace(visitor); |
| 368 } | 369 } |
| 369 | 370 |
| 370 } // namespace blink | 371 } // namespace blink |
| OLD | NEW |