[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

podivilov at chromium.org podivilov at chromium.org
Wed Dec 22 18:39:27 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 19aadd7a40af644bbb595863e984cb6b82b7fe92
Author: podivilov at chromium.org <podivilov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 15 10:39:17 2010 +0000

    2010-12-13  Pavel Podivilov  <podivilov at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            Web Inspector: push persistent breakpoints into backend state cookie so they hit on navigation.
            https://bugs.webkit.org/show_bug.cgi?id=48858
    
            BreakpointManager pushes all persistent breakpoints to backend when loaded.
            InspectorController restores sticky breakpoints from cookie on navigation.
    
            * inspector/Inspector.idl:
            * inspector/InspectorController.cpp:
            (WebCore::InspectorController::InspectorController):
            (WebCore::InspectorController::disconnectFrontend):
            (WebCore::InspectorController::didCommitLoad):
            (WebCore::InspectorController::setStickyBreakpoints):
            (WebCore::InspectorController::restoreStickyBreakpoints):
            (WebCore::InspectorController::restoreStickyBreakpoint):
            * inspector/InspectorController.h:
            * inspector/InspectorState.cpp:
            (WebCore::InspectorState::InspectorState):
            (WebCore::InspectorState::getObject):
            (WebCore::InspectorState::setObject):
            (WebCore::InspectorState::registerObject):
            * inspector/InspectorState.h:
            * inspector/front-end/BreakpointManager.js:
            (WebInspector.BreakpointManager):
            * inspector/front-end/BreakpointsSidebarPane.js:
            (WebInspector.BreakpointsSidebarPane):
            (WebInspector.BreakpointsSidebarPane.prototype._removeListElement):
            (WebInspector.BreakpointsSidebarPane.prototype._projectChanged):
            (WebInspector.EventListenerBreakpointsSidebarPane):
            (WebInspector.EventListenerBreakpointsSidebarPane.prototype._createCategory):
            (WebInspector.EventListenerBreakpointsSidebarPane.prototype._breakpointAdded):
            (WebInspector.EventListenerBreakpointsSidebarPane.prototype._projectChanged):
            * inspector/front-end/CallStackSidebarPane.js:
            (WebInspector.CallStackSidebarPane):
            * inspector/front-end/ElementsPanel.js:
            (WebInspector.ElementsPanel.prototype.reset):
            * inspector/front-end/ScriptsPanel.js:
            (WebInspector.ScriptsPanel.prototype.reset):
            * inspector/front-end/Settings.js:
            (WebInspector.Settings.prototype.inspectedURLChanged):
            (WebInspector.Settings.prototype.get projectId):
            (WebInspector.Settings.prototype.findSettingForAllProjects):
            (WebInspector.Settings.prototype._formatProjectKey):
            * inspector/front-end/inspector.js:
            (WebInspector.createDOMBreakpointsSidebarPane):
            (WebInspector.createXHRBreakpointsSidebarPane):
            (WebInspector.reset):
            (WebInspector.inspectedURLChanged):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74103 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1162554..27c9edd 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,55 @@
+2010-12-13  Pavel Podivilov  <podivilov at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: push persistent breakpoints into backend state cookie so they hit on navigation.
+        https://bugs.webkit.org/show_bug.cgi?id=48858
+
+        BreakpointManager pushes all persistent breakpoints to backend when loaded.
+        InspectorController restores sticky breakpoints from cookie on navigation.
+
+        * inspector/Inspector.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::disconnectFrontend):
+        (WebCore::InspectorController::didCommitLoad):
+        (WebCore::InspectorController::setStickyBreakpoints):
+        (WebCore::InspectorController::restoreStickyBreakpoints):
+        (WebCore::InspectorController::restoreStickyBreakpoint):
+        * inspector/InspectorController.h:
+        * inspector/InspectorState.cpp:
+        (WebCore::InspectorState::InspectorState):
+        (WebCore::InspectorState::getObject):
+        (WebCore::InspectorState::setObject):
+        (WebCore::InspectorState::registerObject):
+        * inspector/InspectorState.h:
+        * inspector/front-end/BreakpointManager.js:
+        (WebInspector.BreakpointManager):
+        * inspector/front-end/BreakpointsSidebarPane.js:
+        (WebInspector.BreakpointsSidebarPane):
+        (WebInspector.BreakpointsSidebarPane.prototype._removeListElement):
+        (WebInspector.BreakpointsSidebarPane.prototype._projectChanged):
+        (WebInspector.EventListenerBreakpointsSidebarPane):
+        (WebInspector.EventListenerBreakpointsSidebarPane.prototype._createCategory):
+        (WebInspector.EventListenerBreakpointsSidebarPane.prototype._breakpointAdded):
+        (WebInspector.EventListenerBreakpointsSidebarPane.prototype._projectChanged):
+        * inspector/front-end/CallStackSidebarPane.js:
+        (WebInspector.CallStackSidebarPane):
+        * inspector/front-end/ElementsPanel.js:
+        (WebInspector.ElementsPanel.prototype.reset):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype.reset):
+        * inspector/front-end/Settings.js:
+        (WebInspector.Settings.prototype.inspectedURLChanged):
+        (WebInspector.Settings.prototype.get projectId):
+        (WebInspector.Settings.prototype.findSettingForAllProjects):
+        (WebInspector.Settings.prototype._formatProjectKey):
+        * inspector/front-end/inspector.js:
+        (WebInspector.createDOMBreakpointsSidebarPane):
+        (WebInspector.createXHRBreakpointsSidebarPane):
+        (WebInspector.reset):
+        (WebInspector.inspectedURLChanged):
+
 2010-12-15  Mario Sanchez Prada  <msanchez at igalia.com>
 
         Unreviewed, fix compilation warnings after r74066.
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index 962eaca..c956613 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -219,6 +219,8 @@ module core {
         [domain=Debugger] void setBreakpoint(in String sourceID, in unsigned int lineNumber, in boolean enabled, in String condition, out boolean success, out unsigned int actualLineNumber);
         [domain=Debugger] void removeBreakpoint(in String sourceID, in unsigned long lineNumber);
 
+        [domain=Inspector] void setStickyBreakpoints(in Object breakpoints); // FIXME: Move to newly introduced BrowserDebugger.
+
         [domain=DOM] void setDOMBreakpoint(in long nodeId, in long type); // FIXME: Move to newly introduced BrowserDebugger.
         [domain=DOM] void removeDOMBreakpoint(in long nodeId, in long type); // FIXME: Move to newly introduced BrowserDebugger.
 
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index e045382..39c8207 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -149,6 +149,7 @@ InspectorController::InspectorController(Page* page, InspectorClient* client)
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     , m_attachDebuggerWhenShown(false)
     , m_hasXHRBreakpointWithEmptyURL(false)
+    , m_stickyBreakpointsRestored(false)
     , m_profilerAgent(InspectorProfilerAgent::create(this))
 #endif
 {
@@ -560,7 +561,6 @@ void InspectorController::disconnectFrontend()
     bool debuggerWasEnabled = debuggerEnabled();
     disableDebugger();
     m_attachDebuggerWhenShown = debuggerWasEnabled;
-    clearNativeBreakpoints();
 #endif
     setSearchingForNode(false);
     unbindAllResources();
@@ -717,10 +717,10 @@ void InspectorController::didCommitLoad(DocumentLoader* loader)
         m_counts.clear();
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
-        if (m_debuggerAgent)
+        if (m_debuggerAgent) {
             m_debuggerAgent->clearForPageNavigation();
-
-        clearNativeBreakpoints();
+            restoreStickyBreakpoints();
+        }
 #endif
 
 #if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
@@ -1382,6 +1382,59 @@ void InspectorController::resume()
         m_debuggerAgent->resume();
 }
 
+void InspectorController::setStickyBreakpoints(PassRefPtr<InspectorObject> breakpoints)
+{
+    m_state->setObject(InspectorState::stickyBreakpoints, breakpoints);
+    if (!m_stickyBreakpointsRestored) {
+        restoreStickyBreakpoints();
+        m_stickyBreakpointsRestored = true;
+    }
+}
+
+void InspectorController::restoreStickyBreakpoints()
+{
+    m_eventListenerBreakpoints.clear();
+    m_XHRBreakpoints.clear();
+    m_hasXHRBreakpointWithEmptyURL = false;
+
+    RefPtr<InspectorObject> allBreakpoints = m_state->getObject(InspectorState::stickyBreakpoints);
+    KURL url = m_inspectedPage->mainFrame()->loader()->url();
+    url.removeFragmentIdentifier();
+    RefPtr<InspectorArray> breakpoints = allBreakpoints->getArray(url);
+    if (!breakpoints)
+        return;
+    for (unsigned i = 0; i < breakpoints->length(); ++i)
+        restoreStickyBreakpoint(breakpoints->get(i)->asObject());
+}
+
+void InspectorController::restoreStickyBreakpoint(PassRefPtr<InspectorObject> breakpoint)
+{
+    DEFINE_STATIC_LOCAL(String, eventListenerNativeBreakpointType, ("EventListener"));
+    DEFINE_STATIC_LOCAL(String, xhrNativeBreakpointType, ("XHR"));
+
+    if (!breakpoint)
+        return;
+    String type;
+    if (!breakpoint->getString("type", &type))
+        return;
+    bool enabled;
+    if (!breakpoint->getBoolean("enabled", &enabled) || !enabled)
+        return;
+    RefPtr<InspectorObject> condition = breakpoint->getObject("condition");
+    if (!condition)
+        return;
+
+    if (type == eventListenerNativeBreakpointType) {
+        String eventName;
+        if (condition->getString("eventName", &eventName))
+            setEventListenerBreakpoint(eventName);
+    } else if (type == xhrNativeBreakpointType) {
+        String url;
+        if (condition->getString("url", &url))
+            setXHRBreakpoint(url);
+    }
+}
+
 void InspectorController::setEventListenerBreakpoint(const String& eventName)
 {
     m_eventListenerBreakpoints.add(eventName);
@@ -1428,12 +1481,6 @@ bool InspectorController::hasXHRBreakpoint(const String& url, String* breakpoint
     return false;
 }
 
-void InspectorController::clearNativeBreakpoints()
-{
-    m_eventListenerBreakpoints.clear();
-    m_XHRBreakpoints.clear();
-    m_hasXHRBreakpointWithEmptyURL = false;
-}
 #endif
 
 void InspectorController::evaluateForTestInFrontend(long callId, const String& script)
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 14d5632..e4db9c6 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -255,6 +255,7 @@ public:
     InspectorDebuggerAgent* debuggerAgent() const { return m_debuggerAgent.get(); }
     void resume();
 
+    void setStickyBreakpoints(PassRefPtr<InspectorObject> breakpoints);
     void setEventListenerBreakpoint(const String& eventName);
     void removeEventListenerBreakpoint(const String& eventName);
     bool hasEventListenerBreakpoint(const String& eventName);
@@ -309,8 +310,8 @@ private:
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     void toggleRecordButton(bool);
     void enableDebuggerFromFrontend(bool always);
-
-    void clearNativeBreakpoints();
+    void restoreStickyBreakpoints();
+    void restoreStickyBreakpoint(PassRefPtr<InspectorObject> breakpoint);
 #endif
 #if ENABLE(DATABASE)
     void selectDatabase(Database* database);
@@ -391,6 +392,7 @@ private:
     HashSet<String> m_eventListenerBreakpoints;
     HashSet<String> m_XHRBreakpoints;
     bool m_hasXHRBreakpointWithEmptyURL;
+    bool m_stickyBreakpointsRestored;
 
     OwnPtr<InspectorProfilerAgent> m_profilerAgent;
 #endif
diff --git a/WebCore/inspector/InspectorState.cpp b/WebCore/inspector/InspectorState.cpp
index ab900e7..0865648 100644
--- a/WebCore/inspector/InspectorState.cpp
+++ b/WebCore/inspector/InspectorState.cpp
@@ -40,15 +40,16 @@ InspectorState::InspectorState(InspectorClient* client)
     : m_client(client)
 {
     registerBoolean(monitoringXHR, false, "monitoringXHREnabled", "xhrMonitor");
-    registerBoolean(timelineProfilerEnabled, false, "timelineProfilerEnabled", (const char*)0);
-    registerBoolean(searchingForNode, false, "searchingForNodeEnabled", (const char*)0);
-    registerBoolean(profilerAlwaysEnabled, false, (const char*)0, "profilerEnabled");
-    registerBoolean(debuggerAlwaysEnabled, false, (const char*)0, "debuggerEnabled");
-    registerBoolean(inspectorStartsAttached, true, (const char*)0, "InspectorStartsAttached");
-    registerLong(inspectorAttachedHeight, InspectorController::defaultAttachedHeight, (const char*)0, "inspectorAttachedHeight");
-    registerLong(pauseOnExceptionsState, 0, "pauseOnExceptionsState", (const char*)0);
-    registerBoolean(consoleMessagesEnabled, false, "consoleMessagesEnabled", (const char*)0);
-    registerBoolean(userInitiatedProfiling, false, "userInitiatedProfiling", (const char*)0);
+    registerBoolean(timelineProfilerEnabled, false, "timelineProfilerEnabled", String());
+    registerBoolean(searchingForNode, false, "searchingForNodeEnabled", String());
+    registerBoolean(profilerAlwaysEnabled, false, String(), "profilerEnabled");
+    registerBoolean(debuggerAlwaysEnabled, false, String(), "debuggerEnabled");
+    registerBoolean(inspectorStartsAttached, true, String(), "InspectorStartsAttached");
+    registerLong(inspectorAttachedHeight, InspectorController::defaultAttachedHeight, String(), "inspectorAttachedHeight");
+    registerLong(pauseOnExceptionsState, 0, "pauseOnExceptionsState", String());
+    registerBoolean(consoleMessagesEnabled, false, "consoleMessagesEnabled", String());
+    registerBoolean(userInitiatedProfiling, false, "userInitiatedProfiling", String());
+    registerObject(stickyBreakpoints, String(), String());
 }
 
 void InspectorState::restoreFromInspectorCookie(const String& json)
@@ -152,6 +153,24 @@ long InspectorState::getLong(InspectorPropertyId id)
     return value;
 }
 
+PassRefPtr<InspectorObject> InspectorState::getObject(InspectorPropertyId id)
+{
+    PropertyMap::iterator i = m_properties.find(id);
+    ASSERT(i != m_properties.end());
+    return i->second.m_value->asObject();
+}
+
+void InspectorState::setObject(InspectorPropertyId id, PassRefPtr<InspectorObject> value)
+{
+    PropertyMap::iterator i = m_properties.find(id);
+    ASSERT(i != m_properties.end());
+    Property& property = i->second;
+    property.m_value = value;
+    if (property.m_preferenceName.length())
+        m_client->storeSetting(property.m_preferenceName, value->toJSONString());
+    updateCookie();
+}
+
 void InspectorState::registerBoolean(InspectorPropertyId propertyId, bool value, const String& frontendAlias, const String& preferenceName)
 {
     m_properties.set(propertyId, Property::create(InspectorBasicValue::create(value), frontendAlias, preferenceName));
@@ -167,6 +186,11 @@ void InspectorState::registerLong(InspectorPropertyId propertyId, long value, co
     m_properties.set(propertyId, Property::create(InspectorBasicValue::create((double)value), frontendAlias, preferenceName));
 }
 
+void InspectorState::registerObject(InspectorPropertyId propertyId, const String& frontendAlias, const String& preferenceName)
+{
+    m_properties.set(propertyId, Property::create(InspectorObject::create(), frontendAlias, preferenceName));
+}
+
 InspectorState::Property InspectorState::Property::create(PassRefPtr<InspectorValue> value, const String& frontendAlias, const String& preferenceName)
 {
     Property property;
diff --git a/WebCore/inspector/InspectorState.h b/WebCore/inspector/InspectorState.h
index aa2f1ec..4f57da7 100644
--- a/WebCore/inspector/InspectorState.h
+++ b/WebCore/inspector/InspectorState.h
@@ -55,6 +55,7 @@ public:
         pauseOnExceptionsState,
         consoleMessagesEnabled,
         userInitiatedProfiling,
+        stickyBreakpoints,
         lastPropertyId
     };
 
@@ -68,10 +69,12 @@ public:
     bool getBoolean(InspectorPropertyId propertyId);
     String getString(InspectorPropertyId propertyId);
     long getLong(InspectorPropertyId propertyId);
+    PassRefPtr<InspectorObject> getObject(InspectorPropertyId id);
 
     void setBoolean(InspectorPropertyId propertyId, bool value) { setValue(propertyId, InspectorBasicValue::create(value), value ? "true" : "false"); }
     void setString(InspectorPropertyId propertyId, const String& value) { setValue(propertyId, InspectorString::create(value), value); }
     void setLong(InspectorPropertyId propertyId, long value) { setValue(propertyId, InspectorBasicValue::create((double)value), String::number(value)); }
+    void setObject(InspectorPropertyId propertyId, PassRefPtr<InspectorObject> value);
 
 private:
     void updateCookie();
@@ -89,6 +92,7 @@ private:
     void registerBoolean(InspectorPropertyId propertyId, bool value, const String& frontendAlias, const String& preferenceName);
     void registerString(InspectorPropertyId propertyId, const String& value, const String& frontendAlias, const String& preferenceName);
     void registerLong(InspectorPropertyId propertyId, long value, const String& frontendAlias, const String& preferenceName);
+    void registerObject(InspectorPropertyId propertyId, const String& frontendAlias, const String& preferenceName);
 
     InspectorClient* m_client;
 };
diff --git a/WebCore/inspector/front-end/BreakpointManager.js b/WebCore/inspector/front-end/BreakpointManager.js
index 04ffcd3..172f0a6 100644
--- a/WebCore/inspector/front-end/BreakpointManager.js
+++ b/WebCore/inspector/front-end/BreakpointManager.js
@@ -30,8 +30,16 @@
 
 WebInspector.BreakpointManager = function()
 {
+    this._stickyBreakpoints = {};
+    var breakpoints = WebInspector.settings.findSettingForAllProjects("nativeBreakpoints");
+    for (var projectId in breakpoints)
+        this._stickyBreakpoints[projectId] = this._validateBreakpoints(breakpoints[projectId]);
+    InspectorBackend.setStickyBreakpoints(this._stickyBreakpoints);
+
     this._nativeBreakpoints = {};
+    this._domBreakpointsRestored = false;
 
+    WebInspector.settings.addEventListener(WebInspector.Settings.Events.ProjectChanged, this._projectChanged, this);
     WebInspector.debuggerModel.addEventListener("native-breakpoint-hit", this._nativeBreakpointHit, this);
     WebInspector.debuggerModel.addEventListener("debugger-resumed", this._debuggerResumed, this);
 }
@@ -42,8 +50,21 @@ WebInspector.BreakpointManager.NativeBreakpointTypes = {
     XHR: "XHR"
 }
 
+WebInspector.BreakpointManager.Events = {
+    DOMBreakpointAdded: "dom-breakpoint-added",
+    EventListenerBreakpointAdded: "event-listener-breakpoint-added",
+    XHRBreakpointAdded: "xhr-breakpoint-added",
+    NativeBreakpointHit: "native-breakpoint-hit",
+    ProjectChanged: "project-changed"
+}
+
 WebInspector.BreakpointManager.prototype = {
-    createDOMBreakpoint: function(nodeId, type, disabled)
+    createDOMBreakpoint: function(nodeId, type)
+    {
+        this._createDOMBreakpoint(nodeId, type, true, false);
+    },
+
+    _createDOMBreakpoint: function(nodeId, type, enabled, restored)
     {
         var node = WebInspector.domAgent.nodeForId(nodeId);
         if (!node)
@@ -53,73 +74,82 @@ WebInspector.BreakpointManager.prototype = {
         if (breakpointId in this._nativeBreakpoints)
             return;
 
-        var breakpoint = new WebInspector.DOMBreakpoint(this, breakpointId, !disabled, node, type);
-        this._nativeBreakpoints[breakpointId] = breakpoint;
-        this._updateNativeBreakpointsInSettings();
-        this.dispatchEventToListeners("dom-breakpoint-added", breakpoint);
-        return breakpoint;
+        var breakpoint = new WebInspector.DOMBreakpoint(node, type);
+        this._setNativeBreakpoint(breakpointId, breakpoint, enabled, restored);
+        if (enabled && restored)
+            breakpoint._enable();
+
+        breakpoint.view = new WebInspector.DOMBreakpointView(this, breakpointId, enabled, node, type);
+        this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.DOMBreakpointAdded, breakpoint.view);
     },
 
     createEventListenerBreakpoint: function(eventName)
     {
+        this._createEventListenerBreakpoint(eventName, true, false);
+    },
+
+    _createEventListenerBreakpoint: function(eventName, enabled, restored)
+    {
         var breakpointId = this._createEventListenerBreakpointId(eventName);
         if (breakpointId in this._nativeBreakpoints)
             return;
 
-        var breakpoint = new WebInspector.EventListenerBreakpoint(this, breakpointId, true, eventName);
-        this._nativeBreakpoints[breakpointId] = breakpoint;
-        this._updateNativeBreakpointsInSettings();
-        this.dispatchEventToListeners("event-listener-breakpoint-added", { breakpoint: breakpoint, eventName: eventName });
-        return breakpoint;
+        var breakpoint = new WebInspector.EventListenerBreakpoint(eventName);
+        this._setNativeBreakpoint(breakpointId, breakpoint, enabled, restored);
+
+        breakpoint.view = new WebInspector.EventListenerBreakpointView(this, breakpointId, enabled, eventName);
+        this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.EventListenerBreakpointAdded, breakpoint.view);
+    },
+
+    createXHRBreakpoint: function(url)
+    {
+        this._createXHRBreakpoint(url, true, false);
     },
 
-    createXHRBreakpoint: function(url, disabled)
+    _createXHRBreakpoint: function(url, enabled, restored)
     {
         var breakpointId = this._createXHRBreakpointId(url);
         if (breakpointId in this._nativeBreakpoints)
             return;
 
-        var breakpoint = new WebInspector.XHRBreakpoint(this, breakpointId, !disabled, url);
+        var breakpoint = new WebInspector.XHRBreakpoint(url);
+        this._setNativeBreakpoint(breakpointId, breakpoint, enabled, restored);
+
+        breakpoint.view = new WebInspector.XHRBreakpointView(this, breakpointId, enabled, url);
+        this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.XHRBreakpointAdded, breakpoint.view);
+    },
+
+    _setNativeBreakpoint: function(breakpointId, breakpoint, enabled, restored)
+    {
         this._nativeBreakpoints[breakpointId] = breakpoint;
-        this._updateNativeBreakpointsInSettings();
-        this.dispatchEventToListeners("xhr-breakpoint-added", breakpoint);
-        return breakpoint;
+        breakpoint.enabled = enabled;
+        if (restored)
+            return;
+        if (enabled)
+            breakpoint._enable();
+        this._saveBreakpoints();
     },
 
     _setNativeBreakpointEnabled: function(breakpointId, enabled)
     {
         var breakpoint = this._nativeBreakpoints[breakpointId];
-
+        if (breakpoint.enabled === enabled)
+            return;
         if (enabled)
             breakpoint._enable();
         else
             breakpoint._disable();
-
-        breakpoint._enabled = enabled;
-        this._updateNativeBreakpointsInSettings();
-        breakpoint.dispatchEventToListeners("enable-changed");
+        breakpoint.enabled = enabled;
+        this._saveBreakpoints();
     },
 
     _removeNativeBreakpoint: function(breakpointId)
     {
         var breakpoint = this._nativeBreakpoints[breakpointId];
-
         if (breakpoint.enabled)
             breakpoint._disable();
-
         delete this._nativeBreakpoints[breakpointId];
-        this._updateNativeBreakpointsInSettings();
-        breakpoint.dispatchEventToListeners("removed");
-    },
-
-    _updateNativeBreakpointsInSettings: function()
-    {
-        var breakpoints = [];
-        for (var id in this._nativeBreakpoints) {
-            var breakpoint = this._nativeBreakpoints[id];
-            breakpoints.push(breakpoint._serializeToJSON());
-        }
-        WebInspector.settings.nativeBreakpoints = breakpoints;
+        this._saveBreakpoints();
     },
 
     _nativeBreakpointHit: function(event)
@@ -138,30 +168,32 @@ WebInspector.BreakpointManager.prototype = {
         if (!breakpoint)
             return;
 
-        breakpoint.hit = true;
+        breakpoint.view.hit = true;
         this._lastHitBreakpoint = breakpoint;
-        this.dispatchEventToListeners("native-breakpoint-hit", { breakpoint: breakpoint, eventData: eventData });
+        this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.NativeBreakpointHit, { breakpoint: breakpoint.view, eventData: eventData });
     },
 
     _debuggerResumed: function(event)
     {
         if (!this._lastHitBreakpoint)
             return;
-        this._lastHitBreakpoint.hit = false;
+        this._lastHitBreakpoint.view.hit = false;
         delete this._lastHitBreakpoint;
     },
 
-    restoreBreakpoints: function()
+    _projectChanged: function(event)
     {
-        var breakpoints = this._persistentBreakpoints();
-        this._domBreakpoints = [];
+        this._nativeBreakpoints = {};
+        this._domBreakpointsRestored = false;
+        this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.ProjectChanged);
+
+        var breakpoints = this._stickyBreakpoints[WebInspector.settings.projectId] || [];
         for (var i = 0; i < breakpoints.length; ++i) {
-            if (breakpoints[i].type === WebInspector.BreakpointManager.NativeBreakpointTypes.DOM)
-                this._domBreakpoints.push(breakpoints[i]);
-            else if (breakpoints[i].type === WebInspector.BreakpointManager.NativeBreakpointTypes.EventListener)
-                this.createEventListenerBreakpoint(breakpoints[i].condition.eventName);
-            else if (breakpoints[i].type === WebInspector.BreakpointManager.NativeBreakpointTypes.XHR)
-                this.createXHRBreakpoint(breakpoints[i].condition.url, !breakpoints[i].enabled);
+            var breakpoint = breakpoints[i];
+            if (breakpoint.type === WebInspector.BreakpointManager.NativeBreakpointTypes.EventListener)
+                this._createEventListenerBreakpoint(breakpoint.condition.eventName, breakpoint.enabled, true);
+            else if (breakpoint.type === WebInspector.BreakpointManager.NativeBreakpointTypes.XHR)
+                this._createXHRBreakpoint(breakpoint.condition.url, breakpoint.enabled, true);
         }
     },
 
@@ -174,16 +206,18 @@ WebInspector.BreakpointManager.prototype = {
             if (pendingCalls)
                 return;
             for (var i = 0; i < breakpoints.length; ++i) {
-                if (breakpoints[i].type !== WebInspector.BreakpointManager.NativeBreakpointTypes.DOM)
-                    continue;
                 var breakpoint = breakpoints[i];
+                if (breakpoint.type !== WebInspector.BreakpointManager.NativeBreakpointTypes.DOM)
+                    continue;
                 var nodeId = pathToNodeId[breakpoint.condition.path];
                 if (nodeId)
-                    this.createDOMBreakpoint(nodeId, breakpoint.condition.type, !breakpoint.enabled);
+                    this._createDOMBreakpoint(nodeId, breakpoint.condition.type, breakpoint.enabled, true);
             }
+            this._domBreakpointsRestored = true;
+            this._saveBreakpoints();
         }
 
-        var breakpoints = this._domBreakpoints;
+        var breakpoints = this._stickyBreakpoints[WebInspector.settings.projectId] || [];
         var pathToNodeId = {};
         var pendingCalls = 0;
         for (var i = 0; i < breakpoints.length; ++i) {
@@ -196,20 +230,61 @@ WebInspector.BreakpointManager.prototype = {
             pendingCalls += 1;
             InspectorBackend.pushNodeByPathToFrontend(path, didPushNodeByPathToFrontend.bind(this, path));
         }
+        if (!pendingCalls)
+            this._domBreakpointsRestored = true;
     },
 
-    _persistentBreakpoints: function()
+    _saveBreakpoints: function()
     {
-        var result = [];
-        var breakpoints = WebInspector.settings.nativeBreakpoints;
-        if (breakpoints instanceof Array) {
-            for (var i = 0; i < breakpoints.length; ++i) {
-                var breakpoint = breakpoints[i];
-                if ("type" in breakpoint && "condition" in breakpoint)
-                    result.push(breakpoint)
+        var breakpoints = [];
+        for (var breakpointId in this._nativeBreakpoints) {
+            var breakpoint = this._nativeBreakpoints[breakpointId];
+            var persistentBreakpoint = breakpoint._serializeToJSON();
+            persistentBreakpoint.enabled = breakpoint.enabled;
+            breakpoints.push(persistentBreakpoint);
+        }
+        if (!this._domBreakpointsRestored) {
+            var stickyBreakpoints = this._stickyBreakpoints[WebInspector.settings.projectId] || [];
+            for (var i = 0; i < stickyBreakpoints.length; ++i) {
+                if (stickyBreakpoints[i].type === WebInspector.BreakpointManager.NativeBreakpointTypes.DOM)
+                    breakpoints.push(stickyBreakpoints[i]);
+            }
+        }
+        WebInspector.settings.nativeBreakpoints = breakpoints;
+
+        this._stickyBreakpoints[WebInspector.settings.projectId] = breakpoints;
+        InspectorBackend.setStickyBreakpoints(this._stickyBreakpoints);
+    },
+
+    _validateBreakpoints: function(persistentBreakpoints)
+    {
+        var breakpoints = [];
+        var breakpointsSet = {};
+        for (var i = 0; i < persistentBreakpoints.length; ++i) {
+            var breakpoint = persistentBreakpoints[i];
+            if (!("type" in breakpoint && "enabled" in breakpoint && "condition" in breakpoint))
+                continue;
+            var id = breakpoint.type + ":";
+            var condition = breakpoint.condition;
+            if (breakpoint.type === WebInspector.BreakpointManager.NativeBreakpointTypes.DOM) {
+                if (typeof condition.path !== "string" || typeof condition.type !== "number")
+                    continue;
+                id += condition.path + ":" + condition.type;
+            } else if (breakpoint.type === WebInspector.BreakpointManager.NativeBreakpointTypes.EventListener) {
+                if (typeof condition.eventName !== "string")
+                    continue;
+                id += condition.eventName;
+            } else if (breakpoint.type === WebInspector.BreakpointManager.NativeBreakpointTypes.XHR) {
+                if (typeof condition.url !== "string")
+                    continue;
+                id += condition.url;
             }
+            if (id in breakpointsSet)
+                continue;
+            breakpointsSet[id] = true;
+            breakpoints.push(breakpoint);
         }
-        return result;
+        return breakpoints;
     },
 
     _createDOMBreakpointId: function(nodeId, type)
@@ -225,17 +300,85 @@ WebInspector.BreakpointManager.prototype = {
     _createXHRBreakpointId: function(url)
     {
         return "xhr:" + url;
+    }
+}
+
+WebInspector.BreakpointManager.prototype.__proto__ = WebInspector.Object.prototype;
+
+WebInspector.DOMBreakpoint = function(node, type)
+{
+    this._nodeId = node.id;
+    this._path = node.path();
+    this._type = type;
+}
+
+WebInspector.DOMBreakpoint.prototype = {
+    _enable: function()
+    {
+        InspectorBackend.setDOMBreakpoint(this._nodeId, this._type);
     },
 
-    reset: function()
+    _disable: function()
     {
-        this._nativeBreakpoints = {};
+        InspectorBackend.removeDOMBreakpoint(this._nodeId, this._type);
+    },
+
+    _serializeToJSON: function()
+    {
+        var type = WebInspector.BreakpointManager.NativeBreakpointTypes.DOM;
+        return { type: type, condition: { path: this._path, type: this._type } };
     }
 }
 
-WebInspector.BreakpointManager.prototype.__proto__ = WebInspector.Object.prototype;
+WebInspector.EventListenerBreakpoint = function(eventName)
+{
+    this._eventName = eventName;
+}
+
+WebInspector.EventListenerBreakpoint.prototype = {
+    _enable: function()
+    {
+        InspectorBackend.setEventListenerBreakpoint(this._eventName);
+    },
+
+    _disable: function()
+    {
+        InspectorBackend.removeEventListenerBreakpoint(this._eventName);
+    },
+
+    _serializeToJSON: function()
+    {
+        var type = WebInspector.BreakpointManager.NativeBreakpointTypes.EventListener;
+        return { type: type, condition: { eventName: this._eventName } };
+    }
+}
+
+WebInspector.XHRBreakpoint = function(url)
+{
+    this._url = url;
+}
+
+WebInspector.XHRBreakpoint.prototype = {
+    _enable: function()
+    {
+        InspectorBackend.setXHRBreakpoint(this._url);
+    },
 
-WebInspector.NativeBreakpoint = function(manager, id, enabled)
+    _disable: function()
+    {
+        InspectorBackend.removeXHRBreakpoint(this._url);
+    },
+
+    _serializeToJSON: function()
+    {
+        var type = WebInspector.BreakpointManager.NativeBreakpointTypes.XHR;
+        return { type: type, condition: { url: this._url } };
+    }
+}
+
+
+
+WebInspector.NativeBreakpointView = function(manager, id, enabled)
 {
     this._manager = manager;
     this._id = id;
@@ -243,7 +386,7 @@ WebInspector.NativeBreakpoint = function(manager, id, enabled)
     this._hit = false;
 }
 
-WebInspector.NativeBreakpoint.prototype = {
+WebInspector.NativeBreakpointView.prototype = {
     get enabled()
     {
         return this._enabled;
@@ -252,6 +395,8 @@ WebInspector.NativeBreakpoint.prototype = {
     set enabled(enabled)
     {
         this._manager._setNativeBreakpointEnabled(this._id, enabled);
+        this._enabled = enabled;
+        this.dispatchEventToListeners("enable-changed");
     },
 
     get hit()
@@ -269,6 +414,7 @@ WebInspector.NativeBreakpoint.prototype = {
     {
         this._manager._removeNativeBreakpoint(this._id);
         this._onRemove();
+        this.dispatchEventToListeners("removed");
     },
 
     _compare: function(x, y)
@@ -283,22 +429,18 @@ WebInspector.NativeBreakpoint.prototype = {
     }
 }
 
-WebInspector.NativeBreakpoint.prototype.__proto__ = WebInspector.Object.prototype;
+WebInspector.NativeBreakpointView.prototype.__proto__ = WebInspector.Object.prototype;
 
-WebInspector.DOMBreakpoint = function(manager, id, enabled, node, type)
+WebInspector.DOMBreakpointView = function(manager, id, enabled, node, type)
 {
-    WebInspector.NativeBreakpoint.call(this, manager, id, enabled);
+    WebInspector.NativeBreakpointView.call(this, manager, id, enabled);
     this._node = node;
     this._nodeId = node.id;
-    this._path = node.path();
     this._type = type;
-    if (enabled)
-        this._enable();
-
     node.breakpoints[this._type] = this;
 }
 
-WebInspector.DOMBreakpoint.prototype = {
+WebInspector.DOMBreakpointView.prototype = {
     compareTo: function(other)
     {
         return this._compare(this._type, other._type);
@@ -344,51 +486,38 @@ WebInspector.DOMBreakpoint.prototype = {
             WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s.", substitutions, formatters, "", append);
     },
 
-    _enable: function()
-    {
-        InspectorBackend.setDOMBreakpoint(this._nodeId, this._type);
-    },
-
-    _disable: function()
-    {
-        InspectorBackend.removeDOMBreakpoint(this._nodeId, this._type);
-    },
-
-    _serializeToJSON: function()
-    {
-        var type = WebInspector.BreakpointManager.NativeBreakpointTypes.DOM;
-        return { type: type, enabled: this._enabled, condition: { path: this._path, type: this._type } };
-    },
-
     _onRemove: function()
     {
         delete this._node.breakpoints[this._type];
     }
 }
 
-WebInspector.DOMBreakpoint.prototype.__proto__ = WebInspector.NativeBreakpoint.prototype;
+WebInspector.DOMBreakpointView.prototype.__proto__ = WebInspector.NativeBreakpointView.prototype;
 
-WebInspector.EventListenerBreakpoint = function(manager, id, enabled, eventName)
+WebInspector.EventListenerBreakpointView = function(manager, id, enabled, eventName)
 {
-    WebInspector.NativeBreakpoint.call(this, manager, id, enabled);
+    WebInspector.NativeBreakpointView.call(this, manager, id, enabled);
     this._eventName = eventName;
-    if (enabled)
-        this._enable();
 }
 
-WebInspector.EventListenerBreakpoint.eventNameForUI = function(eventName)
+WebInspector.EventListenerBreakpointView.eventNameForUI = function(eventName)
 {
-    if (!WebInspector.EventListenerBreakpoint._eventNamesForUI) {
-        WebInspector.EventListenerBreakpoint._eventNamesForUI = {
+    if (!WebInspector.EventListenerBreakpointView._eventNamesForUI) {
+        WebInspector.EventListenerBreakpointView._eventNamesForUI = {
             "instrumentation:setTimer": WebInspector.UIString("Set Timer"),
             "instrumentation:clearTimer": WebInspector.UIString("Clear Timer"),
             "instrumentation:timerFired": WebInspector.UIString("Timer Fired")
         };
     }
-    return WebInspector.EventListenerBreakpoint._eventNamesForUI[eventName] || eventName.substring(eventName.indexOf(":") + 1);
+    return WebInspector.EventListenerBreakpointView._eventNamesForUI[eventName] || eventName.substring(eventName.indexOf(":") + 1);
 }
 
-WebInspector.EventListenerBreakpoint.prototype = {
+WebInspector.EventListenerBreakpointView.prototype = {
+    get eventName()
+    {
+        return this._eventName;
+    },
+
     compareTo: function(other)
     {
         return this._compare(this._eventName, other._eventName);
@@ -407,37 +536,19 @@ WebInspector.EventListenerBreakpoint.prototype = {
 
     _uiEventName: function()
     {
-        return WebInspector.EventListenerBreakpoint.eventNameForUI(this._eventName);
-    },
-
-    _enable: function()
-    {
-        InspectorBackend.setEventListenerBreakpoint(this._eventName);
-    },
-
-    _disable: function()
-    {
-        InspectorBackend.removeEventListenerBreakpoint(this._eventName);
-    },
-
-    _serializeToJSON: function()
-    {
-        var type = WebInspector.BreakpointManager.NativeBreakpointTypes.EventListener;
-        return { type: type, enabled: this._enabled, condition: { eventName: this._eventName } };
+        return WebInspector.EventListenerBreakpointView.eventNameForUI(this._eventName);
     }
 }
 
-WebInspector.EventListenerBreakpoint.prototype.__proto__ = WebInspector.NativeBreakpoint.prototype;
+WebInspector.EventListenerBreakpointView.prototype.__proto__ = WebInspector.NativeBreakpointView.prototype;
 
-WebInspector.XHRBreakpoint = function(manager, id, enabled, url)
+WebInspector.XHRBreakpointView = function(manager, id, enabled, url)
 {
-    WebInspector.NativeBreakpoint.call(this, manager, id, enabled);
+    WebInspector.NativeBreakpointView.call(this, manager, id, enabled);
     this._url = url;
-    if (enabled)
-        this._enable();
 }
 
-WebInspector.XHRBreakpoint.prototype = {
+WebInspector.XHRBreakpointView.prototype = {
     compareTo: function(other)
     {
         return this._compare(this._url, other._url);
@@ -463,26 +574,10 @@ WebInspector.XHRBreakpoint.prototype = {
     {
         var status = WebInspector.UIString("Paused on a XMLHttpRequest.");
         element.appendChild(document.createTextNode(status));
-    },
-
-    _enable: function()
-    {
-        InspectorBackend.setXHRBreakpoint(this._url);
-    },
-
-    _disable: function()
-    {
-        InspectorBackend.removeXHRBreakpoint(this._url);
-    },
-
-    _serializeToJSON: function()
-    {
-        var type = WebInspector.BreakpointManager.NativeBreakpointTypes.XHR;
-        return { type: type, enabled: this._enabled, condition: { url: this._url } };
     }
 }
 
-WebInspector.XHRBreakpoint.prototype.__proto__ = WebInspector.NativeBreakpoint.prototype;
+WebInspector.XHRBreakpointView.prototype.__proto__ = WebInspector.NativeBreakpointView.prototype;
 
 WebInspector.DOMBreakpointTypes = {
     SubtreeModified: 0,
diff --git a/WebCore/inspector/front-end/BreakpointsSidebarPane.js b/WebCore/inspector/front-end/BreakpointsSidebarPane.js
index e794b82..619525c 100644
--- a/WebCore/inspector/front-end/BreakpointsSidebarPane.js
+++ b/WebCore/inspector/front-end/BreakpointsSidebarPane.js
@@ -35,18 +35,11 @@ WebInspector.BreakpointsSidebarPane = function(title)
     this.emptyElement.textContent = WebInspector.UIString("No Breakpoints");
 
     this.bodyElement.appendChild(this.emptyElement);
+
+    WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.ProjectChanged, this._projectChanged, this);
 }
 
 WebInspector.BreakpointsSidebarPane.prototype = {
-    reset: function()
-    {
-        this.listElement.removeChildren();
-        if (this.listElement.parentElement) {
-            this.bodyElement.removeChild(this.listElement);
-            this.bodyElement.appendChild(this.emptyElement);
-        }
-    },
-
     addBreakpointItem: function(breakpointItem)
     {
         var element = breakpointItem.element;
@@ -97,6 +90,15 @@ WebInspector.BreakpointsSidebarPane.prototype = {
             this.bodyElement.removeChild(this.listElement);
             this.bodyElement.appendChild(this.emptyElement);
         }
+    },
+
+    _projectChanged: function()
+    {
+        this.listElement.removeChildren();
+        if (this.listElement.parentElement) {
+            this.bodyElement.removeChild(this.listElement);
+            this.bodyElement.appendChild(this.emptyElement);
+        }
     }
 }
 
@@ -259,7 +261,8 @@ WebInspector.EventListenerBreakpointsSidebarPane = function()
     this.categoriesTreeOutline = new TreeOutline(this.categoriesElement);
     this.bodyElement.appendChild(this.categoriesElement);
 
-    WebInspector.breakpointManager.addEventListener("event-listener-breakpoint-added", this._breakpointAdded, this);
+    WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.ProjectChanged, this._projectChanged, this);
+    WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.EventListenerBreakpointAdded, this._breakpointAdded, this);
 
     this._breakpointItems = {};
     this._createCategory("Keyboard", "listener", ["keydown", "keyup", "keypress", "textInput"]);
@@ -292,7 +295,7 @@ WebInspector.EventListenerBreakpointsSidebarPane.prototype = {
             var eventName = type + ":" + eventNames[i];
 
             var breakpointItem = {};
-            var title = WebInspector.EventListenerBreakpoint.eventNameForUI(eventName);
+            var title = WebInspector.EventListenerBreakpointView.eventNameForUI(eventName);
             breakpointItem.element = new TreeElement(title);
             categoryItem.element.appendChild(breakpointItem.element);
             var hitMarker = document.createElement("div");
@@ -342,10 +345,9 @@ WebInspector.EventListenerBreakpointsSidebarPane.prototype = {
 
     _breakpointAdded: function(event)
     {
-        var breakpoint = event.data.breakpoint;
-        var eventName = event.data.eventName;
+        var breakpoint = event.data;
 
-        var breakpointItem = this._breakpointItems[eventName];
+        var breakpointItem = this._breakpointItems[breakpoint.eventName];
         breakpointItem.breakpoint = breakpoint;
         breakpoint.addEventListener("hit-state-changed", this._breakpointHitStateChanged.bind(this, breakpointItem));
         breakpoint.addEventListener("removed", this._breakpointRemoved.bind(this, breakpointItem));
@@ -386,7 +388,7 @@ WebInspector.EventListenerBreakpointsSidebarPane.prototype = {
         categoryItem.checkbox.indeterminate = hasEnabled && hasDisabled;
     },
 
-    reset: function()
+    _projectChanged: function()
     {
         for (var eventName in this._breakpointItems) {
             var breakpointItem = this._breakpointItems[eventName];
diff --git a/WebCore/inspector/front-end/CallStackSidebarPane.js b/WebCore/inspector/front-end/CallStackSidebarPane.js
index 8b74126..265c80f 100644
--- a/WebCore/inspector/front-end/CallStackSidebarPane.js
+++ b/WebCore/inspector/front-end/CallStackSidebarPane.js
@@ -26,7 +26,7 @@
 WebInspector.CallStackSidebarPane = function()
 {
     WebInspector.SidebarPane.call(this, WebInspector.UIString("Call Stack"));
-    WebInspector.breakpointManager.addEventListener("native-breakpoint-hit", this._nativeBreakpointHit, this);
+    WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.NativeBreakpointHit, this._nativeBreakpointHit, this);
     WebInspector.debuggerModel.addEventListener("script-breakpoint-hit", this._scriptBreakpointHit, this);
 }
 
diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js
index a1c181f..d096fe9 100644
--- a/WebCore/inspector/front-end/ElementsPanel.js
+++ b/WebCore/inspector/front-end/ElementsPanel.js
@@ -170,9 +170,6 @@ WebInspector.ElementsPanel.prototype = {
         this.recentlyModifiedNodes = [];
 
         delete this.currentQuery;
-
-        if (Preferences.nativeInstrumentationEnabled)
-            this.sidebarPanes.domBreakpoints.reset();
     },
 
     setDocument: function(inspectedRootDocument)
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index 5aa4780..97d5443 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -443,15 +443,8 @@ WebInspector.ScriptsPanel.prototype = {
         this._sourceIDMap = {};
 
         this.sidebarPanes.watchExpressions.refreshExpressions();
-        if (!preserveItems) {
-            this.sidebarPanes.jsBreakpoints.reset();
-            if (Preferences.nativeInstrumentationEnabled) {
-                this.sidebarPanes.domBreakpoints.reset();
-                this.sidebarPanes.xhrBreakpoints.reset();
-                this.sidebarPanes.eventListenerBreakpoints.reset();
-            }
+        if (!preserveItems)
             this.sidebarPanes.workers.reset();
-        }
     },
 
     get visibleView()
diff --git a/WebCore/inspector/front-end/Settings.js b/WebCore/inspector/front-end/Settings.js
index 163b184..bc50ce9 100644
--- a/WebCore/inspector/front-end/Settings.js
+++ b/WebCore/inspector/front-end/Settings.js
@@ -70,6 +70,10 @@ WebInspector.Settings = function()
     this.installProjectSetting("nativeBreakpoints", []);
 }
 
+WebInspector.Settings.Events = {
+    ProjectChanged: "project-changed"
+}
+
 WebInspector.Settings.prototype = {
     installApplicationSetting: function(key, defaultValue)
     {
@@ -91,7 +95,31 @@ WebInspector.Settings.prototype = {
         var fragmentIndex = url.indexOf("#");
         if (fragmentIndex !== -1)
             url = url.substring(0, fragmentIndex);
-        this._inspectedURL = url;
+        this._projectId = url;
+        this.dispatchEventToListeners(WebInspector.Settings.Events.ProjectChanged);
+    },
+
+    get projectId()
+    {
+        return this._projectId;
+    },
+
+    findSettingForAllProjects: function(key)
+    {
+        var result = {};
+        var regexp = "^" + key + ":(.*)";
+        for (var i = 0; i < window.localStorage.length; ++i) {
+            var fullKey =  window.localStorage.key(i);
+            var match = fullKey.match(regexp);
+            if (!match)
+                continue;
+            try {
+                result[match[1]] = JSON.parse(window.localStorage[fullKey]);
+            } catch(e) {
+                window.localStorage.removeItem(fullKey);
+            }
+        }
+        return result;
     },
 
     _get: function(key, defaultValue)
@@ -123,7 +151,7 @@ WebInspector.Settings.prototype = {
 
     _formatProjectKey: function(key)
     {
-        return key + ":" + this._inspectedURL;
+        return key + ":" + this._projectId;
     }
 }
 
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 9009242..e2c8b7b 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -203,7 +203,7 @@ var WebInspector = {
         {
             pane.addBreakpointItem(new WebInspector.BreakpointItem(event.data));
         }
-        WebInspector.breakpointManager.addEventListener("dom-breakpoint-added", breakpointAdded);
+        WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.DOMBreakpointAdded, breakpointAdded);
         return pane;
     },
 
@@ -214,7 +214,7 @@ var WebInspector = {
         {
             pane.addBreakpointItem(new WebInspector.BreakpointItem(event.data));
         }
-        WebInspector.breakpointManager.addEventListener("xhr-breakpoint-added", breakpointAdded);
+        WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.XHRBreakpointAdded, breakpointAdded);
         return pane;
     },
 
@@ -1209,7 +1209,6 @@ WebInspector.searchingForNodeWasDisabled = function()
 WebInspector.reset = function()
 {
     this.debuggerModel.reset();
-    this.breakpointManager.reset();
 
     for (var panelName in this.panels) {
         var panel = this.panels[panelName];
@@ -1222,8 +1221,6 @@ WebInspector.reset = function()
 
     this.console.clearMessages();
     this.extensionServer.notifyInspectorReset();
-
-    this.breakpointManager.restoreBreakpoints();
 }
 
 WebInspector.bringToFront = function()
@@ -1236,10 +1233,6 @@ WebInspector.inspectedURLChanged = function(url)
     InspectorFrontendHost.inspectedURLChanged(url);
     this.settings.inspectedURLChanged(url);
     this.extensionServer.notifyInspectedURLChanged();
-    if (!this._breakpointsRestored) {
-        this.breakpointManager.restoreBreakpoints();
-        this._breakpointsRestored = true;
-    }
 }
 
 WebInspector.updateConsoleMessageExpiredCount = function(count)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list