Commit 9674a7b1 authored by dcarney@chromium.org's avatar dcarney@chromium.org

convert remainder of v8.h to use V8_DEPRECATED

R=danno@chromium.org
BUG=

Review URL: https://codereview.chromium.org/25173005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17016 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a81d7b1e
...@@ -584,8 +584,9 @@ template <class T, class M> class Persistent { ...@@ -584,8 +584,9 @@ template <class T, class M> class Persistent {
*/ */
template <class S, class M2> template <class S, class M2>
V8_INLINE void Reset(Isolate* isolate, const Persistent<S, M2>& other); V8_INLINE void Reset(Isolate* isolate, const Persistent<S, M2>& other);
// TODO(dcarney): deprecate
V8_INLINE void Dispose() { Reset(); } V8_DEPRECATED("Use Reset instead",
V8_INLINE void Dispose()) { Reset(); }
V8_INLINE bool IsEmpty() const { return val_ == 0; } V8_INLINE bool IsEmpty() const { return val_ == 0; }
...@@ -641,17 +642,19 @@ template <class T, class M> class Persistent { ...@@ -641,17 +642,19 @@ template <class T, class M> class Persistent {
P* parameter, P* parameter,
typename WeakCallbackData<S, P>::Callback callback); typename WeakCallbackData<S, P>::Callback callback);
// TODO(dcarney): deprecate
template<typename S, typename P> template<typename S, typename P>
V8_DEPRECATED(
"Use SetWeak instead",
V8_INLINE void MakeWeak( V8_INLINE void MakeWeak(
P* parameter, P* parameter,
typename WeakReferenceCallbacks<S, P>::Revivable callback); typename WeakReferenceCallbacks<S, P>::Revivable callback));
// TODO(dcarney): deprecate
template<typename P> template<typename P>
V8_DEPRECATED(
"Use SetWeak instead",
V8_INLINE void MakeWeak( V8_INLINE void MakeWeak(
P* parameter, P* parameter,
typename WeakReferenceCallbacks<T, P>::Revivable callback); typename WeakReferenceCallbacks<T, P>::Revivable callback));
V8_INLINE void ClearWeak(); V8_INLINE void ClearWeak();
...@@ -693,11 +696,11 @@ template <class T, class M> class Persistent { ...@@ -693,11 +696,11 @@ template <class T, class M> class Persistent {
*/ */
V8_INLINE uint16_t WrapperClassId() const; V8_INLINE uint16_t WrapperClassId() const;
// TODO(dcarney): remove V8_DEPRECATED("This will be removed",
V8_INLINE T* ClearAndLeak(); V8_INLINE T* ClearAndLeak());
// TODO(dcarney): remove V8_DEPRECATED("This will be removed",
V8_INLINE void Clear() { val_ = 0; } V8_INLINE void Clear()) { val_ = 0; }
// TODO(dcarney): remove // TODO(dcarney): remove
#ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR #ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR
...@@ -742,8 +745,9 @@ class V8_EXPORT HandleScope { ...@@ -742,8 +745,9 @@ class V8_EXPORT HandleScope {
~HandleScope(); ~HandleScope();
// TODO(dcarney): deprecated - use EscapableHandleScope::Escape. template <class T>
template <class T> Local<T> Close(Handle<T> value); V8_DEPRECATED("Use EscapableHandleScope::Escape instead",
Local<T> Close(Handle<T> value));
/** /**
* Counts the number of allocated handles. * Counts the number of allocated handles.
...@@ -1033,9 +1037,8 @@ class V8_EXPORT Script { ...@@ -1033,9 +1037,8 @@ class V8_EXPORT Script {
/** /**
* Returns the script id value. * Returns the script id value.
* DEPRECATED: Please use GetId().
*/ */
Local<Value> Id(); V8_DEPRECATED("Use GetId instead", Local<Value> Id());
/** /**
* Returns the script id. * Returns the script id.
...@@ -1821,15 +1824,17 @@ class V8_EXPORT String : public Primitive { ...@@ -1821,15 +1824,17 @@ class V8_EXPORT String : public Primitive {
*/ */
bool CanMakeExternal(); bool CanMakeExternal();
// TODO(dcarney): deprecate
/** Creates an undetectable string from the supplied ASCII or UTF-8 data.*/ /** Creates an undetectable string from the supplied ASCII or UTF-8 data.*/
V8_DEPRECATED(
"Use NewFromUtf8 instead",
V8_INLINE static Local<String> NewUndetectable(const char* data, V8_INLINE static Local<String> NewUndetectable(const char* data,
int length = -1); int length = -1));
// TODO(dcarney): deprecate
/** Creates an undetectable string from the supplied 16-bit character codes.*/ /** Creates an undetectable string from the supplied 16-bit character codes.*/
V8_DEPRECATED(
"Use NewFromTwoByte instead",
V8_INLINE static Local<String> NewUndetectable(const uint16_t* data, V8_INLINE static Local<String> NewUndetectable(const uint16_t* data,
int length = -1); int length = -1));
/** /**
* Converts an object to a UTF-8-encoded character array. Useful if * Converts an object to a UTF-8-encoded character array. Useful if
...@@ -1863,8 +1868,8 @@ class V8_EXPORT String : public Primitive { ...@@ -1863,8 +1868,8 @@ class V8_EXPORT String : public Primitive {
*/ */
class V8_EXPORT AsciiValue { class V8_EXPORT AsciiValue {
public: public:
// TODO(dcarney): deprecate V8_DEPRECATED("Use Utf8Value instead",
explicit AsciiValue(Handle<v8::Value> obj); explicit AsciiValue(Handle<v8::Value> obj));
~AsciiValue(); ~AsciiValue();
char* operator*() { return str_; } char* operator*() { return str_; }
const char* operator*() const { return str_; } const char* operator*() const { return str_; }
...@@ -2483,9 +2488,8 @@ class V8_EXPORT Function : public Object { ...@@ -2483,9 +2488,8 @@ class V8_EXPORT Function : public Object {
/** /**
* Returns scriptId object. * Returns scriptId object.
* DEPRECATED: use ScriptId() instead.
*/ */
Handle<Value> GetScriptId() const; V8_DEPRECATED("Use ScriptId instead", Handle<Value> GetScriptId()) const;
/** /**
* Returns scriptId. * Returns scriptId.
...@@ -2847,9 +2851,9 @@ class V8_EXPORT Date : public Object { ...@@ -2847,9 +2851,9 @@ class V8_EXPORT Date : public Object {
public: public:
static Local<Value> New(double time); static Local<Value> New(double time);
// Deprecated, use Date::ValueOf() instead. V8_DEPRECATED(
// TODO(svenpanne) Actually deprecate when Chrome is adapted. "Use ValueOf instead",
double NumberValue() const { return ValueOf(); } double NumberValue()) const { return ValueOf(); }
/** /**
* A specialization of Value::NumberValue that is more efficient * A specialization of Value::NumberValue that is more efficient
...@@ -2885,9 +2889,9 @@ class V8_EXPORT NumberObject : public Object { ...@@ -2885,9 +2889,9 @@ class V8_EXPORT NumberObject : public Object {
public: public:
static Local<Value> New(double value); static Local<Value> New(double value);
// Deprecated, use NumberObject::ValueOf() instead. V8_DEPRECATED(
// TODO(svenpanne) Actually deprecate when Chrome is adapted. "Use ValueOf instead",
double NumberValue() const { return ValueOf(); } double NumberValue()) const { return ValueOf(); }
/** /**
* Returns the Number held by the object. * Returns the Number held by the object.
...@@ -2908,9 +2912,9 @@ class V8_EXPORT BooleanObject : public Object { ...@@ -2908,9 +2912,9 @@ class V8_EXPORT BooleanObject : public Object {
public: public:
static Local<Value> New(bool value); static Local<Value> New(bool value);
// Deprecated, use BooleanObject::ValueOf() instead. V8_DEPRECATED(
// TODO(svenpanne) Actually deprecate when Chrome is adapted. "Use ValueOf instead",
bool BooleanValue() const { return ValueOf(); } bool BooleanValue()) const { return ValueOf(); }
/** /**
* Returns the Boolean held by the object. * Returns the Boolean held by the object.
...@@ -2931,9 +2935,9 @@ class V8_EXPORT StringObject : public Object { ...@@ -2931,9 +2935,9 @@ class V8_EXPORT StringObject : public Object {
public: public:
static Local<Value> New(Handle<String> value); static Local<Value> New(Handle<String> value);
// Deprecated, use StringObject::ValueOf() instead. V8_DEPRECATED(
// TODO(svenpanne) Actually deprecate when Chrome is adapted. "Use ValueOf instead",
Local<String> StringValue() const { return ValueOf(); } Local<String> StringValue()) const { return ValueOf(); }
/** /**
* Returns the String held by the object. * Returns the String held by the object.
...@@ -2956,9 +2960,9 @@ class V8_EXPORT SymbolObject : public Object { ...@@ -2956,9 +2960,9 @@ class V8_EXPORT SymbolObject : public Object {
public: public:
static Local<Value> New(Isolate* isolate, Handle<Symbol> value); static Local<Value> New(Isolate* isolate, Handle<Symbol> value);
// Deprecated, use SymbolObject::ValueOf() instead. V8_DEPRECATED(
// TODO(svenpanne) Actually deprecate when Chrome is adapted. "Use ValueOf instead",
Local<Symbol> SymbolValue() const { return ValueOf(); } Local<Symbol> SymbolValue()) const { return ValueOf(); }
/** /**
* Returns the Symbol held by the object. * Returns the Symbol held by the object.
...@@ -3785,8 +3789,9 @@ typedef void (*FatalErrorCallback)(const char* location, const char* message); ...@@ -3785,8 +3789,9 @@ typedef void (*FatalErrorCallback)(const char* location, const char* message);
typedef void (*MessageCallback)(Handle<Message> message, Handle<Value> error); typedef void (*MessageCallback)(Handle<Message> message, Handle<Value> error);
// TODO(dcarney): remove. Use Isolate::ThrowException instead. V8_DEPRECATED(
Handle<Value> V8_EXPORT ThrowException(Handle<Value> exception); "Use Isolate::ThrowException instead",
Handle<Value> V8_EXPORT ThrowException(Handle<Value> exception));
/** /**
* Create new error objects by calling the corresponding error object * Create new error objects by calling the corresponding error object
...@@ -4587,10 +4592,10 @@ class V8_EXPORT V8 { ...@@ -4587,10 +4592,10 @@ class V8_EXPORT V8 {
static void SetJitCodeEventHandler(JitCodeEventOptions options, static void SetJitCodeEventHandler(JitCodeEventOptions options,
JitCodeEventHandler event_handler); JitCodeEventHandler event_handler);
// TODO(svenpanne) Really deprecate me when Chrome is fixed. V8_DEPRECATED(
/** Deprecated. Use Isolate::AdjustAmountOfExternalAllocatedMemory instead. */ "Use Isolate::AdjustAmountOfExternalAllocatedMemory instead",
static intptr_t AdjustAmountOfExternalAllocatedMemory( static intptr_t AdjustAmountOfExternalAllocatedMemory(
intptr_t change_in_bytes); intptr_t change_in_bytes));
/** /**
* Forcefully terminate the current thread of JavaScript execution * Forcefully terminate the current thread of JavaScript execution
...@@ -4980,9 +4985,8 @@ class V8_EXPORT Context { ...@@ -4980,9 +4985,8 @@ class V8_EXPORT Context {
/** Returns true if the context has experienced an out of memory situation. */ /** Returns true if the context has experienced an out of memory situation. */
bool HasOutOfMemoryException(); bool HasOutOfMemoryException();
// TODO(dcarney) Remove this function. V8_DEPRECATED("Use Isolate::InContext instead",
/** Deprecated. Use Isolate::InContext instead. */ static bool InContext());
static bool InContext();
/** Returns an isolate associated with a current context. */ /** Returns an isolate associated with a current context. */
v8::Isolate* GetIsolate(); v8::Isolate* GetIsolate();
...@@ -5053,8 +5057,9 @@ class V8_EXPORT Context { ...@@ -5053,8 +5057,9 @@ class V8_EXPORT Context {
explicit V8_INLINE Scope(Handle<Context> context) : context_(context) { explicit V8_INLINE Scope(Handle<Context> context) : context_(context) {
context_->Enter(); context_->Enter();
} }
// TODO(dcarney): deprecate V8_DEPRECATED(
V8_INLINE Scope(Isolate* isolate, Persistent<Context>& context) // NOLINT "Use Handle version instead",
V8_INLINE Scope(Isolate* isolate, Persistent<Context>& context)) // NOLINT
: context_(Handle<Context>::New(isolate, context)) { : context_(Handle<Context>::New(isolate, context)) {
context_->Enter(); context_->Enter();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment