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

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

Issue 2031653003: Get rid of NULLs in fpdfsdk/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@nullptr_core
Patch Set: rebase 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/JS_Value.cpp ('k') | fpdfsdk/javascript/global.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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } 45 }
46 46
47 // static 47 // static
48 CJS_Runtime* CJS_Runtime::FromContext(const IJS_Context* cc) { 48 CJS_Runtime* CJS_Runtime::FromContext(const IJS_Context* cc) {
49 const CJS_Context* pContext = static_cast<const CJS_Context*>(cc); 49 const CJS_Context* pContext = static_cast<const CJS_Context*>(cc);
50 return pContext->GetJSRuntime(); 50 return pContext->GetJSRuntime();
51 } 51 }
52 52
53 CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp) 53 CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp)
54 : m_pApp(pApp), 54 : m_pApp(pApp),
55 m_pDocument(NULL), 55 m_pDocument(nullptr),
56 m_bBlocking(FALSE), 56 m_bBlocking(FALSE),
57 m_isolate(NULL), 57 m_isolate(nullptr),
58 m_isolateManaged(false) { 58 m_isolateManaged(false) {
59 #ifndef PDF_ENABLE_XFA 59 #ifndef PDF_ENABLE_XFA
60 IPDF_JSPLATFORM* pPlatform = m_pApp->GetFormFillInfo()->m_pJsPlatform; 60 IPDF_JSPLATFORM* pPlatform = m_pApp->GetFormFillInfo()->m_pJsPlatform;
61 if (pPlatform->version <= 2) { 61 if (pPlatform->version <= 2) {
62 unsigned int embedderDataSlot = 0; 62 unsigned int embedderDataSlot = 0;
63 v8::Isolate* pExternalIsolate = nullptr; 63 v8::Isolate* pExternalIsolate = nullptr;
64 if (pPlatform->version == 2) { 64 if (pPlatform->version == 2) {
65 pExternalIsolate = reinterpret_cast<v8::Isolate*>(pPlatform->m_isolate); 65 pExternalIsolate = reinterpret_cast<v8::Isolate*>(pPlatform->m_isolate);
66 embedderDataSlot = pPlatform->m_v8EmbedderSlot; 66 embedderDataSlot = pPlatform->m_v8EmbedderSlot;
67 #else 67 #else
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 | « fpdfsdk/javascript/JS_Value.cpp ('k') | fpdfsdk/javascript/global.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698