Merge V8 API updates to xfa branch

Set pointers in internal fields directly instead of wrapping them
Review URL: https://codereview.chromium.org/1139853003

Use phantom handles instead of weak handles
Review URL: https://codereview.chromium.org/1129253004

Replace deprecated with non-deprecated V8 APIs
Review URL: https://codereview.chromium.org/1126203010

Add myself to OWNERS file
Review URL: https://codereview.chromium.org/1133333005

Replace v8::Handle with v8::Local and v8::Persistent with v8::Global
Review URL: https://codereview.chromium.org/1138823004

TBR=tsepez@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1140033004
diff --git a/fpdfsdk/include/javascript/JS_Define.h b/fpdfsdk/include/javascript/JS_Define.h
index e9475a0..8310ae2 100644
--- a/fpdfsdk/include/javascript/JS_Define.h
+++ b/fpdfsdk/include/javascript/JS_Define.h
@@ -69,7 +69,7 @@
     JS_Error(isolate, JSFormatErrorString(class_name_string, prop_name_string, sError));
     return;
   }
-  info.GetReturnValue().Set((v8::Handle<v8::Value>)value);
+  info.GetReturnValue().Set((v8::Local<v8::Value>)value);
 }
 
 template <class C, FX_BOOL (C::*M)(IFXJS_Context*, CJS_PropValue&, CFX_WideString&)>
@@ -255,7 +255,7 @@
       JS_Error(isolate, JSFormatErrorString(class_name, "GetProperty", sError));
       return;
   }
-  info.GetReturnValue().Set((v8::Handle<v8::Value>)value);
+  info.GetReturnValue().Set((v8::Local<v8::Value>)value);
 }
 
 template <class Alt>
@@ -445,6 +445,6 @@
 #define VALUE_NAME_NULL			L"null"
 #define VALUE_NAME_UNDEFINED	L"undefined"
 
-FXJSVALUETYPE GET_VALUE_TYPE(v8::Handle<v8::Value> p);
+FXJSVALUETYPE GET_VALUE_TYPE(v8::Local<v8::Value> p);
 
 #endif //_JS_DEFINE_H_
diff --git a/fpdfsdk/include/javascript/JS_Object.h b/fpdfsdk/include/javascript/JS_Object.h
index 02d2f57..a9ad018 100644
--- a/fpdfsdk/include/javascript/JS_Object.h
+++ b/fpdfsdk/include/javascript/JS_Object.h
@@ -46,6 +46,7 @@
 	virtual ~CJS_Object(void);
 
 	void						MakeWeak();
+        void                                            Dispose();
 
 	virtual FX_BOOL				IsType(FX_LPCSTR sClassName){return TRUE;};
 	virtual CFX_ByteString		GetClassName(){return "";};
@@ -66,7 +67,7 @@
 	v8::Isolate*					GetIsolate() {return m_pIsolate;}
 protected:
 	CJS_EmbedObj *				m_pEmbedObj;
-	v8::Persistent<v8::Object>			m_pObject;
+	v8::Global<v8::Object>			m_pObject;
 	v8::Isolate*					m_pIsolate;
 };
 
diff --git a/fpdfsdk/include/javascript/JS_Runtime.h b/fpdfsdk/include/javascript/JS_Runtime.h
index 07e4e43..0e824f9 100644
--- a/fpdfsdk/include/javascript/JS_Runtime.h
+++ b/fpdfsdk/include/javascript/JS_Runtime.h
@@ -58,7 +58,7 @@
 	v8::Isolate*							GetIsolate(){return m_isolate;};
 	void									SetIsolate(v8::Isolate* isolate){m_isolate = isolate;}
 
-	v8::Handle<v8::Context>					NewJSContext();
+	v8::Local<v8::Context>					NewJSContext();
 
 
 	virtual	FX_BOOL							GetHValueByName(FX_BSTR utf8Name, FXJSE_HVALUE hValue);
@@ -73,7 +73,7 @@
 
 	v8::Isolate* m_isolate;
 	nonstd::unique_ptr<CJS_ArrayBufferAllocator> m_pArrayBufferAllocator;
-	v8::Persistent<v8::Context> m_context;
+	v8::Global<v8::Context> m_context;
 };
 
 #endif //_JS_RUNTIME_H_
diff --git a/fpdfsdk/include/javascript/JS_Value.h b/fpdfsdk/include/javascript/JS_Value.h
index ecd0f83..faa612d 100644
--- a/fpdfsdk/include/javascript/JS_Value.h
+++ b/fpdfsdk/include/javascript/JS_Value.h
@@ -19,7 +19,7 @@
 {
 public:
 	CJS_Value(v8::Isolate* isolate);
-	CJS_Value(v8::Isolate* isolate, v8::Handle<v8::Value> pValue,FXJSVALUETYPE t);
+	CJS_Value(v8::Isolate* isolate, v8::Local<v8::Value> pValue,FXJSVALUETYPE t);
 	CJS_Value(v8::Isolate* isolate, const int &iValue);
 	CJS_Value(v8::Isolate* isolate, const double &dValue);
 	CJS_Value(v8::Isolate* isolate, const float &fValue);
@@ -34,7 +34,7 @@
 	~CJS_Value();
 
 	void SetNull();
-    void Attach(v8::Handle<v8::Value> pValue,FXJSVALUETYPE t);
+    void Attach(v8::Local<v8::Value> pValue,FXJSVALUETYPE t);
 	void Attach(CJS_Value *pValue);
 	void Detach();
 
@@ -46,9 +46,9 @@
 	CJS_Object* ToCJSObject() const;
 	CFX_WideString ToCFXWideString() const;
 	CFX_ByteString ToCFXByteString() const;
-	v8::Handle<v8::Object> ToV8Object() const;
-	v8::Handle<v8::Array> ToV8Array() const;
-	v8::Handle<v8::Value> ToV8Value() const;
+	v8::Local<v8::Object> ToV8Object() const;
+	v8::Local<v8::Array> ToV8Array() const;
+	v8::Local<v8::Value> ToV8Value() const;
 
 	void operator = (int iValue);
 	void operator = (bool bValue);
@@ -56,7 +56,7 @@
 	void operator = (float);
 	void operator = (CJS_Object*);
 	void operator = (CJS_Document*);
-	void operator = (v8::Handle<v8::Object>);
+	void operator = (v8::Local<v8::Object>);
 	void operator = (CJS_Array &);
 	void operator = (CJS_Date &);
 	void operator = (FX_LPCWSTR pWstr);
@@ -72,7 +72,7 @@
 
 	v8::Isolate* GetIsolate() {return m_isolate;}
 protected:
-	v8::Handle<v8::Value> m_pValue;
+	v8::Local<v8::Value> m_pValue;
 	FXJSVALUETYPE m_eType;
 	v8::Isolate* m_isolate;
 };
@@ -118,7 +118,7 @@
 	void operator<<(CJS_Array& array);
 	void operator<<(CJS_Date& date);
 	void operator>>(CJS_Date& date) const;
-	operator v8::Handle<v8::Value>() const;
+	operator v8::Local<v8::Value>() const;
 	void StartSetting();
 	void StartGetting();
 private:
@@ -131,16 +131,16 @@
 	CJS_Array(v8::Isolate* isolate);
 	virtual ~CJS_Array();
 
-	void Attach(v8::Handle<v8::Array> pArray);
+	void Attach(v8::Local<v8::Array> pArray);
 	void GetElement(unsigned index,CJS_Value &value);
 	void SetElement(unsigned index,CJS_Value value);
     int GetLength();
 	FX_BOOL IsAttached();
-	operator v8::Handle<v8::Array>();
+	operator v8::Local<v8::Array>();
 
 	v8::Isolate* GetIsolate() {return m_isolate;}
 private:
-	v8::Handle<v8::Array> m_pArray;
+	v8::Local<v8::Array> m_pArray;
 	v8::Isolate* m_isolate;
 };
 
@@ -152,7 +152,7 @@
 	CJS_Date(v8::Isolate* isolate,double dMsec_time);
 	CJS_Date(v8::Isolate* isolate,int year, int mon, int day,int hour, int min, int sec);
 	virtual ~CJS_Date();
-	void Attach(v8::Handle<v8::Value> pDate);
+	void Attach(v8::Local<v8::Value> pDate);
 
 	int     GetYear();
 	void    SetYear(int iYear);
@@ -172,7 +172,7 @@
 	int     GetSeconds();
 	void    SetSeconds(int seconds);
 
-	operator v8::Handle<v8::Value>();
+	operator v8::Local<v8::Value>();
 	operator double() const;
 
 	CFX_WideString	ToString() const;
@@ -182,7 +182,7 @@
 	FX_BOOL	IsValidDate();
 
 protected:
-	v8::Handle<v8::Value> m_pDate;
+	v8::Local<v8::Value> m_pDate;
 	v8::Isolate* m_isolate;
 };
 
diff --git a/fpdfsdk/include/javascript/global.h b/fpdfsdk/include/javascript/global.h
index 9ee9f42..2690f68 100644
--- a/fpdfsdk/include/javascript/global.h
+++ b/fpdfsdk/include/javascript/global.h
@@ -33,7 +33,7 @@
 	double				dData;
 	bool				bData;
 	CFX_ByteString		sData;
-	v8::Persistent<v8::Object>  pData;
+	v8::Global<v8::Object>  pData;
 	bool				bPersistent;
 	bool				bDeleted;
 };
@@ -61,8 +61,8 @@
 	FX_BOOL						SetGlobalVariables(FX_LPCSTR propname, int nType, 
 									double dData, bool bData, const CFX_ByteString& sData, JSObject pData, bool bDefaultPersistent);
 
-	void						ObjectToArray(v8::Handle<v8::Object> pObj, CJS_GlobalVariableArray& array);
-	void						PutObjectProperty(v8::Handle<v8::Object> obj, CJS_KeyValue* pData);
+	void						ObjectToArray(v8::Local<v8::Object> pObj, CJS_GlobalVariableArray& array);
+	void						PutObjectProperty(v8::Local<v8::Object> obj, CJS_KeyValue* pData);
 
 private:
 	CFX_MapByteStringToPtr		m_mapGlobal;