Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: WebCore/inspector/InspectorController.cpp

Issue 3389017: Merge 67623 - 2010-09-16 Yury Semikhatsky <yurys@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « WebCore/inspector/InspectorController.h ('k') | WebKit/chromium/src/WebDevToolsAgentImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 493
494 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 494 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
495 m_applicationCacheAgent = new InspectorApplicationCacheAgent(this, m_fronten d.get()); 495 m_applicationCacheAgent = new InspectorApplicationCacheAgent(this, m_fronten d.get());
496 #endif 496 #endif
497 497
498 if (!connectedFrontendCount) 498 if (!connectedFrontendCount)
499 ScriptController::setCaptureCallStackForUncaughtExceptions(true); 499 ScriptController::setCaptureCallStackForUncaughtExceptions(true);
500 connectedFrontendCount++; 500 connectedFrontendCount++;
501 } 501 }
502 502
503 void InspectorController::reuseFrontend()
504 {
505 connectFrontend();
506 restoreDebugger();
507 restoreProfiler();
508 }
509
503 void InspectorController::show() 510 void InspectorController::show()
504 { 511 {
505 if (!enabled()) 512 if (!enabled())
506 return; 513 return;
507 514
508 if (m_openingFrontend) 515 if (m_openingFrontend)
509 return; 516 return;
510 517
511 if (m_frontend) 518 if (m_frontend)
512 m_frontend->bringToFront(); 519 m_frontend->bringToFront();
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 InspectorWorkerResource* worker = it->second.get(); 663 InspectorWorkerResource* worker = it->second.get();
657 m_frontend->didCreateWorker(worker->id(), worker->url(), worker->isShare dWorker()); 664 m_frontend->didCreateWorker(worker->id(), worker->url(), worker->isShare dWorker());
658 } 665 }
659 #endif 666 #endif
660 667
661 // Dispatch pending frontend commands 668 // Dispatch pending frontend commands
662 for (Vector<pair<long, String> >::iterator it = m_pendingEvaluateTestCommand s.begin(); it != m_pendingEvaluateTestCommands.end(); ++it) 669 for (Vector<pair<long, String> >::iterator it = m_pendingEvaluateTestCommand s.begin(); it != m_pendingEvaluateTestCommands.end(); ++it)
663 m_frontend->evaluateForTestInFrontend((*it).first, (*it).second); 670 m_frontend->evaluateForTestInFrontend((*it).first, (*it).second);
664 m_pendingEvaluateTestCommands.clear(); 671 m_pendingEvaluateTestCommands.clear();
665 672
673 restoreDebugger();
674 restoreProfiler();
675 }
676
677 void InspectorController::restoreDebugger()
678 {
679 ASSERT(m_frontend);
666 #if ENABLE(JAVASCRIPT_DEBUGGER) 680 #if ENABLE(JAVASCRIPT_DEBUGGER)
667 if (InspectorDebuggerAgent::isDebuggerAlwaysEnabled()) 681 if (InspectorDebuggerAgent::isDebuggerAlwaysEnabled())
668 enableDebuggerFromFrontend(false); 682 enableDebuggerFromFrontend(false);
669 else { 683 else {
670 String debuggerEnabled = setting(debuggerEnabledSettingName); 684 String debuggerEnabled = setting(debuggerEnabledSettingName);
671 if (debuggerEnabled == "true" || m_attachDebuggerWhenShown) 685 if (debuggerEnabled == "true" || m_attachDebuggerWhenShown)
672 enableDebugger(); 686 enableDebugger();
673 } 687 }
688 #endif
689 }
690
691 void InspectorController::restoreProfiler()
692 {
693 ASSERT(m_frontend);
694 #if ENABLE(JAVASCRIPT_DEBUGGER)
674 m_profilerAgent->setFrontend(m_frontend.get()); 695 m_profilerAgent->setFrontend(m_frontend.get());
675 if (!ScriptProfiler::isProfilerAlwaysEnabled()) { 696 if (!ScriptProfiler::isProfilerAlwaysEnabled()) {
676 String profilerEnabledSetting = setting(profilerEnabledSettingName); 697 String profilerEnabledSetting = setting(profilerEnabledSettingName);
677 if (profilerEnabledSetting == "true") 698 if (profilerEnabledSetting == "true")
678 enableProfiler(); 699 enableProfiler();
679 } 700 }
680 #endif 701 #endif
681 } 702 }
682 703
683 void InspectorController::unbindAllResources() 704 void InspectorController::unbindAllResources()
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
1553 1574
1554 if (m_frontend) 1575 if (m_frontend)
1555 m_frontend->debuggerWasDisabled(); 1576 m_frontend->debuggerWasDisabled();
1556 } 1577 }
1557 1578
1558 void InspectorController::resume() 1579 void InspectorController::resume()
1559 { 1580 {
1560 if (m_debuggerAgent) 1581 if (m_debuggerAgent)
1561 m_debuggerAgent->resume(); 1582 m_debuggerAgent->resume();
1562 } 1583 }
1563 // JavaScriptDebugListener functions
1564 1584
1565 #endif 1585 #endif
1566 1586
1567 void InspectorController::evaluateForTestInFrontend(long callId, const String& s cript) 1587 void InspectorController::evaluateForTestInFrontend(long callId, const String& s cript)
1568 { 1588 {
1569 if (m_frontend) 1589 if (m_frontend)
1570 m_frontend->evaluateForTestInFrontend(callId, script); 1590 m_frontend->evaluateForTestInFrontend(callId, script);
1571 else 1591 else
1572 m_pendingEvaluateTestCommands.append(pair<long, String>(callId, script)) ; 1592 m_pendingEvaluateTestCommands.append(pair<long, String>(callId, script)) ;
1573 } 1593 }
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1895 void InspectorController::didModifyDOMAttrImpl(Element* element) 1915 void InspectorController::didModifyDOMAttrImpl(Element* element)
1896 { 1916 {
1897 if (m_domAgent) 1917 if (m_domAgent)
1898 m_domAgent->didModifyDOMAttr(element); 1918 m_domAgent->didModifyDOMAttr(element);
1899 } 1919 }
1900 1920
1901 1921
1902 } // namespace WebCore 1922 } // namespace WebCore
1903 1923
1904 #endif // ENABLE(INSPECTOR) 1924 #endif // ENABLE(INSPECTOR)
OLDNEW
« no previous file with comments | « WebCore/inspector/InspectorController.h ('k') | WebKit/chromium/src/WebDevToolsAgentImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698