diff options
author | dan sinclair <dsinclair@chromium.org> | 2017-10-24 21:40:24 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-25 18:14:09 +0000 |
commit | 80435cb746fa7bd22cf062ab39829ec86000fd21 (patch) | |
tree | 9085fa57d5f49eac4b56b065ca572f424c9f744b /fpdfsdk/javascript/Document.h | |
parent | e85107bc8ab5bbd5b2d3f97fd6071d7ce4a78bcc (diff) | |
download | pdfium-80435cb746fa7bd22cf062ab39829ec86000fd21.tar.xz |
Convert JS input params to v8::Local<v8::Value>>s
This CL converts the JS set_* methods and the JSMethod methods to accept
v8::Local<v8::Value> objects instead of CJS_Value objects.
Change-Id: I6de41305deff458eba515bdc3462522b502f74ad
Reviewed-on: https://pdfium-review.googlesource.com/16670
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/Document.h')
-rw-r--r-- | fpdfsdk/javascript/Document.h | 160 |
1 files changed, 85 insertions, 75 deletions
diff --git a/fpdfsdk/javascript/Document.h b/fpdfsdk/javascript/Document.h index 49ac75b746..4b49d7f616 100644 --- a/fpdfsdk/javascript/Document.h +++ b/fpdfsdk/javascript/Document.h @@ -51,329 +51,339 @@ class Document : public CJS_EmbedObj { ~Document() override; bool get_ADBE(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); - bool set_ADBE(CJS_Runtime* pRuntime, const CJS_Value& vp, WideString* sError); + bool set_ADBE(CJS_Runtime* pRuntime, + v8::Local<v8::Value> vp, + WideString* sError); bool get_author(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_author(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_base_URL(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_base_URL(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_bookmark_root(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_bookmark_root(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_calculate(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_calculate(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_collab(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_collab(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_creation_date(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_creation_date(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_creator(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_creator(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_delay(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_delay(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_dirty(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_dirty(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_document_file_name(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_document_file_name(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_external(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_external(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_filesize(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_filesize(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_icons(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_icons(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_info(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); - bool set_info(CJS_Runtime* pRuntime, const CJS_Value& vp, WideString* sError); + bool set_info(CJS_Runtime* pRuntime, + v8::Local<v8::Value> vp, + WideString* sError); bool get_keywords(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_keywords(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_layout(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_layout(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_media(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_media(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_mod_date(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_mod_date(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_mouse_x(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_mouse_x(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_mouse_y(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_mouse_y(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_num_fields(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_num_fields(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_num_pages(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_num_pages(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_page_num(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_page_num(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_page_window_rect(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_page_window_rect(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_path(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); - bool set_path(CJS_Runtime* pRuntime, const CJS_Value& vp, WideString* sError); + bool set_path(CJS_Runtime* pRuntime, + v8::Local<v8::Value> vp, + WideString* sError); bool get_producer(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_producer(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_subject(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_subject(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_title(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_title(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_zoom(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); - bool set_zoom(CJS_Runtime* pRuntime, const CJS_Value& vp, WideString* sError); + bool set_zoom(CJS_Runtime* pRuntime, + v8::Local<v8::Value> vp, + WideString* sError); bool get_zoom_type(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); bool set_zoom_type(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, WideString* sError); bool get_URL(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError); - bool set_URL(CJS_Runtime* pRuntime, const CJS_Value& vp, WideString* sError); + bool set_URL(CJS_Runtime* pRuntime, + v8::Local<v8::Value> vp, + WideString* sError); bool addAnnot(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool addField(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool addLink(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool addIcon(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool calculateNow(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool closeDoc(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool createDataObject(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool deletePages(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool exportAsText(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool exportAsFDF(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool exportAsXFDF(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool extractPages(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool getAnnot(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool getAnnots(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool getAnnot3D(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool getAnnots3D(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool getField(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool getIcon(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool getLinks(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool getNthFieldName(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool getOCGs(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool getPageBox(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool getPageNthWord(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool getPageNthWordQuads(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool getPageNumWords(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool getPrintParams(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool getURL(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool gotoNamedDest(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool importAnFDF(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool importAnXFDF(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool importTextData(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool insertPages(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool mailForm(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool print(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool removeField(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool replacePages(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool resetForm(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool saveAs(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool submitForm(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool syncAnnotScan(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool mailDoc(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); bool removeIcon(CJS_Runtime* pRuntime, - const std::vector<CJS_Value>& params, + const std::vector<v8::Local<v8::Value>>& params, CJS_Value& vRet, WideString& sError); @@ -395,7 +405,7 @@ class Document : public CJS_EmbedObj { const ByteString& propName, WideString* sError); bool setPropertyInternal(CJS_Runtime* pRuntime, - const CJS_Value& vp, + v8::Local<v8::Value> vp, const ByteString& propName, WideString* sError); |