| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 updateViewMetricsFromState(); | 473 updateViewMetricsFromState(); |
| 474 updateTouchEventEmulationInPage(m_state->getBoolean(PageAgentState::touc
hEventEmulationEnabled)); | 474 updateTouchEventEmulationInPage(m_state->getBoolean(PageAgentState::touc
hEventEmulationEnabled)); |
| 475 } | 475 } |
| 476 } | 476 } |
| 477 | 477 |
| 478 void InspectorPageAgent::enable(ErrorString*) | 478 void InspectorPageAgent::enable(ErrorString*) |
| 479 { | 479 { |
| 480 m_enabled = true; | 480 m_enabled = true; |
| 481 m_state->setBoolean(PageAgentState::pageAgentEnabled, true); | 481 m_state->setBoolean(PageAgentState::pageAgentEnabled, true); |
| 482 m_instrumentingAgents->setInspectorPageAgent(this); | 482 m_instrumentingAgents->setInspectorPageAgent(this); |
| 483 m_inspectorResourceContentLoader = adoptPtr(new InspectorResourceContentLoad
er(m_page)); | 483 m_inspectorResourceContentLoader = adoptPtrWillBeNoop(new InspectorResourceC
ontentLoader(m_page)); |
| 484 } |
| 485 |
| 486 void InspectorPageAgent::dispose() |
| 487 { |
| 488 if (!m_inspectorResourceContentLoader) |
| 489 return; |
| 490 m_inspectorResourceContentLoader->dispose(); |
| 491 m_inspectorResourceContentLoader.clear(); |
| 484 } | 492 } |
| 485 | 493 |
| 486 void InspectorPageAgent::disable(ErrorString*) | 494 void InspectorPageAgent::disable(ErrorString*) |
| 487 { | 495 { |
| 488 m_enabled = false; | 496 m_enabled = false; |
| 489 m_state->setBoolean(PageAgentState::pageAgentEnabled, false); | 497 m_state->setBoolean(PageAgentState::pageAgentEnabled, false); |
| 490 m_state->remove(PageAgentState::pageAgentScriptsToEvaluateOnLoad); | 498 m_state->remove(PageAgentState::pageAgentScriptsToEvaluateOnLoad); |
| 491 m_overlay->hide(); | 499 m_overlay->hide(); |
| 492 m_instrumentingAgents->setInspectorPageAgent(0); | 500 m_instrumentingAgents->setInspectorPageAgent(0); |
| 493 m_inspectorResourceContentLoader.clear(); | 501 if (m_inspectorResourceContentLoader) { |
| 502 m_inspectorResourceContentLoader->dispose(); |
| 503 m_inspectorResourceContentLoader.clear(); |
| 504 } |
| 494 m_deviceMetricsOverridden = false; | 505 m_deviceMetricsOverridden = false; |
| 495 | 506 |
| 496 setShowPaintRects(0, false); | 507 setShowPaintRects(0, false); |
| 497 setShowDebugBorders(0, false); | 508 setShowDebugBorders(0, false); |
| 498 setShowFPSCounter(0, false); | 509 setShowFPSCounter(0, false); |
| 499 setEmulatedMedia(0, String()); | 510 setEmulatedMedia(0, String()); |
| 500 if (m_state->getBoolean(PageAgentState::pageAgentContinuousPaintingEnabled)) | 511 if (m_state->getBoolean(PageAgentState::pageAgentContinuousPaintingEnabled)) |
| 501 setContinuousPaintingEnabled(0, false); | 512 setContinuousPaintingEnabled(0, false); |
| 502 setShowScrollBottleneckRects(0, false); | 513 setShowScrollBottleneckRects(0, false); |
| 503 setShowViewportSizeOnResize(0, false, 0); | 514 setShowViewportSizeOnResize(0, false, 0); |
| (...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1442 if (!m_editedResourceContent.contains(url)) | 1453 if (!m_editedResourceContent.contains(url)) |
| 1443 return false; | 1454 return false; |
| 1444 *content = m_editedResourceContent.get(url); | 1455 *content = m_editedResourceContent.get(url); |
| 1445 return true; | 1456 return true; |
| 1446 } | 1457 } |
| 1447 | 1458 |
| 1448 void InspectorPageAgent::trace(Visitor* visitor) | 1459 void InspectorPageAgent::trace(Visitor* visitor) |
| 1449 { | 1460 { |
| 1450 visitor->trace(m_page); | 1461 visitor->trace(m_page); |
| 1451 visitor->trace(m_injectedScriptManager); | 1462 visitor->trace(m_injectedScriptManager); |
| 1463 visitor->trace(m_inspectorResourceContentLoader); |
| 1452 InspectorBaseAgent::trace(visitor); | 1464 InspectorBaseAgent::trace(visitor); |
| 1453 } | 1465 } |
| 1454 | 1466 |
| 1455 } // namespace blink | 1467 } // namespace blink |
| 1456 | 1468 |
| OLD | NEW |