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

Unified Diff: Source/WebCore/bindings/public/ScriptValueSerializer.h

Issue 8806015: Changes to support a second VM. (Closed) Base URL: svn://svn.chromium.org/dash/experimental/chrome/src/webkit-full
Patch Set: . Created 9 years 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
Index: Source/WebCore/bindings/public/ScriptValueSerializer.h
diff --git a/Source/WebCore/inspector/ScriptArguments.h b/Source/WebCore/bindings/public/ScriptValueSerializer.h
similarity index 62%
copy from Source/WebCore/inspector/ScriptArguments.h
copy to Source/WebCore/bindings/public/ScriptValueSerializer.h
index 26549b6d30b737fd43b0cbc043a56e8b78154aa9..525143774fabd3d8da934701a971ee63dbe30893 100644
--- a/Source/WebCore/inspector/ScriptArguments.h
+++ b/Source/WebCore/bindings/public/ScriptValueSerializer.h
@@ -1,10 +1,10 @@
/*
- * Copyright (c) 2010 Google Inc. All rights reserved.
- *
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -14,7 +14,7 @@
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -28,40 +28,26 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ScriptArguments_h
-#define ScriptArguments_h
-
-#include "PlatformString.h"
-#include "ScriptState.h"
-#include <wtf/Forward.h>
-#include <wtf/RefCounted.h>
-#include <wtf/Vector.h>
+#ifndef ScriptValueSerializer_h
+#define ScriptValueSerializer_h
namespace WebCore {
-class ScriptValue;
+class ScriptValueWriter;
-class ScriptArguments : public RefCounted<ScriptArguments> {
+class ScriptValueSerializer {
public:
- static PassRefPtr<ScriptArguments> create(ScriptState*, Vector<ScriptValue>& arguments);
-
- ~ScriptArguments();
-
- const ScriptValue& argumentAt(size_t) const;
- size_t argumentCount() const { return m_arguments.size(); }
-
- ScriptState* globalState() const;
+ virtual ~ScriptValueSerializer() { }
- bool getFirstArgumentAsString(WTF::String& result, bool checkForNullOrUndefined = false);
- bool isEqual(ScriptArguments*) const;
-
-private:
- ScriptArguments(ScriptState*, Vector<ScriptValue>& arguments);
+ virtual void serialize(ScriptValueWriter*) = 0;
+};
- ScriptStateProtectedPtr m_scriptState;
- Vector<ScriptValue> m_arguments;
+class ScriptValueWriter {
+public:
+ virtual void writeNull() = 0;
+ virtual void writeString(const char* data, int length) = 0;
};
} // namespace WebCore
-#endif // ScriptArguments_h
+#endif // ScriptValueSerializer_h

Powered by Google App Engine
This is Rietveld 408576698