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

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

Issue 2043153002: Remove various FXJSE Value methods. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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 | « no previous file | xfa/fxfa/app/xfa_ffnotify.cpp » ('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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 // Do so now. 270 // Do so now.
271 // TODO(tsepez): redesign PDF-side objects to not rely on v8::Context's 271 // TODO(tsepez): redesign PDF-side objects to not rely on v8::Context's
272 // embedder data slots, and/or to always use the right context. 272 // embedder data slots, and/or to always use the right context.
273 FXJS_SetRuntimeForV8Context(old_context, this); 273 FXJS_SetRuntimeForV8Context(old_context, this);
274 274
275 v8::Local<v8::Value> propvalue = 275 v8::Local<v8::Value> propvalue =
276 context->Global()->Get(v8::String::NewFromUtf8( 276 context->Global()->Get(v8::String::NewFromUtf8(
277 GetIsolate(), name, v8::String::kNormalString, utf8Name.GetLength())); 277 GetIsolate(), name, v8::String::kNormalString, utf8Name.GetLength()));
278 278
279 if (propvalue.IsEmpty()) { 279 if (propvalue.IsEmpty()) {
280 FXJSE_Value_SetUndefined(pValue); 280 pValue->SetUndefined();
281 return FALSE; 281 return FALSE;
282 } 282 }
283 pValue->ForceSetValue(propvalue); 283 pValue->ForceSetValue(propvalue);
284 #endif 284 #endif
285 285
286 return TRUE; 286 return TRUE;
287 } 287 }
288 FX_BOOL CJS_Runtime::SetValueByName(const CFX_ByteStringC& utf8Name, 288 FX_BOOL CJS_Runtime::SetValueByName(const CFX_ByteStringC& utf8Name,
289 CFXJSE_Value* pValue) { 289 CFXJSE_Value* pValue) {
290 #ifdef PDF_ENABLE_XFA 290 #ifdef PDF_ENABLE_XFA
(...skipping 22 matching lines...) Expand all
313 #endif 313 #endif
314 void CJS_Runtime::AddObserver(Observer* observer) { 314 void CJS_Runtime::AddObserver(Observer* observer) {
315 ASSERT(!pdfium::ContainsKey(m_observers, observer)); 315 ASSERT(!pdfium::ContainsKey(m_observers, observer));
316 m_observers.insert(observer); 316 m_observers.insert(observer);
317 } 317 }
318 318
319 void CJS_Runtime::RemoveObserver(Observer* observer) { 319 void CJS_Runtime::RemoveObserver(Observer* observer) {
320 ASSERT(pdfium::ContainsKey(m_observers, observer)); 320 ASSERT(pdfium::ContainsKey(m_observers, observer));
321 m_observers.erase(observer); 321 m_observers.erase(observer);
322 } 322 }
OLDNEW
« no previous file with comments | « no previous file | xfa/fxfa/app/xfa_ffnotify.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698