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

Unified Diff: webkit/pending/NodeIterator.cpp

Issue 4097: Implement better JS exception handling by abstracting KJS::ExecState into an ... (Closed) Base URL: svn://chrome-svn/chrome/branches/chrome_webkit_merge_branch/
Patch Set: '' Created 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/pending/NodeIterator.h ('k') | webkit/pending/ScriptController.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/pending/NodeIterator.cpp
===================================================================
--- webkit/pending/NodeIterator.cpp (revision 2614)
+++ webkit/pending/NodeIterator.cpp (working copy)
@@ -25,13 +25,11 @@
#include "config.h"
#include "NodeIterator.h"
-#include <kjs/ExecState.h>
#include "Document.h"
#include "ExceptionCode.h"
+#include "ExceptionContext.h"
#include "NodeFilter.h"
-using namespace KJS;
-
namespace WebCore {
NodeIterator::NodePointer::NodePointer()
@@ -86,8 +84,7 @@
root()->document()->detachNodeIterator(this);
}
-#if USE(JSC)
-PassRefPtr<Node> NodeIterator::nextNode(ExecState* exec, ExceptionCode& ec)
+PassRefPtr<Node> NodeIterator::nextNode(ExceptionContext* exec, ExceptionCode& ec)
{
if (m_detached) {
ec = INVALID_STATE_ERR;
@@ -116,7 +113,7 @@
return result.release();
}
-PassRefPtr<Node> NodeIterator::previousNode(ExecState* exec, ExceptionCode& ec)
+PassRefPtr<Node> NodeIterator::previousNode(ExceptionContext* exec, ExceptionCode& ec)
{
if (m_detached) {
ec = INVALID_STATE_ERR;
@@ -144,7 +141,6 @@
m_candidateNode.clear();
return result.release();
}
-#endif
void NodeIterator::detach()
{
@@ -228,5 +224,14 @@
}
}
+PassRefPtr<Node> NodeIterator::nextNode(ExceptionCode& ec)
+{
+ return nextNode(ExceptionContext::createFromNode(referenceNode()), ec);
+}
+PassRefPtr<Node> NodeIterator::previousNode(ExceptionCode& ec)
+{
+ return previousNode(ExceptionContext::createFromNode(referenceNode()), ec);
+}
+
} // namespace WebCore
« no previous file with comments | « webkit/pending/NodeIterator.h ('k') | webkit/pending/ScriptController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698