diff options
Diffstat (limited to 'WebCore/inspector/InspectorController.cpp')
| -rw-r--r-- | WebCore/inspector/InspectorController.cpp | 355 | 
1 files changed, 166 insertions, 189 deletions
| diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp index 170c4e3..c3351e5 100644 --- a/WebCore/inspector/InspectorController.cpp +++ b/WebCore/inspector/InspectorController.cpp @@ -47,9 +47,11 @@  #include "GraphicsContext.h"  #include "HTMLFrameOwnerElement.h"  #include "HitTestResult.h" +#include "InspectorBackend.h"  #include "InspectorClient.h"  #include "InspectorFrontend.h"  #include "InspectorDatabaseResource.h" +#include "InspectorDOMAgent.h"  #include "InspectorDOMStorageResource.h"  #include "InspectorResource.h"  #include "JavaScriptProfile.h" @@ -99,65 +101,12 @@ static const char* const UserInitiatedProfileName = "org.webkit.profiles.user-in  static const char* const resourceTrackingEnabledSettingName = "resourceTrackingEnabled";  static const char* const debuggerEnabledSettingName = "debuggerEnabled";  static const char* const profilerEnabledSettingName = "profilerEnabled"; +static const char* const inspectorAttachedHeightName = "inspectorAttachedHeight"; +static const char* const lastActivePanelSettingName = "lastActivePanel"; -bool InspectorController::addSourceToFrame(const String& mimeType, const String& source, Node* frameNode) -{ -    ASSERT_ARG(frameNode, frameNode); - -    if (!frameNode) -        return false; - -    if (!frameNode->attached()) { -        ASSERT_NOT_REACHED(); -        return false; -    } - -    ASSERT(frameNode->isElementNode()); -    if (!frameNode->isElementNode()) -        return false; - -    Element* element = static_cast<Element*>(frameNode); -    ASSERT(element->isFrameOwnerElement()); -    if (!element->isFrameOwnerElement()) -        return false; - -    HTMLFrameOwnerElement* frameOwner = static_cast<HTMLFrameOwnerElement*>(element); -    ASSERT(frameOwner->contentFrame()); -    if (!frameOwner->contentFrame()) -        return false; - -    FrameLoader* loader = frameOwner->contentFrame()->loader(); - -    loader->setResponseMIMEType(mimeType); -    loader->begin(); -    loader->write(source); -    loader->end(); - -    return true; -} - -const String& InspectorController::platform() const -{ -#if PLATFORM(MAC) -#ifdef BUILDING_ON_TIGER -    DEFINE_STATIC_LOCAL(const String, platform, ("mac-tiger")); -#else -    DEFINE_STATIC_LOCAL(const String, platform, ("mac-leopard")); -#endif -#elif PLATFORM(WIN_OS) -    DEFINE_STATIC_LOCAL(const String, platform, ("windows")); -#elif PLATFORM(QT) -    DEFINE_STATIC_LOCAL(const String, platform, ("qt")); -#elif PLATFORM(GTK) -    DEFINE_STATIC_LOCAL(const String, platform, ("gtk")); -#elif PLATFORM(WX) -    DEFINE_STATIC_LOCAL(const String, platform, ("wx")); -#else -    DEFINE_STATIC_LOCAL(const String, platform, ("unknown")); -#endif - -    return platform; -} +static const unsigned defaultAttachedHeight = 300; +static const float minimumAttachedHeight = 250.0f; +static const float maximumAttachedHeightRatio = 0.75f;  static unsigned s_inspectorControllerCount;  static HashMap<String, InspectorController::Setting*>* s_settingCache; @@ -168,13 +117,14 @@ InspectorController::InspectorController(Page* page, InspectorClient* client)      , m_page(0)      , m_scriptState(0)      , m_windowVisible(false) -    , m_showAfterVisible(ElementsPanel) +    , m_showAfterVisible(CurrentPanel)      , m_nextIdentifier(-2)      , m_groupLevel(0)      , m_searchingForNode(false)      , m_previousMessage(0)      , m_resourceTrackingEnabled(false)      , m_resourceTrackingSettingsLoaded(false) +    , m_inspectorBackend(InspectorBackend::create(this, client))  #if ENABLE(JAVASCRIPT_DEBUGGER)      , m_debuggerEnabled(false)      , m_attachDebuggerWhenShown(false) @@ -209,6 +159,8 @@ InspectorController::~InspectorController()          delete s_settingCache;          s_settingCache = 0;      } +     +    m_inspectorBackend->disconnectController();  }  void InspectorController::inspectedPageDestroyed() @@ -279,20 +231,6 @@ void InspectorController::setSetting(const String& key, const Setting& setting)      m_client->storeSetting(key, setting);  } -String InspectorController::localizedStringsURL() -{ -    if (!enabled()) -        return String(); -    return m_client->localizedStringsURL(); -} - -String InspectorController::hiddenPanels() -{ -    if (!enabled()) -        return String(); -    return m_client->hiddenPanels(); -} -  // Trying to inspect something in a frame with JavaScript disabled would later lead to  // crashes trying to create JavaScript wrappers. Some day we could fix this issue, but  // for now prevent crashes here by never targeting a node in such a frame. @@ -371,14 +309,27 @@ void InspectorController::setWindowVisible(bool visible, bool attached)      if (m_windowVisible) {          setAttachedWindow(attached);          populateScriptObjects(); + +        // Console panel is implemented as a 'fast view', so there should be +        // real panel opened along with it. +        bool showConsole = m_showAfterVisible == ConsolePanel; +        if (m_showAfterVisible == CurrentPanel || showConsole) { +          Setting lastActivePanelSetting = setting(lastActivePanelSettingName); +          if (lastActivePanelSetting.type() == Setting::StringType) +              m_showAfterVisible = specialPanelForJSName(lastActivePanelSetting.string()); +          else +              m_showAfterVisible = ElementsPanel; +        } +          if (m_nodeToFocus)              focusNode();  #if ENABLE(JAVASCRIPT_DEBUGGER)          if (m_attachDebuggerWhenShown)              enableDebugger();  #endif -        if (m_showAfterVisible != CurrentPanel) -            showPanel(m_showAfterVisible); +        showPanel(m_showAfterVisible); +        if (showConsole) +            showPanel(ConsolePanel);      } else {  #if ENABLE(JAVASCRIPT_DEBUGGER)          // If the window is being closed with the debugger enabled, @@ -391,24 +342,23 @@ void InspectorController::setWindowVisible(bool visible, bool attached)  #endif          resetScriptObjects();      } -      m_showAfterVisible = CurrentPanel;  } -void InspectorController::addMessageToConsole(MessageSource source, MessageLevel level, ScriptCallStack* callStack) +void InspectorController::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, ScriptCallStack* callStack)  {      if (!enabled())          return; -    addConsoleMessage(callStack->state(), new ConsoleMessage(source, level, callStack, m_groupLevel, level == TraceMessageLevel)); +    addConsoleMessage(callStack->state(), new ConsoleMessage(source, type, level, callStack, m_groupLevel, type == TraceMessageType));  } -void InspectorController::addMessageToConsole(MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID) +void InspectorController::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID)  {      if (!enabled())          return; -    addConsoleMessage(0, new ConsoleMessage(source, level, message, lineNumber, sourceID, m_groupLevel)); +    addConsoleMessage(0, new ConsoleMessage(source, type, level, message, lineNumber, sourceID, m_groupLevel));  }  void InspectorController::addConsoleMessage(ScriptState* scriptState, ConsoleMessage* consoleMessage) @@ -440,7 +390,7 @@ void InspectorController::startGroup(MessageSource source, ScriptCallStack* call  {      ++m_groupLevel; -    addConsoleMessage(callStack->state(), new ConsoleMessage(source, StartGroupMessageLevel, callStack, m_groupLevel)); +    addConsoleMessage(callStack->state(), new ConsoleMessage(source, StartGroupMessageType, LogMessageLevel, callStack, m_groupLevel));  }  void InspectorController::endGroup(MessageSource source, unsigned lineNumber, const String& sourceURL) @@ -450,14 +400,29 @@ void InspectorController::endGroup(MessageSource source, unsigned lineNumber, co      --m_groupLevel; -    addConsoleMessage(0, new ConsoleMessage(source, EndGroupMessageLevel, String(), lineNumber, sourceURL, m_groupLevel)); +    addConsoleMessage(0, new ConsoleMessage(source, EndGroupMessageType, LogMessageLevel, String(), lineNumber, sourceURL, m_groupLevel)); +} + +static unsigned constrainedAttachedWindowHeight(unsigned preferredHeight, unsigned totalWindowHeight) +{ +    return roundf(max(minimumAttachedHeight, min<float>(preferredHeight, totalWindowHeight * maximumAttachedHeightRatio)));  }  void InspectorController::attachWindow()  {      if (!enabled())          return; + +    unsigned inspectedPageHeight = m_inspectedPage->mainFrame()->view()->visibleHeight(); +      m_client->attachWindow(); + +    Setting attachedHeight = setting(inspectorAttachedHeightName); +    unsigned preferredHeight = attachedHeight.type() == Setting::IntegerType ? attachedHeight.integerValue() : defaultAttachedHeight; + +    // We need to constrain the window height here in case the user has resized the inspected page's window so that +    // the user's preferred height would be too big to display. +    m_client->setAttachedWindowHeight(constrainedAttachedWindowHeight(preferredHeight, inspectedPageHeight));  }  void InspectorController::detachWindow() @@ -479,7 +444,18 @@ void InspectorController::setAttachedWindowHeight(unsigned height)  {      if (!enabled())          return; -    m_client->setAttachedWindowHeight(height); +     +    unsigned totalHeight = m_page->mainFrame()->view()->visibleHeight() + m_inspectedPage->mainFrame()->view()->visibleHeight(); +    unsigned attachedHeight = constrainedAttachedWindowHeight(height, totalHeight); +     +    setSetting(inspectorAttachedHeightName, Setting(attachedHeight)); +     +    m_client->setAttachedWindowHeight(attachedHeight); +} + +void InspectorController::storeLastActivePanel(const String& panelName) +{ +    setSetting(lastActivePanelSettingName, Setting(panelName));  }  void InspectorController::toggleSearchForNodeInPage() @@ -492,19 +468,6 @@ void InspectorController::toggleSearchForNodeInPage()          hideHighlight();  } -void InspectorController::addResourceSourceToFrame(long identifier, Node* frame) -{ -    if (!enabled() || !m_frontend) -        return; - -    RefPtr<InspectorResource> resource = resources().get(identifier); -    if (resource) { -        String sourceString = resource->sourceString(); -        if (!sourceString.isEmpty()) -            addSourceToFrame(resource->mimeType(), sourceString, frame); -    } -} -  void InspectorController::mouseDidMoveOverElement(const HitTestResult& result, unsigned)  {      if (!enabled() || !m_searchingForNode) @@ -544,12 +507,11 @@ void InspectorController::windowScriptObjectAvailable()      // Grant the inspector the ability to script the inspected page.      m_page->mainFrame()->document()->securityOrigin()->grantUniversalAccess(); -      m_scriptState = scriptStateFromPage(m_page); -    ScriptGlobalObject::set(m_scriptState, "InspectorController", this); +    ScriptGlobalObject::set(m_scriptState, "InspectorController", m_inspectorBackend.get());  } -void InspectorController::scriptObjectReady() +void InspectorController::scriptObjectReady(bool enableDOMAgent)  {      ASSERT(m_scriptState);      if (!m_scriptState) @@ -559,6 +521,8 @@ void InspectorController::scriptObjectReady()      if (!ScriptGlobalObject::get(m_scriptState, "WebInspector", webInspectorObj))          return;      setFrontendProxyObject(m_scriptState, webInspectorObj); +    if (enableDOMAgent) +        m_domAgent = new InspectorDOMAgent(m_frontend.get());  #if ENABLE(JAVASCRIPT_DEBUGGER)      Setting debuggerEnabled = setting(debuggerEnabledSettingName); @@ -571,6 +535,8 @@ void InspectorController::scriptObjectReady()      // Make sure our window is visible now that the page loaded      showWindow(); + +    m_client->inspectorWindowObjectCleared();  }  void InspectorController::setFrontendProxyObject(ScriptState* scriptState, ScriptObject webInspectorObj) @@ -629,13 +595,28 @@ void InspectorController::close()      closeWindow();      m_frontend.set(0); +    if (m_domAgent) { +        m_domAgent->setDocument(0); +        m_domAgent = 0; +    }      m_scriptState = 0;  }  void InspectorController::showWindow()  {      ASSERT(enabled()); + +    unsigned inspectedPageHeight = m_inspectedPage->mainFrame()->view()->visibleHeight(); +      m_client->showWindow(); + +    Setting attachedHeight = setting(inspectorAttachedHeightName); +    unsigned preferredHeight = attachedHeight.type() == Setting::IntegerType ? attachedHeight.integerValue() : defaultAttachedHeight; + +    // This call might not go through (if the window starts out detached), but if the window is initially created attached, +    // InspectorController::attachWindow is never called, so we need to make sure to set the attachedWindowHeight. +    // FIXME: Clean up code so we only have to call setAttachedWindowHeight in InspectorController::attachWindow +    m_client->setAttachedWindowHeight(constrainedAttachedWindowHeight(preferredHeight, inspectedPageHeight));  }  void InspectorController::closeWindow() @@ -668,6 +649,8 @@ void InspectorController::populateScriptObjects()          (*it)->bind(m_frontend.get());  #endif +    if (m_domAgent) +        m_domAgent->setDocument(m_inspectedPage->mainFrame()->document());      m_frontend->populateInterface();  } @@ -729,6 +712,8 @@ void InspectorController::didCommitLoad(DocumentLoader* loader)          m_counts.clear();  #if ENABLE(JAVASCRIPT_DEBUGGER)          m_profiles.clear(); +        m_currentUserInitiatedProfileNumber = 1; +        m_nextUserInitiatedProfileNumber = 1;  #endif  #if ENABLE(DATABASE)          m_databaseResources.clear(); @@ -754,6 +739,9 @@ void InspectorController::didCommitLoad(DocumentLoader* loader)                  m_mainResource = 0;              }          } + +        if (m_domAgent) +            m_domAgent->setDocument(m_inspectedPage->mainFrame()->document());      }      for (Frame* frame = loader->frame(); frame; frame = frame->tree()->traverseNext(loader->frame())) @@ -788,7 +776,9 @@ void InspectorController::addResource(InspectorResource* resource)  void InspectorController::removeResource(InspectorResource* resource)  {      m_resources.remove(resource->identifier()); -    m_knownResources.remove(resource->requestURL()); +    String requestURL = resource->requestURL(); +    if (!requestURL.isNull()) +        m_knownResources.remove(requestURL);      Frame* frame = resource->frame();      ResourcesMap* resourceMap = m_frameResources.get(frame); @@ -804,6 +794,21 @@ void InspectorController::removeResource(InspectorResource* resource)      }  } +InspectorResource* InspectorController::getTrackedResource(long long identifier) +{ +    if (!enabled()) +        return 0; + +    if (m_resourceTrackingEnabled) +        return m_resources.get(identifier).get(); + +    bool isMainResource = m_mainResource && m_mainResource->identifier() == identifier; +    if (isMainResource) +        return m_mainResource.get(); + +    return 0; +} +  void InspectorController::didLoadResourceFromMemoryCache(DocumentLoader* loader, const CachedResource* cachedResource)  {      if (!enabled()) @@ -814,7 +819,7 @@ void InspectorController::didLoadResourceFromMemoryCache(DocumentLoader* loader,          return;      ASSERT(m_inspectedPage); -    bool isMainResource = loader->frame() == m_inspectedPage->mainFrame() && cachedResource->url() == loader->requestURL(); +    bool isMainResource = isMainResourceLoader(loader, KURL(cachedResource->url()));      ensureResourceTrackingSettingsLoaded();      if (!isMainResource && !m_resourceTrackingEnabled)          return; @@ -838,7 +843,7 @@ void InspectorController::identifierForInitialRequest(unsigned long identifier,          return;      ASSERT(m_inspectedPage); -    bool isMainResource = m_inspectedPage->mainFrame() && request.url() == loader->requestURL(); +    bool isMainResource = isMainResourceLoader(loader, request.url());      ensureResourceTrackingSettingsLoaded();      if (!isMainResource && !m_resourceTrackingEnabled)          return; @@ -858,12 +863,14 @@ void InspectorController::identifierForInitialRequest(unsigned long identifier,          resource->createScriptObject(m_frontend.get());  } -void InspectorController::willSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse) +bool InspectorController::isMainResourceLoader(DocumentLoader* loader, const KURL& requestUrl)  { -    if (!enabled() || !m_resourceTrackingEnabled) -        return; +    return loader->frame() == m_inspectedPage->mainFrame() && requestUrl == loader->requestURL(); +} -    InspectorResource* resource = m_resources.get(identifier).get(); +void InspectorController::willSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse) +{ +    RefPtr<InspectorResource> resource = getTrackedResource(identifier);      if (!resource)          return; @@ -880,10 +887,7 @@ void InspectorController::willSendRequest(DocumentLoader*, unsigned long identif  void InspectorController::didReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse& response)  { -    if (!enabled() || !m_resourceTrackingEnabled) -        return; - -    InspectorResource* resource = m_resources.get(identifier).get(); +    RefPtr<InspectorResource> resource = getTrackedResource(identifier);      if (!resource)          return; @@ -896,10 +900,7 @@ void InspectorController::didReceiveResponse(DocumentLoader*, unsigned long iden  void InspectorController::didReceiveContentLength(DocumentLoader*, unsigned long identifier, int lengthReceived)  { -    if (!enabled() || !m_resourceTrackingEnabled) -        return; - -    InspectorResource* resource = m_resources.get(identifier).get(); +    RefPtr<InspectorResource> resource = getTrackedResource(identifier);      if (!resource)          return; @@ -911,10 +912,7 @@ void InspectorController::didReceiveContentLength(DocumentLoader*, unsigned long  void InspectorController::didFinishLoading(DocumentLoader*, unsigned long identifier)  { -    if (!enabled() || !m_resourceTrackingEnabled) -        return; - -    RefPtr<InspectorResource> resource = m_resources.get(identifier); +    RefPtr<InspectorResource> resource = getTrackedResource(identifier);      if (!resource)          return; @@ -930,10 +928,7 @@ void InspectorController::didFinishLoading(DocumentLoader*, unsigned long identi  void InspectorController::didFailLoading(DocumentLoader*, unsigned long identifier, const ResourceError& /*error*/)  { -    if (!enabled() || !m_resourceTrackingEnabled) -        return; - -    RefPtr<InspectorResource> resource = m_resources.get(identifier); +    RefPtr<InspectorResource> resource = getTrackedResource(identifier);      if (!resource)          return; @@ -980,7 +975,8 @@ void InspectorController::scriptImported(unsigned long identifier, const String&          resource->updateScriptObject(m_frontend.get());  } -void InspectorController::enableResourceTracking(bool always) { +void InspectorController::enableResourceTracking(bool always) +{      if (!enabled())          return; @@ -998,7 +994,8 @@ void InspectorController::enableResourceTracking(bool always) {      m_inspectedPage->mainFrame()->loader()->reload();  } -void InspectorController::disableResourceTracking(bool always) { +void InspectorController::disableResourceTracking(bool always) +{      if (!enabled())          return; @@ -1079,10 +1076,10 @@ void InspectorController::addProfile(PassRefPtr<Profile> prpProfile, unsigned li      if (windowVisible())          addScriptProfile(profile.get()); -    addProfileMessageToConsole(profile, lineNumber, sourceURL); +    addProfileFinishedMessageToConsole(profile, lineNumber, sourceURL);  } -void InspectorController::addProfileMessageToConsole(PassRefPtr<Profile> prpProfile, unsigned lineNumber, const UString& sourceURL) +void InspectorController::addProfileFinishedMessageToConsole(PassRefPtr<Profile> prpProfile, unsigned lineNumber, const UString& sourceURL)  {      RefPtr<Profile> profile = prpProfile; @@ -1091,7 +1088,15 @@ void InspectorController::addProfileMessageToConsole(PassRefPtr<Profile> prpProf      message += "/";      message += UString::from(profile->uid());      message += "\" finished."; -    addMessageToConsole(JSMessageSource, LogMessageLevel, message, lineNumber, sourceURL); +    addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lineNumber, sourceURL); +} + +void InspectorController::addStartProfilingMessageToConsole(const UString& title, unsigned lineNumber, const UString& sourceURL) +{ +    UString message = "Profile \"webkit-profile://"; +    message += encodeWithURLEscapeSequences(title); +    message += "/0\" started."; +    addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lineNumber, sourceURL);  }  void InspectorController::addScriptProfile(Profile* profile) @@ -1099,10 +1104,22 @@ void InspectorController::addScriptProfile(Profile* profile)      if (!m_frontend)          return; -    JSLock lock(false); +    JSLock lock(SilenceAssertionsOnly);      m_frontend->addProfile(toJS(m_scriptState, profile));  } +UString InspectorController::getCurrentUserInitiatedProfileName(bool incrementProfileNumber = false) +{ +    if (incrementProfileNumber) +        m_currentUserInitiatedProfileNumber = m_nextUserInitiatedProfileNumber++;         + +    UString title = UserInitiatedProfileName; +    title += "."; +    title += UString::from(m_currentUserInitiatedProfileNumber); +     +    return title; +} +  void InspectorController::startUserInitiatedProfilingSoon()  {      m_startProfiling.startOneShot(0); @@ -1119,15 +1136,14 @@ void InspectorController::startUserInitiatedProfiling(Timer<InspectorController>      }      m_recordingUserInitiatedProfile = true; -    m_currentUserInitiatedProfileNumber = m_nextUserInitiatedProfileNumber++; -    UString title = UserInitiatedProfileName; -    title += "."; -    title += UString::from(m_currentUserInitiatedProfileNumber); +    UString title = getCurrentUserInitiatedProfileName(true);      ExecState* scriptState = toJSDOMWindow(m_inspectedPage->mainFrame())->globalExec();      Profiler::profiler()->startProfiling(scriptState, title); +    addStartProfilingMessageToConsole(title, 0, UString()); +      toggleRecordButton(true);  } @@ -1138,9 +1154,7 @@ void InspectorController::stopUserInitiatedProfiling()      m_recordingUserInitiatedProfile = false; -    UString title =  UserInitiatedProfileName; -    title += "."; -    title += UString::from(m_currentUserInitiatedProfileNumber); +    UString title = getCurrentUserInitiatedProfileName();      ExecState* scriptState = toJSDOMWindow(m_inspectedPage->mainFrame())->globalExec();      RefPtr<Profile> profile = Profiler::profiler()->stopProfiling(scriptState, title); @@ -1239,28 +1253,6 @@ void InspectorController::disableDebugger(bool always)          m_frontend->debuggerWasDisabled();  } -JavaScriptCallFrame* InspectorController::currentCallFrame() const -{ -    return JavaScriptDebugServer::shared().currentCallFrame(); -} - -bool InspectorController::pauseOnExceptions() -{ -    return JavaScriptDebugServer::shared().pauseOnExceptions(); -} - -void InspectorController::setPauseOnExceptions(bool pause) -{ -    JavaScriptDebugServer::shared().setPauseOnExceptions(pause); -} - -void InspectorController::pauseInDebugger() -{ -    if (!m_debuggerEnabled) -        return; -    JavaScriptDebugServer::shared().pauseProgram(); -} -  void InspectorController::resumeDebugger()  {      if (!m_debuggerEnabled) @@ -1268,37 +1260,6 @@ void InspectorController::resumeDebugger()      JavaScriptDebugServer::shared().continueProgram();  } -void InspectorController::stepOverStatementInDebugger() -{ -    if (!m_debuggerEnabled) -        return; -    JavaScriptDebugServer::shared().stepOverStatement(); -} - -void InspectorController::stepIntoStatementInDebugger() -{ -    if (!m_debuggerEnabled) -        return; -    JavaScriptDebugServer::shared().stepIntoStatement(); -} - -void InspectorController::stepOutOfFunctionInDebugger() -{ -    if (!m_debuggerEnabled) -        return; -    JavaScriptDebugServer::shared().stepOutOfFunction(); -} - -void InspectorController::addBreakpoint(intptr_t sourceID, unsigned lineNumber) -{ -    JavaScriptDebugServer::shared().addBreakpoint(sourceID, lineNumber); -} - -void InspectorController::removeBreakpoint(intptr_t sourceID, unsigned lineNumber) -{ -    JavaScriptDebugServer::shared().removeBreakpoint(sourceID, lineNumber); -} -  // JavaScriptDebugListener functions  void InspectorController::didParseSource(ExecState*, const SourceCode& source) @@ -1480,7 +1441,7 @@ void InspectorController::count(const String& title, unsigned lineNumber, const      m_counts.add(identifier, count);      String message = String::format("%s: %d", title.utf8().data(), count); -    addMessageToConsole(JSMessageSource, LogMessageLevel, message, lineNumber, sourceID); +    addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lineNumber, sourceID);  }  void InspectorController::startTiming(const String& title) @@ -1501,4 +1462,20 @@ bool InspectorController::stopTiming(const String& title, double& elapsed)      return true;  } +InspectorController::SpecialPanels InspectorController::specialPanelForJSName(const String& panelName) +{ +    if (panelName == "elements") +        return ElementsPanel; +    else if (panelName == "resources") +        return ResourcesPanel; +    else if (panelName == "scripts") +        return ScriptsPanel; +    else if (panelName == "profiles") +        return ProfilesPanel; +    else if (panelName == "databases") +        return DatabasesPanel; +    else +        return ElementsPanel; +} +  } // namespace WebCore | 
