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

Side by Side Diff: fpdfsdk/javascript/JS_Value.h

Issue 2215093002: Return v8::Date specialization not v8::Value where possible (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: remove fxjs_valuecopy Created 4 years, 4 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 | fpdfsdk/javascript/JS_Value.cpp » ('j') | fpdfsdk/javascript/JS_Value.cpp » ('J')
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 #ifndef FPDFSDK_JAVASCRIPT_JS_VALUE_H_ 7 #ifndef FPDFSDK_JAVASCRIPT_JS_VALUE_H_
8 #define FPDFSDK_JAVASCRIPT_JS_VALUE_H_ 8 #define FPDFSDK_JAVASCRIPT_JS_VALUE_H_
9 9
10 #include <vector> 10 #include <vector>
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 CJS_Date(CJS_Runtime* pRuntime, double dMsec_time); 152 CJS_Date(CJS_Runtime* pRuntime, double dMsec_time);
153 CJS_Date(CJS_Runtime* pRuntime, 153 CJS_Date(CJS_Runtime* pRuntime,
154 int year, 154 int year,
155 int mon, 155 int mon,
156 int day, 156 int day,
157 int hour, 157 int hour,
158 int min, 158 int min,
159 int sec); 159 int sec);
160 virtual ~CJS_Date(); 160 virtual ~CJS_Date();
161 161
162 void Attach(v8::Local<v8::Value> pDate); 162 void Attach(v8::Local<v8::Date> pDate);
163 bool IsValidDate() const; 163 bool IsValidDate() const;
164 164
165 int GetYear() const; 165 int GetYear() const;
166 void SetYear(int iYear); 166 void SetYear(int iYear);
167 167
168 int GetMonth() const; 168 int GetMonth() const;
169 void SetMonth(int iMonth); 169 void SetMonth(int iMonth);
170 170
171 int GetDay() const; 171 int GetDay() const;
172 void SetDay(int iDay); 172 void SetDay(int iDay);
173 173
174 int GetHours() const; 174 int GetHours() const;
175 void SetHours(int iHours); 175 void SetHours(int iHours);
176 176
177 int GetMinutes() const; 177 int GetMinutes() const;
178 void SetMinutes(int minutes); 178 void SetMinutes(int minutes);
179 179
180 int GetSeconds() const; 180 int GetSeconds() const;
181 void SetSeconds(int seconds); 181 void SetSeconds(int seconds);
182 182
183 CJS_Runtime* GetJSRuntime() const { return m_pJSRuntime; } 183 CJS_Runtime* GetJSRuntime() const { return m_pJSRuntime; }
184 v8::Local<v8::Value> ToV8Value() const { return m_pDate; } 184 v8::Local<v8::Value> ToV8Value() const { return m_pDate; }
185 double ToDouble() const; 185 double ToDouble() const;
186 CFX_WideString ToString() const; 186 CFX_WideString ToString() const;
187 187
188 protected: 188 protected:
189 v8::Local<v8::Value> m_pDate; 189 v8::Local<v8::Date> m_pDate;
190 CJS_Runtime* const m_pJSRuntime; 190 CJS_Runtime* const m_pJSRuntime;
191 }; 191 };
192 192
193 double JS_GetDateTime(); 193 double JS_GetDateTime();
194 int JS_GetYearFromTime(double dt); 194 int JS_GetYearFromTime(double dt);
195 int JS_GetMonthFromTime(double dt); 195 int JS_GetMonthFromTime(double dt);
196 int JS_GetDayFromTime(double dt); 196 int JS_GetDayFromTime(double dt);
197 int JS_GetHourFromTime(double dt); 197 int JS_GetHourFromTime(double dt);
198 int JS_GetMinFromTime(double dt); 198 int JS_GetMinFromTime(double dt);
199 int JS_GetSecFromTime(double dt); 199 int JS_GetSecFromTime(double dt);
(...skipping 10 matching lines...) Expand all
210 // names as wchar_t string literals corresponding to each positional argument. 210 // names as wchar_t string literals corresponding to each positional argument.
211 // The result will always contain |nKeywords| value, with unspecified ones 211 // The result will always contain |nKeywords| value, with unspecified ones
212 // being set to type VT_unknown. 212 // being set to type VT_unknown.
213 std::vector<CJS_Value> JS_ExpandKeywordParams( 213 std::vector<CJS_Value> JS_ExpandKeywordParams(
214 CJS_Runtime* pRuntime, 214 CJS_Runtime* pRuntime,
215 const std::vector<CJS_Value>& originals, 215 const std::vector<CJS_Value>& originals,
216 size_t nKeywords, 216 size_t nKeywords,
217 ...); 217 ...);
218 218
219 #endif // FPDFSDK_JAVASCRIPT_JS_VALUE_H_ 219 #endif // FPDFSDK_JAVASCRIPT_JS_VALUE_H_
OLDNEW
« no previous file with comments | « no previous file | fpdfsdk/javascript/JS_Value.cpp » ('j') | fpdfsdk/javascript/JS_Value.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698