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

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: Fix bad search/replace 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
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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 #endif 315 #endif
316 void CJS_Runtime::AddObserver(Observer* observer) { 316 void CJS_Runtime::AddObserver(Observer* observer) {
317 ASSERT(!pdfium::ContainsKey(m_observers, observer)); 317 ASSERT(!pdfium::ContainsKey(m_observers, observer));
318 m_observers.insert(observer); 318 m_observers.insert(observer);
319 } 319 }
320 320
321 void CJS_Runtime::RemoveObserver(Observer* observer) { 321 void CJS_Runtime::RemoveObserver(Observer* observer) {
322 ASSERT(pdfium::ContainsKey(m_observers, observer)); 322 ASSERT(pdfium::ContainsKey(m_observers, observer));
323 m_observers.erase(observer); 323 m_observers.erase(observer);
324 } 324 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698