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

Unified Diff: Source/bindings/v8/ScriptValue.h

Issue 147333004: Revert of Limit the usage of SharedPersistent to ScriptValue only (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 | « Source/bindings/v8/ScriptController.cpp ('k') | Source/bindings/v8/SharedPersistent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ScriptValue.h
diff --git a/Source/bindings/v8/ScriptValue.h b/Source/bindings/v8/ScriptValue.h
index d3e2509621a917fb18e0f8fd650c64063f5e8bda..124ea110c3a81f88e4a2aef6efb7731469c3ec17 100644
--- a/Source/bindings/v8/ScriptValue.h
+++ b/Source/bindings/v8/ScriptValue.h
@@ -31,8 +31,8 @@
#ifndef ScriptValue_h
#define ScriptValue_h
-#include "bindings/v8/ScopedPersistent.h"
-#include "wtf/RefCounted.h"
+#include "bindings/v8/SharedPersistent.h"
+#include "wtf/PassRefPtr.h"
#include "wtf/RefPtr.h"
#include "wtf/text/WTFString.h"
#include <v8.h>
@@ -52,7 +52,7 @@
ScriptValue(v8::Handle<v8::Value> value, v8::Isolate* isolate)
: m_isolate(isolate)
- , m_value(value.IsEmpty() ? 0 : SharedPersistent::create(value, isolate))
+ , m_value(value.IsEmpty() ? 0 : SharedPersistent<v8::Value>::create(value, isolate))
{
}
@@ -165,37 +165,8 @@
PassRefPtr<JSONValue> toJSONValue(ScriptState*) const;
private:
- class SharedPersistent : public RefCounted<SharedPersistent> {
- WTF_MAKE_NONCOPYABLE(SharedPersistent);
- public:
- static PassRefPtr<SharedPersistent> create(v8::Handle<v8::Value> value, v8::Isolate* isolate)
- {
- return adoptRef(new SharedPersistent(value, isolate));
- }
-
- v8::Local<v8::Value> newLocal(v8::Isolate* isolate) const
- {
- return m_value.newLocal(isolate);
- }
-
- bool isEmpty() { return m_value.isEmpty(); }
-
- bool operator==(const SharedPersistent& other)
- {
- return m_value == other.m_value;
- }
-
- private:
- SharedPersistent(v8::Handle<v8::Value> value, v8::Isolate* isolate)
- : m_value(isolate, value)
- {
- }
-
- ScopedPersistent<v8::Value> m_value;
- };
-
mutable v8::Isolate* m_isolate;
- RefPtr<SharedPersistent> m_value;
+ RefPtr<SharedPersistent<v8::Value> > m_value;
};
} // namespace WebCore
« no previous file with comments | « Source/bindings/v8/ScriptController.cpp ('k') | Source/bindings/v8/SharedPersistent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698