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

Side by Side Diff: fpdfsdk/src/javascript/JS_Value.cpp

Issue 688303003: For v8 Global Object, do not copy in CJS_Value constructor. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: whitespace Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « fpdfsdk/include/javascript/JS_Value.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../include/javascript/JavaScript.h" 7 #include "../../include/javascript/JavaScript.h"
8 #include "../../include/javascript/JS_Define.h" 8 #include "../../include/javascript/JS_Define.h"
9 #include "../../include/javascript/JS_Object.h" 9 #include "../../include/javascript/JS_Object.h"
10 #include "../../include/javascript/JS_Value.h" 10 #include "../../include/javascript/JS_Value.h"
11 #include "../../include/javascript/Document.h"
11 12
12 /* ---------------------------- CJS_Value ---------------------------- */ 13 /* ---------------------------- CJS_Value ---------------------------- */
13 14
14 CJS_Value::CJS_Value(v8::Isolate* isolate) : m_eType(VT_unknown),m_isolate(isola te) 15 CJS_Value::CJS_Value(v8::Isolate* isolate) : m_eType(VT_unknown),m_isolate(isola te)
15 { 16 {
16 } 17 }
17 CJS_Value::CJS_Value(v8::Isolate* isolate, v8::Handle<v8::Value> pValue,FXJSVALU ETYPE t) : 18 CJS_Value::CJS_Value(v8::Isolate* isolate, v8::Handle<v8::Value> pValue,FXJSVALU ETYPE t) :
18 m_pValue(pValue), m_eType(t), m_isolate(isolate) 19 m_pValue(pValue), m_eType(t), m_isolate(isolate)
19 { 20 {
20 } 21 }
(...skipping 16 matching lines...) Expand all
37 CJS_Value::CJS_Value(v8::Isolate* isolate, const double &dValue):m_isolate(isola te) 38 CJS_Value::CJS_Value(v8::Isolate* isolate, const double &dValue):m_isolate(isola te)
38 { 39 {
39 operator =(dValue); 40 operator =(dValue);
40 } 41 }
41 42
42 CJS_Value::CJS_Value(v8::Isolate* isolate, JSFXObject pJsObj):m_isolate(isolate ) 43 CJS_Value::CJS_Value(v8::Isolate* isolate, JSFXObject pJsObj):m_isolate(isolate )
43 { 44 {
44 operator =(pJsObj); 45 operator =(pJsObj);
45 } 46 }
46 47
47 CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Object * pJsObj):m_isolate(isolat e) 48 CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Object* pJsObj):m_isolate(isolate )
48 { 49 {
49 operator =(pJsObj); 50 operator =(pJsObj);
50 } 51 }
51 52
53 CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Document* pJsDoc):m_isolate(isola te)
54 {
55 m_eType = VT_object;
56 if (pJsDoc)
57 m_pValue = (JSFXObject)*pJsDoc;
58 }
59
52 CJS_Value::CJS_Value(v8::Isolate* isolate, FX_LPCWSTR pWstr):m_isolate(isolate) 60 CJS_Value::CJS_Value(v8::Isolate* isolate, FX_LPCWSTR pWstr):m_isolate(isolate)
53 { 61 {
54 operator =(pWstr); 62 operator =(pWstr);
55 } 63 }
56 64
57 CJS_Value::CJS_Value(v8::Isolate* isolate, FX_LPCSTR pStr):m_isolate(isolate) 65 CJS_Value::CJS_Value(v8::Isolate* isolate, FX_LPCSTR pStr):m_isolate(isolate)
58 { 66 {
59 operator = (pStr); 67 operator = (pStr);
60 } 68 }
61 69
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 return 0.0; 643 return 0.0;
636 return JS_ToNumber(m_pDate); 644 return JS_ToNumber(m_pDate);
637 } 645 }
638 646
639 CFX_WideString CJS_Date::ToString() const 647 CFX_WideString CJS_Date::ToString() const
640 { 648 {
641 if(m_pDate.IsEmpty()) 649 if(m_pDate.IsEmpty())
642 return L""; 650 return L"";
643 return JS_ToString(m_pDate); 651 return JS_ToString(m_pDate);
644 } 652 }
OLDNEW
« no previous file with comments | « fpdfsdk/include/javascript/JS_Value.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698