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

Unified Diff: fxjs/cfxjse_arguments.cpp

Issue 2136213002: Rename fxjse/ to fxjs/ update files to match class names. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Add todo Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fxjs/DEPS ('k') | fxjs/cfxjse_class.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fxjs/cfxjse_arguments.cpp
diff --git a/fxjs/cfxjse_arguments.cpp b/fxjs/cfxjse_arguments.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1ff425d8b139c62837cdc68324ffeb5cba94d28f
--- /dev/null
+++ b/fxjs/cfxjse_arguments.cpp
@@ -0,0 +1,56 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "fxjs/include/cfxjse_arguments.h"
+
+#include "fxjs/include/cfxjse_context.h"
+#include "fxjs/include/cfxjse_value.h"
+
+v8::Isolate* CFXJSE_Arguments::GetRuntime() const {
+ return m_pRetValue->GetIsolate();
+}
+
+int32_t CFXJSE_Arguments::GetLength() const {
+ return m_pInfo->Length();
+}
+
+std::unique_ptr<CFXJSE_Value> CFXJSE_Arguments::GetValue(int32_t index) const {
+ std::unique_ptr<CFXJSE_Value> lpArgValue(
+ new CFXJSE_Value(v8::Isolate::GetCurrent()));
+ lpArgValue->ForceSetValue((*m_pInfo)[index]);
+ return lpArgValue;
+}
+
+FX_BOOL CFXJSE_Arguments::GetBoolean(int32_t index) const {
+ return (*m_pInfo)[index]->BooleanValue();
+}
+
+int32_t CFXJSE_Arguments::GetInt32(int32_t index) const {
+ return static_cast<int32_t>((*m_pInfo)[index]->NumberValue());
+}
+
+FX_FLOAT CFXJSE_Arguments::GetFloat(int32_t index) const {
+ return static_cast<FX_FLOAT>((*m_pInfo)[index]->NumberValue());
+}
+
+CFX_ByteString CFXJSE_Arguments::GetUTF8String(int32_t index) const {
+ v8::Local<v8::String> hString = (*m_pInfo)[index]->ToString();
+ v8::String::Utf8Value szStringVal(hString);
+ return CFX_ByteString(*szStringVal);
+}
+
+CFXJSE_HostObject* CFXJSE_Arguments::GetObject(int32_t index,
+ CFXJSE_Class* pClass) const {
+ v8::Local<v8::Value> hValue = (*m_pInfo)[index];
+ ASSERT(!hValue.IsEmpty());
+ if (!hValue->IsObject())
+ return nullptr;
+ return FXJSE_RetrieveObjectBinding(hValue.As<v8::Object>(), pClass);
+}
+
+CFXJSE_Value* CFXJSE_Arguments::GetReturnValue() {
+ return m_pRetValue;
+}
« no previous file with comments | « fxjs/DEPS ('k') | fxjs/cfxjse_class.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698