summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-03-09 09:59:23 -0500
committerDan Sinclair <dsinclair@chromium.org>2016-03-09 09:59:23 -0500
commit3ebd121d45ceb08918a3dcb5b3b7ac29448c862f (patch)
tree361d5fa0f9be7484cce4aace1b9cc18545046611 /fpdfsdk/src/javascript
parent317758574e173367b41928a1575d70600c6b6ea8 (diff)
downloadpdfium-3ebd121d45ceb08918a3dcb5b3b7ac29448c862f.tar.xz
Review and cleanup lint warnings.
This CL goes through the remaining list of list warnings and records why they are currently blacklisted, or fixes and enables them. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1773733002 .
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r--fpdfsdk/src/javascript/Document.cpp6
-rw-r--r--fpdfsdk/src/javascript/Document.h1
-rw-r--r--fpdfsdk/src/javascript/Field.cpp1
-rw-r--r--fpdfsdk/src/javascript/Field.h3
-rw-r--r--fpdfsdk/src/javascript/JS_Define.h4
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.h1
-rw-r--r--fpdfsdk/src/javascript/JS_Value.cpp14
-rw-r--r--fpdfsdk/src/javascript/JS_Value.h4
-rw-r--r--fpdfsdk/src/javascript/PublicMethods.cpp23
-rw-r--r--fpdfsdk/src/javascript/PublicMethods.h3
-rw-r--r--fpdfsdk/src/javascript/app.cpp3
-rw-r--r--fpdfsdk/src/javascript/app.h5
-rw-r--r--fpdfsdk/src/javascript/color.cpp2
-rw-r--r--fpdfsdk/src/javascript/color.h4
-rw-r--r--fpdfsdk/src/javascript/console.cpp2
-rw-r--r--fpdfsdk/src/javascript/console.h2
-rw-r--r--fpdfsdk/src/javascript/global.cpp2
-rw-r--r--fpdfsdk/src/javascript/global.h1
-rw-r--r--fpdfsdk/src/javascript/report.cpp2
-rw-r--r--fpdfsdk/src/javascript/report.h2
-rw-r--r--fpdfsdk/src/javascript/util.cpp3
-rw-r--r--fpdfsdk/src/javascript/util.h3
22 files changed, 62 insertions, 29 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index f688982da5..1c9c1f31f4 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -6,8 +6,10 @@
#include "fpdfsdk/src/javascript/Document.h"
+#include <vector>
+
#include "core/include/fpdfapi/cpdf_document.h"
-#include "fpdfsdk/include/fsdk_mgr.h" // For CPDFDoc_Environment.
+#include "fpdfsdk/include/fsdk_mgr.h"
#include "fpdfsdk/include/javascript/IJavaScript.h"
#include "fpdfsdk/src/javascript/Field.h"
#include "fpdfsdk/src/javascript/Icon.h"
@@ -656,8 +658,6 @@ FX_BOOL Document::submitForm(IJS_Context* cc,
return TRUE;
}
-//////////////////////////////////////////////////////////////////////////////////////////////
-
void Document::AttachDoc(CPDFSDK_Document* pDoc) {
m_pDocument = pDoc;
}
diff --git a/fpdfsdk/src/javascript/Document.h b/fpdfsdk/src/javascript/Document.h
index c36893fd87..06c4121510 100644
--- a/fpdfsdk/src/javascript/Document.h
+++ b/fpdfsdk/src/javascript/Document.h
@@ -9,6 +9,7 @@
#include <list>
#include <memory>
+#include <vector>
#include "fpdfsdk/src/javascript/JS_Define.h"
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp
index 9b6a7facba..35ef8b42da 100644
--- a/fpdfsdk/src/javascript/Field.cpp
+++ b/fpdfsdk/src/javascript/Field.cpp
@@ -8,6 +8,7 @@
#include <algorithm>
#include <memory>
+#include <string>
#include <vector>
#include "fpdfsdk/include/fsdk_mgr.h" // For CPDFDoc_Environment.
diff --git a/fpdfsdk/src/javascript/Field.h b/fpdfsdk/src/javascript/Field.h
index 4fba1ddfa1..49103c8284 100644
--- a/fpdfsdk/src/javascript/Field.h
+++ b/fpdfsdk/src/javascript/Field.h
@@ -7,7 +7,8 @@
#ifndef FPDFSDK_SRC_JAVASCRIPT_FIELD_H_
#define FPDFSDK_SRC_JAVASCRIPT_FIELD_H_
-#include <string> // For std::wstring.
+#include <string>
+#include <vector>
#include "fpdfsdk/include/pdfwindow/PWL_Wnd.h" // For CPWL_Color.
#include "fpdfsdk/src/javascript/JS_Define.h"
diff --git a/fpdfsdk/src/javascript/JS_Define.h b/fpdfsdk/src/javascript/JS_Define.h
index f03d9ec7fc..e16c5a097a 100644
--- a/fpdfsdk/src/javascript/JS_Define.h
+++ b/fpdfsdk/src/javascript/JS_Define.h
@@ -7,6 +7,8 @@
#ifndef FPDFSDK_SRC_JAVASCRIPT_JS_DEFINE_H_
#define FPDFSDK_SRC_JAVASCRIPT_JS_DEFINE_H_
+#include <vector>
+
#include "fpdfsdk/include/jsapi/fxjs_v8.h"
#include "fpdfsdk/src/javascript/JS_Object.h"
#include "fpdfsdk/src/javascript/JS_Value.h"
@@ -15,7 +17,7 @@
struct JSConstSpec {
const wchar_t* pName;
double number;
- const wchar_t* string;
+ const wchar_t* string; // NOLINT
uint8_t t; // 0:double 1:str
};
diff --git a/fpdfsdk/src/javascript/JS_Runtime.h b/fpdfsdk/src/javascript/JS_Runtime.h
index 8215b88994..c7b0009ccb 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.h
+++ b/fpdfsdk/src/javascript/JS_Runtime.h
@@ -8,6 +8,7 @@
#define FPDFSDK_SRC_JAVASCRIPT_JS_RUNTIME_H_
#include <set>
+#include <map>
#include <utility>
#include <vector>
diff --git a/fpdfsdk/src/javascript/JS_Value.cpp b/fpdfsdk/src/javascript/JS_Value.cpp
index cd5f2518cf..70ccdb5e97 100644
--- a/fpdfsdk/src/javascript/JS_Value.cpp
+++ b/fpdfsdk/src/javascript/JS_Value.cpp
@@ -7,9 +7,11 @@
#include "fpdfsdk/src/javascript/JS_Value.h"
#include <time.h>
+
#include <algorithm>
#include <cmath>
#include <limits>
+#include <vector>
#include "fpdfsdk/src/javascript/Document.h"
#include "fpdfsdk/src/javascript/JS_Define.h"
@@ -361,14 +363,14 @@ void CJS_PropValue::StartSetting() {
void CJS_PropValue::StartGetting() {
m_bIsSetting = 0;
}
-void CJS_PropValue::operator<<(CFX_ByteString string) {
+void CJS_PropValue::operator<<(CFX_ByteString str) {
ASSERT(!m_bIsSetting);
- CJS_Value::operator=(string.c_str());
+ CJS_Value::operator=(str.c_str());
}
-void CJS_PropValue::operator>>(CFX_ByteString& string) const {
+void CJS_PropValue::operator>>(CFX_ByteString& str) const {
ASSERT(m_bIsSetting);
- string = CJS_Value::ToCFXByteString();
+ str = CJS_Value::ToCFXByteString();
}
void CJS_PropValue::operator<<(const FX_WCHAR* c_string) {
@@ -794,7 +796,7 @@ int JS_GetSecFromTime(double dt) {
return (int)_Mod(FXSYS_floor((double)(dt / 1000)), 60);
}
-double JS_DateParse(const wchar_t* string) {
+double JS_DateParse(const wchar_t* str) {
v8::Isolate* pIsolate = v8::Isolate::GetCurrent();
v8::Isolate::Scope isolate_scope(pIsolate);
v8::HandleScope scope(pIsolate);
@@ -817,7 +819,7 @@ double JS_DateParse(const wchar_t* string) {
v8::Local<v8::Function> funC = v8::Local<v8::Function>::Cast(v);
const int argc = 1;
- v8::Local<v8::String> timeStr = FXJS_WSToJSString(pIsolate, string);
+ v8::Local<v8::String> timeStr = FXJS_WSToJSString(pIsolate, str);
v8::Local<v8::Value> argv[argc] = {timeStr};
v = funC->Call(context, context->Global(), argc, argv).ToLocalChecked();
if (v->IsNumber()) {
diff --git a/fpdfsdk/src/javascript/JS_Value.h b/fpdfsdk/src/javascript/JS_Value.h
index 6c6a03d265..f6c1c360ca 100644
--- a/fpdfsdk/src/javascript/JS_Value.h
+++ b/fpdfsdk/src/javascript/JS_Value.h
@@ -7,6 +7,8 @@
#ifndef FPDFSDK_SRC_JAVASCRIPT_JS_VALUE_H_
#define FPDFSDK_SRC_JAVASCRIPT_JS_VALUE_H_
+#include <vector>
+
#include "core/include/fxcrt/fx_basic.h"
#include "fpdfsdk/include/jsapi/fxjs_v8.h"
@@ -206,7 +208,7 @@ int JS_GetDayFromTime(double dt);
int JS_GetHourFromTime(double dt);
int JS_GetMinFromTime(double dt);
int JS_GetSecFromTime(double dt);
-double JS_DateParse(const wchar_t* string);
+double JS_DateParse(const wchar_t* str);
double JS_MakeDay(int nYear, int nMonth, int nDay);
double JS_MakeTime(int nHour, int nMin, int nSec, int nMs);
double JS_MakeDate(double day, double time);
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp
index f228072b35..014dea2d6a 100644
--- a/fpdfsdk/src/javascript/PublicMethods.cpp
+++ b/fpdfsdk/src/javascript/PublicMethods.cpp
@@ -7,6 +7,8 @@
#include "fpdfsdk/src/javascript/PublicMethods.h"
#include <algorithm>
+#include <string>
+#include <vector>
#include "core/include/fxcrt/fx_ext.h"
#include "fpdfsdk/include/fsdk_mgr.h" // For CPDFDoc_Environment.
@@ -77,8 +79,8 @@ static const FX_WCHAR* const fullmonths[] = {L"January",
L"November",
L"December"};
-FX_BOOL CJS_PublicMethods::IsNumber(const FX_WCHAR* string) {
- CFX_WideString sTrim = StrTrim(string);
+FX_BOOL CJS_PublicMethods::IsNumber(const FX_WCHAR* str) {
+ CFX_WideString sTrim = StrTrim(str);
const FX_WCHAR* pTrim = sTrim.c_str();
const FX_WCHAR* p = pTrim;
@@ -228,17 +230,17 @@ CJS_Array CJS_PublicMethods::AF_MakeArrayFromList(CJS_Runtime* pRuntime,
return StrArray;
}
-int CJS_PublicMethods::ParseStringInteger(const CFX_WideString& string,
+int CJS_PublicMethods::ParseStringInteger(const CFX_WideString& str,
int nStart,
int& nSkip,
int nMaxStep) {
int nRet = 0;
nSkip = 0;
- for (int i = nStart, sz = string.GetLength(); i < sz; i++) {
+ for (int i = nStart, sz = str.GetLength(); i < sz; i++) {
if (i - nStart > 10)
break;
- FX_WCHAR c = string.GetAt(i);
+ FX_WCHAR c = str.GetAt(i);
if (!FXSYS_iswdigit(c))
break;
@@ -251,14 +253,13 @@ int CJS_PublicMethods::ParseStringInteger(const CFX_WideString& string,
return nRet;
}
-CFX_WideString CJS_PublicMethods::ParseStringString(
- const CFX_WideString& string,
- int nStart,
- int& nSkip) {
+CFX_WideString CJS_PublicMethods::ParseStringString(const CFX_WideString& str,
+ int nStart,
+ int& nSkip) {
CFX_WideString swRet;
nSkip = 0;
- for (int i = nStart, sz = string.GetLength(); i < sz; i++) {
- FX_WCHAR c = string.GetAt(i);
+ for (int i = nStart, sz = str.GetLength(); i < sz; i++) {
+ FX_WCHAR c = str.GetAt(i);
if (!FXSYS_iswdigit(c))
break;
diff --git a/fpdfsdk/src/javascript/PublicMethods.h b/fpdfsdk/src/javascript/PublicMethods.h
index aa9be94ec7..d0c81e03e3 100644
--- a/fpdfsdk/src/javascript/PublicMethods.h
+++ b/fpdfsdk/src/javascript/PublicMethods.h
@@ -7,6 +7,9 @@
#ifndef FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_
#define FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_
+#include <string>
+#include <vector>
+
#include "fpdfsdk/src/javascript/JS_Define.h"
class CJS_PublicMethods : public CJS_Object {
diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp
index a9227a7bdb..767555ff3b 100644
--- a/fpdfsdk/src/javascript/app.cpp
+++ b/fpdfsdk/src/javascript/app.cpp
@@ -7,8 +7,9 @@
#include "fpdfsdk/src/javascript/app.h"
#include <memory>
+#include <vector>
-#include "fpdfsdk/include/fsdk_mgr.h" // For CPDFDoc_Environment.
+#include "fpdfsdk/include/fsdk_mgr.h"
#include "fpdfsdk/include/javascript/IJavaScript.h"
#include "fpdfsdk/src/javascript/Document.h"
#include "fpdfsdk/src/javascript/JS_Context.h"
diff --git a/fpdfsdk/src/javascript/app.h b/fpdfsdk/src/javascript/app.h
index 0b3e50e63d..faebcbd5ce 100644
--- a/fpdfsdk/src/javascript/app.h
+++ b/fpdfsdk/src/javascript/app.h
@@ -7,12 +7,11 @@
#ifndef FPDFSDK_SRC_JAVASCRIPT_APP_H_
#define FPDFSDK_SRC_JAVASCRIPT_APP_H_
+#include <vector>
+
#include "fpdfsdk/src/javascript/JS_Define.h"
class CJS_Runtime;
-
-/* ---------------------------- TimerObj ---------------------------- */
-
class CJS_Timer;
class TimerObj : public CJS_EmbedObj {
diff --git a/fpdfsdk/src/javascript/color.cpp b/fpdfsdk/src/javascript/color.cpp
index 5c02ca28da..4339b4eccf 100644
--- a/fpdfsdk/src/javascript/color.cpp
+++ b/fpdfsdk/src/javascript/color.cpp
@@ -6,6 +6,8 @@
#include "fpdfsdk/src/javascript/color.h"
+#include <vector>
+
#include "fpdfsdk/include/javascript/IJavaScript.h"
#include "fpdfsdk/src/javascript/JS_Context.h"
#include "fpdfsdk/src/javascript/JS_Define.h"
diff --git a/fpdfsdk/src/javascript/color.h b/fpdfsdk/src/javascript/color.h
index 20f5244a58..616337414d 100644
--- a/fpdfsdk/src/javascript/color.h
+++ b/fpdfsdk/src/javascript/color.h
@@ -7,7 +7,9 @@
#ifndef FPDFSDK_SRC_JAVASCRIPT_COLOR_H_
#define FPDFSDK_SRC_JAVASCRIPT_COLOR_H_
-#include "fpdfsdk/include/pdfwindow/PWL_Wnd.h" // For CPWL_Color.
+#include <vector>
+
+#include "fpdfsdk/include/pdfwindow/PWL_Wnd.h"
#include "fpdfsdk/src/javascript/JS_Define.h"
class color : public CJS_EmbedObj {
diff --git a/fpdfsdk/src/javascript/console.cpp b/fpdfsdk/src/javascript/console.cpp
index 2f56c1e090..8beb083f1e 100644
--- a/fpdfsdk/src/javascript/console.cpp
+++ b/fpdfsdk/src/javascript/console.cpp
@@ -6,6 +6,8 @@
#include "fpdfsdk/src/javascript/console.h"
+#include <vector>
+
#include "fpdfsdk/include/javascript/IJavaScript.h"
#include "fpdfsdk/src/javascript/JS_Context.h"
#include "fpdfsdk/src/javascript/JS_Define.h"
diff --git a/fpdfsdk/src/javascript/console.h b/fpdfsdk/src/javascript/console.h
index a810184b41..651899bf4c 100644
--- a/fpdfsdk/src/javascript/console.h
+++ b/fpdfsdk/src/javascript/console.h
@@ -7,6 +7,8 @@
#ifndef FPDFSDK_SRC_JAVASCRIPT_CONSOLE_H_
#define FPDFSDK_SRC_JAVASCRIPT_CONSOLE_H_
+#include <vector>
+
#include "fpdfsdk/src/javascript/JS_Define.h"
class console : public CJS_EmbedObj {
diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp
index fdd67553fc..234e132d46 100644
--- a/fpdfsdk/src/javascript/global.cpp
+++ b/fpdfsdk/src/javascript/global.cpp
@@ -6,6 +6,8 @@
#include "fpdfsdk/src/javascript/global.h"
+#include <vector>
+
#include "core/include/fxcrt/fx_ext.h"
#include "fpdfsdk/include/javascript/IJavaScript.h"
#include "fpdfsdk/src/javascript/JS_Context.h"
diff --git a/fpdfsdk/src/javascript/global.h b/fpdfsdk/src/javascript/global.h
index c2fb076b8c..e8172e691e 100644
--- a/fpdfsdk/src/javascript/global.h
+++ b/fpdfsdk/src/javascript/global.h
@@ -8,6 +8,7 @@
#define FPDFSDK_SRC_JAVASCRIPT_GLOBAL_H_
#include <map>
+#include <vector>
#include "fpdfsdk/src/javascript/JS_Define.h"
diff --git a/fpdfsdk/src/javascript/report.cpp b/fpdfsdk/src/javascript/report.cpp
index 952ed21a20..8374f3c2c8 100644
--- a/fpdfsdk/src/javascript/report.cpp
+++ b/fpdfsdk/src/javascript/report.cpp
@@ -6,6 +6,8 @@
#include "fpdfsdk/src/javascript/report.h"
+#include <vector>
+
#include "fpdfsdk/include/javascript/IJavaScript.h"
#include "fpdfsdk/src/javascript/JS_Define.h"
#include "fpdfsdk/src/javascript/JS_Object.h"
diff --git a/fpdfsdk/src/javascript/report.h b/fpdfsdk/src/javascript/report.h
index dc43912cb1..55d74648fc 100644
--- a/fpdfsdk/src/javascript/report.h
+++ b/fpdfsdk/src/javascript/report.h
@@ -7,6 +7,8 @@
#ifndef FPDFSDK_SRC_JAVASCRIPT_REPORT_H_
#define FPDFSDK_SRC_JAVASCRIPT_REPORT_H_
+#include <vector>
+
#include "fpdfsdk/src/javascript/JS_Define.h"
class Report : public CJS_EmbedObj {
diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp
index c9149be570..52a93625b9 100644
--- a/fpdfsdk/src/javascript/util.cpp
+++ b/fpdfsdk/src/javascript/util.cpp
@@ -8,6 +8,9 @@
#include <time.h>
+#include <string>
+#include <vector>
+
#include "core/include/fxcrt/fx_ext.h"
#include "fpdfsdk/include/javascript/IJavaScript.h"
#include "fpdfsdk/src/javascript/JS_Context.h"
diff --git a/fpdfsdk/src/javascript/util.h b/fpdfsdk/src/javascript/util.h
index 9441b11b13..6e3a5d2901 100644
--- a/fpdfsdk/src/javascript/util.h
+++ b/fpdfsdk/src/javascript/util.h
@@ -7,7 +7,8 @@
#ifndef FPDFSDK_SRC_JAVASCRIPT_UTIL_H_
#define FPDFSDK_SRC_JAVASCRIPT_UTIL_H_
-#include <string> // For std::wstring.
+#include <string>
+#include <vector>
#include "fpdfsdk/src/javascript/JS_Define.h"