Changeset 124769 in webkit


Ignore:
Timestamp:
Aug 6, 2012 7:14:24 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: a tiny refactoring of Highlighter in InspectorDOMAgent
https://bugs.webkit.org/show_bug.cgi?id=93257

Patch by Sergey Rogulenko <rogulenko@google.com> on 2012-08-06
Reviewed by Pavel Feldman.

Moving error string setting inside highlightConfigFromInspectorObject.

  • inspector/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::setSearchingForNode):
(WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject):
(WebCore::InspectorDOMAgent::highlightNode):

  • inspector/InspectorDOMAgent.h:

(InspectorDOMAgent):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r124768 r124769  
     12012-08-06  Sergey Rogulenko  <rogulenko@google.com>
     2
     3        Web Inspector: a tiny refactoring of Highlighter in InspectorDOMAgent
     4        https://bugs.webkit.org/show_bug.cgi?id=93257
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Moving error string setting inside highlightConfigFromInspectorObject.
     9
     10        * inspector/InspectorDOMAgent.cpp:
     11        (WebCore::InspectorDOMAgent::setSearchingForNode):
     12        (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject):
     13        (WebCore::InspectorDOMAgent::highlightNode):
     14        * inspector/InspectorDOMAgent.h:
     15        (InspectorDOMAgent):
     16
    1172012-08-03  Yury Semikhatsky  <yurys@chromium.org>
    218
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp

    r124749 r124769  
    10061006    m_searchingForNode = enabled;
    10071007    if (enabled) {
    1008         if (!highlightInspectorObject) {
    1009             *errorString = "Internal error: highlight configuration parameter is missing";
     1008        m_inspectModeHighlightConfig = highlightConfigFromInspectorObject(errorString, highlightInspectorObject);
     1009        if (!m_inspectModeHighlightConfig)
    10101010            return;
    1011         }
    1012         m_inspectModeHighlightConfig = highlightConfigFromInspectorObject(highlightInspectorObject);
    1013     }
    1014     else {
    1015         ErrorString error;
    1016         hideHighlight(&error);
    1017     }
    1018 }
    1019 
    1020 PassOwnPtr<HighlightConfig> InspectorDOMAgent::highlightConfigFromInspectorObject(InspectorObject* highlightInspectorObject)
    1021 {
     1011    } else
     1012        hideHighlight(errorString);
     1013}
     1014
     1015PassOwnPtr<HighlightConfig> InspectorDOMAgent::highlightConfigFromInspectorObject(ErrorString* errorString, InspectorObject* highlightInspectorObject)
     1016{
     1017    if (!highlightInspectorObject) {
     1018        *errorString = "Internal error: highlight configuration parameter is missing";
     1019        return nullptr;
     1020    }
     1021
    10221022    OwnPtr<HighlightConfig> highlightConfig = adoptPtr(new HighlightConfig());
    10231023    bool showInfo = false; // Default: false (do not show a tooltip).
     
    10501050    const RefPtr<InspectorObject>& highlightInspectorObject)
    10511051{
    1052     if (Node* node = nodeForId(nodeId)) {
    1053         if (!highlightInspectorObject) {
    1054             *errorString = "Internal error: highlight configuration parameter is missing";
    1055             return;
    1056         }
    1057         OwnPtr<HighlightConfig> highlightConfig = highlightConfigFromInspectorObject(highlightInspectorObject.get());
    1058         m_overlay->highlightNode(node, *highlightConfig);
    1059     }
     1052    Node* node = nodeForId(nodeId);
     1053    if (!node)
     1054        return;
     1055
     1056    OwnPtr<HighlightConfig> highlightConfig = highlightConfigFromInspectorObject(errorString, highlightInspectorObject.get());
     1057    if (!highlightConfig)
     1058        return;
     1059
     1060    m_overlay->highlightNode(node, *highlightConfig);
    10601061}
    10611062
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.h

    r124749 r124769  
    203203
    204204    void setSearchingForNode(ErrorString*, bool enabled, InspectorObject* highlightConfig);
    205     PassOwnPtr<HighlightConfig> highlightConfigFromInspectorObject(InspectorObject* highlightInspectorObject);
     205    PassOwnPtr<HighlightConfig> highlightConfigFromInspectorObject(ErrorString*, InspectorObject* highlightInspectorObject);
    206206
    207207    // Node-related methods.
Note: See TracChangeset for help on using the changeset viewer.