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

Side by Side Diff: fpdfsdk/javascript/JS_Value.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_Object.cpp ('k') | fpdfsdk/javascript/cjs_runtime.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/JS_Value.h" 7 #include "fpdfsdk/javascript/JS_Value.h"
8 8
9 #include <time.h> 9 #include <time.h>
10 10
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 case 11: 746 case 11:
747 return day - 333 - leap; 747 return day - 333 - leap;
748 default: 748 default:
749 return 0; 749 return 0;
750 } 750 }
751 } 751 }
752 752
753 double JS_GetDateTime() { 753 double JS_GetDateTime() {
754 if (!FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS)) 754 if (!FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS))
755 return 0; 755 return 0;
756 time_t t = time(NULL); 756 time_t t = time(nullptr);
757 struct tm* pTm = localtime(&t); 757 struct tm* pTm = localtime(&t);
758 758
759 int year = pTm->tm_year + 1900; 759 int year = pTm->tm_year + 1900;
760 double t1 = _TimeFromYear(year); 760 double t1 = _TimeFromYear(year);
761 761
762 return t1 + pTm->tm_yday * 86400000.0 + pTm->tm_hour * 3600000.0 + 762 return t1 + pTm->tm_yday * 86400000.0 + pTm->tm_hour * 3600000.0 +
763 pTm->tm_min * 60000.0 + pTm->tm_sec * 1000.0; 763 pTm->tm_min * 60000.0 + pTm->tm_sec * 1000.0;
764 } 764 }
765 765
766 int JS_GetYearFromTime(double dt) { 766 int JS_GetYearFromTime(double dt) {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 for (size_t i = 0; i < nKeywords; ++i) { 893 for (size_t i = 0; i < nKeywords; ++i) {
894 const wchar_t* property = va_arg(ap, const wchar_t*); 894 const wchar_t* property = va_arg(ap, const wchar_t*);
895 v8::Local<v8::Value> v8Value = 895 v8::Local<v8::Value> v8Value =
896 FXJS_GetObjectElement(pRuntime->GetIsolate(), pObj, property); 896 FXJS_GetObjectElement(pRuntime->GetIsolate(), pObj, property);
897 if (!v8Value->IsUndefined()) 897 if (!v8Value->IsUndefined())
898 result[i] = CJS_Value(pRuntime, v8Value, CJS_Value::VT_unknown); 898 result[i] = CJS_Value(pRuntime, v8Value, CJS_Value::VT_unknown);
899 } 899 }
900 va_end(ap); 900 va_end(ap);
901 return result; 901 return result;
902 } 902 }
OLDNEW
« no previous file with comments | « fpdfsdk/javascript/JS_Object.cpp ('k') | fpdfsdk/javascript/cjs_runtime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698