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

Side by Side Diff: fpdfsdk/javascript/cjs_runtime.cpp

Issue 2062313002: Make code compile with clang_use_chrome_plugin (part IV) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: remove unused file Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « fpdfsdk/javascript/cjs_runtime.h ('k') | fpdfsdk/javascript/global.h » ('j') | 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 "fpdfsdk/javascript/cjs_runtime.h" 7 #include "fpdfsdk/javascript/cjs_runtime.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 (CJS_Document*)FXJS_GetPrivate(GetIsolate(), pThis)) { 203 (CJS_Document*)FXJS_GetPrivate(GetIsolate(), pThis)) {
204 if (Document* pDocument = (Document*)pJSDocument->GetEmbedObject()) 204 if (Document* pDocument = (Document*)pJSDocument->GetEmbedObject())
205 pDocument->AttachDoc(pReaderDoc); 205 pDocument->AttachDoc(pReaderDoc);
206 } 206 }
207 } 207 }
208 } 208 }
209 } 209 }
210 } 210 }
211 } 211 }
212 212
213 CPDFSDK_Document* CJS_Runtime::GetReaderDocument() {
214 return m_pDocument;
215 }
216
213 int CJS_Runtime::Execute(const CFX_WideString& script, CFX_WideString* info) { 217 int CJS_Runtime::Execute(const CFX_WideString& script, CFX_WideString* info) {
214 FXJSErr error = {}; 218 FXJSErr error = {};
215 int nRet = FXJS_Execute(m_isolate, script, &error); 219 int nRet = FXJS_Execute(m_isolate, script, &error);
216 if (nRet < 0) { 220 if (nRet < 0) {
217 info->Format(L"[ Line: %05d { %s } ] : %s", error.linnum - 1, error.srcline, 221 info->Format(L"[ Line: %05d { %s } ] : %s", error.linnum - 1, error.srcline,
218 error.message); 222 error.message);
219 } 223 }
220 return nRet; 224 return nRet;
221 } 225 }
222 226
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 // v8::Local<v8::Context>::New(GetIsolate(), m_context); 308 // v8::Local<v8::Context>::New(GetIsolate(), m_context);
305 v8::Local<v8::Value> propvalue = 309 v8::Local<v8::Value> propvalue =
306 v8::Local<v8::Value>::New(GetIsolate(), pValue->DirectGetValue()); 310 v8::Local<v8::Value>::New(GetIsolate(), pValue->DirectGetValue());
307 context->Global()->Set( 311 context->Global()->Set(
308 v8::String::NewFromUtf8(pIsolate, name, v8::String::kNormalString, 312 v8::String::NewFromUtf8(pIsolate, name, v8::String::kNormalString,
309 utf8Name.GetLength()), 313 utf8Name.GetLength()),
310 propvalue); 314 propvalue);
311 return TRUE; 315 return TRUE;
312 } 316 }
313 #endif 317 #endif
OLDNEW
« no previous file with comments | « fpdfsdk/javascript/cjs_runtime.h ('k') | fpdfsdk/javascript/global.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698