blob: afc6db6ae58ba5cd963ebe46a0072d736da90432 [file] [log] [blame]
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001// Copyright 2014 PDFium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
Lei Zhanga6d9f0e2015-06-13 00:48:38 -07004
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07005// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#include "../../include/javascript/JavaScript.h"
8#include "../../include/javascript/IJavaScript.h"
9#include "../../include/javascript/JS_EventHandler.h"
10#include "../../include/javascript/JS_Runtime.h"
11#include "../../include/javascript/JS_Context.h"
12#include "../../include/javascript/JS_Define.h"
13#include "../../include/javascript/JS_Object.h"
14#include "../../include/javascript/JS_Value.h"
15#include "../../include/javascript/Document.h"
16#include "../../include/javascript/app.h"
17#include "../../include/javascript/color.h"
18#include "../../include/javascript/Consts.h"
19#include "../../include/javascript/Document.h"
20#include "../../include/javascript/event.h"
21#include "../../include/javascript/Field.h"
22#include "../../include/javascript/Icon.h"
23#include "../../include/javascript/PublicMethods.h"
24#include "../../include/javascript/report.h"
25#include "../../include/javascript/util.h"
26#include "../../include/javascript/JS_GlobalData.h"
27#include "../../include/javascript/global.h"
28#include "../../include/javascript/console.h"
Bo Xufdc00a72014-10-28 23:03:33 -070029#include "../../include/fpdfxfa/fpdfxfa_app.h"
Bo Xufdc00a72014-10-28 23:03:33 -070030#include "../../../xfa/src/fxjse/src/value.h"
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070031
Nico Weber9d8ec5a2015-08-04 13:00:21 -070032CJS_RuntimeFactory::~CJS_RuntimeFactory() {}
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070033
Nico Weber9d8ec5a2015-08-04 13:00:21 -070034IFXJS_Runtime* CJS_RuntimeFactory::NewJSRuntime(CPDFDoc_Environment* pApp) {
35 if (!m_bInit) {
36 unsigned int embedderDataSlot = 0;
37 if (pApp->GetFormFillInfo()->m_pJsPlatform->version >= 2) {
38 embedderDataSlot =
39 pApp->GetFormFillInfo()->m_pJsPlatform->m_v8EmbedderSlot;
Tom Sepez2f2ffec2015-07-23 14:42:09 -070040 }
Nico Weber9d8ec5a2015-08-04 13:00:21 -070041 JS_Initial(embedderDataSlot);
42 m_bInit = TRUE;
43 }
44 return new CJS_Runtime(pApp);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070045}
Nico Weber9d8ec5a2015-08-04 13:00:21 -070046void CJS_RuntimeFactory::AddRef() {
47 // to do.Should be implemented as atom manipulation.
48 m_nRef++;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070049}
Nico Weber9d8ec5a2015-08-04 13:00:21 -070050void CJS_RuntimeFactory::Release() {
51 if (m_bInit) {
52 // to do.Should be implemented as atom manipulation.
53 if (--m_nRef == 0) {
54 JS_Release();
Nico Weber9d8ec5a2015-08-04 13:00:21 -070055 m_bInit = FALSE;
Tom Sepez2f2ffec2015-07-23 14:42:09 -070056 }
Nico Weber9d8ec5a2015-08-04 13:00:21 -070057 }
58}
59
60void CJS_RuntimeFactory::DeleteJSRuntime(IFXJS_Runtime* pRuntime) {
61 delete (CJS_Runtime*)pRuntime;
62}
63
Tom Sepezd2cc1b92015-04-30 15:19:03 -070064void* CJS_ArrayBufferAllocator::Allocate(size_t length) {
Nico Weber9d8ec5a2015-08-04 13:00:21 -070065 return calloc(1, length);
Tom Sepezd2cc1b92015-04-30 15:19:03 -070066}
67
68void* CJS_ArrayBufferAllocator::AllocateUninitialized(size_t length) {
Nico Weber9d8ec5a2015-08-04 13:00:21 -070069 return malloc(length);
Tom Sepezd2cc1b92015-04-30 15:19:03 -070070}
71
72void CJS_ArrayBufferAllocator::Free(void* data, size_t length) {
Nico Weber9d8ec5a2015-08-04 13:00:21 -070073 free(data);
Tom Sepezd2cc1b92015-04-30 15:19:03 -070074}
75
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070076/* ------------------------------ CJS_Runtime ------------------------------ */
Tom Sepez808a99e2015-09-10 12:28:37 -070077v8::Global<v8::ObjectTemplate>& _getGlobalObjectTemplate(v8::Isolate* pIsolate);
78
Nico Weber9d8ec5a2015-08-04 13:00:21 -070079CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp)
80 : m_pApp(pApp),
81 m_pDocument(NULL),
82 m_bBlocking(FALSE),
83 m_pFieldEventPath(NULL),
Jochen Eisinger29007842015-08-05 09:02:13 +020084 m_isolate(NULL),
85 m_isolateManaged(false) {
Nico Weber9d8ec5a2015-08-04 13:00:21 -070086 if (CPDFXFA_App::GetInstance()->GetJSERuntime()) {
87 // TODO(tsepez): CPDFXFA_App should also use the embedder provided isolate.
88 m_isolate = (v8::Isolate*)CPDFXFA_App::GetInstance()->GetJSERuntime();
89 } else if (m_pApp->GetFormFillInfo()->m_pJsPlatform->version >= 2) {
90 m_isolate = reinterpret_cast<v8::Isolate*>(
91 m_pApp->GetFormFillInfo()->m_pJsPlatform->m_isolate);
92 }
93 if (!m_isolate) {
94 m_pArrayBufferAllocator.reset(new CJS_ArrayBufferAllocator());
Jochen Eisinger06b60022015-07-30 17:44:35 +020095
Nico Weber9d8ec5a2015-08-04 13:00:21 -070096 v8::Isolate::CreateParams params;
97 params.array_buffer_allocator = m_pArrayBufferAllocator.get();
98 m_isolate = v8::Isolate::New(params);
Jochen Eisinger29007842015-08-05 09:02:13 +020099 m_isolateManaged = true;
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700100 }
Tom Sepezd2cc1b92015-04-30 15:19:03 -0700101
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700102 v8::Isolate* isolate = m_isolate;
103 v8::Isolate::Scope isolate_scope(isolate);
104 v8::Locker locker(isolate);
105 v8::HandleScope handle_scope(isolate);
106 if (CPDFXFA_App::GetInstance()->InitRuntime(FALSE)) {
107 CJS_Context* pContext = (CJS_Context*)NewContext();
Tom Sepez808a99e2015-09-10 12:28:37 -0700108 JS_InitialRuntime(GetIsolate(), this, pContext, m_context);
Tom Sepez2f2ffec2015-07-23 14:42:09 -0700109 ReleaseContext(pContext);
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700110 return;
111 }
112
Tom Sepez570875c2015-09-11 08:35:03 -0700113 DefineJSObjects();
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700114
115 CJS_Context* pContext = (CJS_Context*)NewContext();
Tom Sepez808a99e2015-09-10 12:28:37 -0700116 JS_InitialRuntime(GetIsolate(), this, pContext, m_context);
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700117 ReleaseContext(pContext);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700118}
119
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700120CJS_Runtime::~CJS_Runtime() {
121 int size = m_ContextArray.GetSize();
122 for (int i = 0; i < size; i++)
123 delete m_ContextArray.GetAt(i);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700124
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700125 m_ContextArray.RemoveAll();
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700126
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700127 RemoveEventsInLoop(m_pFieldEventPath);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700128
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700129 m_pApp = NULL;
130 m_pDocument = NULL;
131 m_pFieldEventPath = NULL;
132 m_context.Reset();
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700133
Jochen Eisinger29007842015-08-05 09:02:13 +0200134 if (m_isolateManaged)
135 m_isolate->Dispose();
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700136 m_isolate = NULL;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700137}
138
Tom Sepez142165e2015-09-11 13:21:50 -0700139void CJS_Runtime::DefineJSObjects() {
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700140 v8::Isolate::Scope isolate_scope(GetIsolate());
141 v8::Locker locker(GetIsolate());
142 v8::HandleScope handle_scope(GetIsolate());
143 v8::Local<v8::Context> context = v8::Context::New(GetIsolate());
144 v8::Context::Scope context_scope(context);
Tom Sepez570875c2015-09-11 08:35:03 -0700145
146 // The call order determines the "ObjDefID" assigned to each class.
147 // ObjDefIDs 0 - 2
Tom Sepez142165e2015-09-11 13:21:50 -0700148 CJS_Border::DefineJSObjects(GetIsolate(), JS_STATIC);
149 CJS_Display::DefineJSObjects(GetIsolate(), JS_STATIC);
150 CJS_Font::DefineJSObjects(GetIsolate(), JS_STATIC);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700151
Tom Sepez570875c2015-09-11 08:35:03 -0700152 // ObjDefIDs 3 - 5
Tom Sepez142165e2015-09-11 13:21:50 -0700153 CJS_Highlight::DefineJSObjects(GetIsolate(), JS_STATIC);
154 CJS_Position::DefineJSObjects(GetIsolate(), JS_STATIC);
155 CJS_ScaleHow::DefineJSObjects(GetIsolate(), JS_STATIC);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700156
Tom Sepez570875c2015-09-11 08:35:03 -0700157 // ObjDefIDs 6 - 8
Tom Sepez142165e2015-09-11 13:21:50 -0700158 CJS_ScaleWhen::DefineJSObjects(GetIsolate(), JS_STATIC);
159 CJS_Style::DefineJSObjects(GetIsolate(), JS_STATIC);
160 CJS_Zoomtype::DefineJSObjects(GetIsolate(), JS_STATIC);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700161
Tom Sepez570875c2015-09-11 08:35:03 -0700162 // ObjDefIDs 9 - 11
Tom Sepez142165e2015-09-11 13:21:50 -0700163 CJS_App::DefineJSObjects(GetIsolate(), JS_STATIC);
164 CJS_Color::DefineJSObjects(GetIsolate(), JS_STATIC);
165 CJS_Console::DefineJSObjects(GetIsolate(), JS_STATIC);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700166
Tom Sepez570875c2015-09-11 08:35:03 -0700167 // ObjDefIDs 12 - 14
Tom Sepez142165e2015-09-11 13:21:50 -0700168 CJS_Document::DefineJSObjects(GetIsolate(), JS_DYNAMIC);
169 CJS_Event::DefineJSObjects(GetIsolate(), JS_STATIC);
170 CJS_Field::DefineJSObjects(GetIsolate(), JS_DYNAMIC);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700171
Tom Sepez570875c2015-09-11 08:35:03 -0700172 // ObjDefIDs 15 - 17
Tom Sepez142165e2015-09-11 13:21:50 -0700173 CJS_Global::DefineJSObjects(GetIsolate(), JS_STATIC);
174 CJS_Icon::DefineJSObjects(GetIsolate(), JS_DYNAMIC);
175 CJS_Util::DefineJSObjects(GetIsolate(), JS_STATIC);
Tom Sepez570875c2015-09-11 08:35:03 -0700176
Tom Sepez142165e2015-09-11 13:21:50 -0700177 // ObjDefIDs 18 - 20 (these can't fail, return void).
178 CJS_PublicMethods::DefineJSObjects(GetIsolate());
179 CJS_GlobalConsts::DefineJSObjects(GetIsolate());
180 CJS_GlobalArrays::DefineJSObjects(GetIsolate());
Tom Sepez570875c2015-09-11 08:35:03 -0700181
Tom Sepez142165e2015-09-11 13:21:50 -0700182 // ObjDefIDs 21 - 22.
183 CJS_TimerObj::DefineJSObjects(GetIsolate(), JS_DYNAMIC);
184 CJS_PrintParamsObj::DefineJSObjects(GetIsolate(), JS_DYNAMIC);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700185}
186
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700187IFXJS_Context* CJS_Runtime::NewContext() {
188 CJS_Context* p = new CJS_Context(this);
189 m_ContextArray.Add(p);
190 return p;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700191}
192
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700193void CJS_Runtime::ReleaseContext(IFXJS_Context* pContext) {
194 CJS_Context* pJSContext = (CJS_Context*)pContext;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700195
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700196 for (int i = 0, sz = m_ContextArray.GetSize(); i < sz; i++) {
197 if (pJSContext == m_ContextArray.GetAt(i)) {
198 delete pJSContext;
199 m_ContextArray.RemoveAt(i);
200 break;
201 }
202 }
203}
204
205IFXJS_Context* CJS_Runtime::GetCurrentContext() {
206 if (!m_ContextArray.GetSize())
207 return NULL;
208 return m_ContextArray.GetAt(m_ContextArray.GetSize() - 1);
209}
210
211void CJS_Runtime::SetReaderDocument(CPDFSDK_Document* pReaderDoc) {
212 if (m_pDocument != pReaderDoc) {
213 v8::Isolate::Scope isolate_scope(m_isolate);
214 v8::Locker locker(m_isolate);
215 v8::HandleScope handle_scope(m_isolate);
216 v8::Local<v8::Context> context =
217 v8::Local<v8::Context>::New(m_isolate, m_context);
218 v8::Context::Scope context_scope(context);
219
220 m_pDocument = pReaderDoc;
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700221 if (pReaderDoc) {
Tom Sepez808a99e2015-09-10 12:28:37 -0700222 v8::Local<v8::Object> pThis = JS_GetThisObj(GetIsolate());
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700223 if (!pThis.IsEmpty()) {
Tom Sepez808a99e2015-09-10 12:28:37 -0700224 if (JS_GetObjDefnID(pThis) ==
225 JS_GetObjDefnID(GetIsolate(), L"Document")) {
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700226 if (CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pThis)) {
227 if (Document* pDocument = (Document*)pJSDocument->GetEmbedObject())
228 pDocument->AttachDoc(pReaderDoc);
229 }
Tom Sepez2f2ffec2015-07-23 14:42:09 -0700230 }
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700231 }
Tom Sepez2f2ffec2015-07-23 14:42:09 -0700232 }
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700233 }
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700234}
235
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700236FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName,
237 JS_EVENT_T eEventType) {
238 if (m_pFieldEventPath == NULL) {
239 m_pFieldEventPath = new CJS_FieldEvent;
240 m_pFieldEventPath->sTargetName = sTargetName;
241 m_pFieldEventPath->eEventType = eEventType;
242 m_pFieldEventPath->pNext = NULL;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700243
Tom Sepez2f2ffec2015-07-23 14:42:09 -0700244 return TRUE;
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700245 }
246
247 // to search
248 CJS_FieldEvent* p = m_pFieldEventPath;
249 CJS_FieldEvent* pLast = m_pFieldEventPath;
250 while (p) {
251 if (p->eEventType == eEventType && p->sTargetName == sTargetName)
252 return FALSE;
253
254 pLast = p;
255 p = p->pNext;
256 }
257
258 // to add
259 CJS_FieldEvent* pNew = new CJS_FieldEvent;
260 pNew->sTargetName = sTargetName;
261 pNew->eEventType = eEventType;
262 pNew->pNext = NULL;
263
264 pLast->pNext = pNew;
265
266 return TRUE;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700267}
268
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700269void CJS_Runtime::RemoveEventInLoop(const CFX_WideString& sTargetName,
270 JS_EVENT_T eEventType) {
271 FX_BOOL bFind = FALSE;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700272
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700273 CJS_FieldEvent* p = m_pFieldEventPath;
274 CJS_FieldEvent* pLast = NULL;
275 while (p) {
276 if (p->eEventType == eEventType && p->sTargetName == sTargetName) {
277 bFind = TRUE;
278 break;
Tom Sepez2f2ffec2015-07-23 14:42:09 -0700279 }
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700280
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700281 pLast = p;
282 p = p->pNext;
283 }
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700284
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700285 if (bFind) {
286 RemoveEventsInLoop(p);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700287
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700288 if (p == m_pFieldEventPath)
289 m_pFieldEventPath = NULL;
290
291 if (pLast)
292 pLast->pNext = NULL;
293 }
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700294}
295
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700296void CJS_Runtime::RemoveEventsInLoop(CJS_FieldEvent* pStart) {
297 CJS_FieldEvent* p = pStart;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700298
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700299 while (p) {
300 CJS_FieldEvent* pOld = p;
301 p = pOld->pNext;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700302
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700303 delete pOld;
304 }
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700305}
306
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700307v8::Local<v8::Context> CJS_Runtime::NewJSContext() {
308 return v8::Local<v8::Context>::New(m_isolate, m_context);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700309}
310
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700311CFX_WideString ChangeObjName(const CFX_WideString& str) {
312 CFX_WideString sRet = str;
313 sRet.Replace(L"_", L".");
314 return sRet;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700315}
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700316FX_BOOL CJS_Runtime::GetHValueByName(const CFX_ByteStringC& utf8Name,
317 FXJSE_HVALUE hValue) {
318 const FX_CHAR* name = utf8Name.GetCStr();
Bo Xufdc00a72014-10-28 23:03:33 -0700319
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700320 v8::Locker lock(GetIsolate());
321 v8::Isolate::Scope isolate_scope(GetIsolate());
322 v8::HandleScope handle_scope(GetIsolate());
323 v8::Local<v8::Context> context =
324 v8::Local<v8::Context>::New(GetIsolate(), m_context);
325 v8::Context::Scope context_scope(context);
Bo Xufdc00a72014-10-28 23:03:33 -0700326
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700327 // v8::Local<v8::Context> tmpCotext =
328 // v8::Local<v8::Context>::New(GetIsolate(), m_context);
329 v8::Local<v8::Value> propvalue =
330 context->Global()->Get(v8::String::NewFromUtf8(
331 GetIsolate(), name, v8::String::kNormalString, utf8Name.GetLength()));
Bo Xufdc00a72014-10-28 23:03:33 -0700332
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700333 if (propvalue.IsEmpty()) {
334 FXJSE_Value_SetUndefined(hValue);
335 return FALSE;
336 }
337 ((CFXJSE_Value*)hValue)->ForceSetValue(propvalue);
Lei Zhanga6d9f0e2015-06-13 00:48:38 -0700338
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700339 return TRUE;
Bo Xufdc00a72014-10-28 23:03:33 -0700340}
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700341FX_BOOL CJS_Runtime::SetHValueByName(const CFX_ByteStringC& utf8Name,
342 FXJSE_HVALUE hValue) {
343 if (utf8Name.IsEmpty() || hValue == NULL)
344 return FALSE;
345 const FX_CHAR* name = utf8Name.GetCStr();
346 v8::Isolate* pIsolate = GetIsolate();
347 v8::Locker lock(pIsolate);
348 v8::Isolate::Scope isolate_scope(pIsolate);
349 v8::HandleScope handle_scope(pIsolate);
350 v8::Local<v8::Context> context =
351 v8::Local<v8::Context>::New(pIsolate, m_context);
352 v8::Context::Scope context_scope(context);
Bo Xufdc00a72014-10-28 23:03:33 -0700353
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700354 // v8::Local<v8::Context> tmpCotext =
355 // v8::Local<v8::Context>::New(GetIsolate(), m_context);
356 v8::Local<v8::Value> propvalue = v8::Local<v8::Value>::New(
357 GetIsolate(), ((CFXJSE_Value*)hValue)->DirectGetValue());
358 context->Global()->Set(
359 v8::String::NewFromUtf8(pIsolate, name, v8::String::kNormalString,
360 utf8Name.GetLength()),
361 propvalue);
Lei Zhanga6d9f0e2015-06-13 00:48:38 -0700362
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700363 return TRUE;
Bo Xufdc00a72014-10-28 23:03:33 -0700364}