From 8cd491562daf7d3a7e2cdc5b83c0a2bbfc3dbc86 Mon Sep 17 00:00:00 2001 From: amaitland Date: Wed, 2 Dec 2015 19:20:54 +1000 Subject: [PATCH] Reorder params for SetInt64, SetJsCallback and SetCefTime - they're not in a logical order --- .../Async/JavascriptAsyncMethodHandler.cpp | 6 +++--- .../CefAppUnmanagedWrapper.cpp | 6 +++--- .../Serialization/V8Serialization.cpp | 4 ++-- CefSharp.Core/Internals/ClientAdapter.cpp | 8 ++++---- .../Internals/JavascriptCallbackProxy.cpp | 10 +++++----- .../Serialization/JsObjectsSerialization.cpp | 6 +++--- .../Internals/Serialization/Primitives.cpp | 18 +++++++++--------- .../Internals/Serialization/Primitives.h | 6 +++--- .../Serialization/V8Serialization.cpp | 2 +- 9 files changed, 33 insertions(+), 33 deletions(-) diff --git a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.cpp b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.cpp index dfb25f4b3..8a5692058 100644 --- a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.cpp +++ b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.cpp @@ -38,9 +38,9 @@ namespace CefSharp SerializeV8Object(arguments[i], params, i, _callbackRegistry); } - SetInt64(context->GetFrame()->GetIdentifier(), argList, 0); - SetInt64(_objectId, argList, 1); - SetInt64(callbackId, argList, 2); + SetInt64(argList, 0, context->GetFrame()->GetIdentifier()); + SetInt64(argList, 1, _objectId); + SetInt64(argList, 2, callbackId); argList->SetString(3, name); argList->SetList(4, params); diff --git a/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp b/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp index 80e9718cc..e5690ece3 100644 --- a/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp +++ b/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp @@ -66,7 +66,7 @@ namespace CefSharp { auto contextCreatedMessage = CefProcessMessage::Create(kOnContextCreatedRequest); - SetInt64(frame->GetIdentifier(), contextCreatedMessage->GetArgumentList(), 0); + SetInt64(contextCreatedMessage->GetArgumentList(), 0, frame->GetIdentifier()); browser->SendProcessMessage(CefProcessId::PID_BROWSER, contextCreatedMessage); } @@ -165,7 +165,7 @@ namespace CefSharp //success: false responseArgList->SetBool(0, false); - SetInt64(callbackId, responseArgList, 1); + SetInt64(responseArgList, 1, callbackId); responseArgList->SetString(2, StringUtils::ToNative(errorMessage)); browser->SendProcessMessage(sourceProcessId, response); @@ -318,7 +318,7 @@ namespace CefSharp auto responseArgList = response->GetArgumentList(); responseArgList->SetBool(0, success); - SetInt64(callbackId, responseArgList, 1); + SetInt64(responseArgList, 1, callbackId); if (!success) { responseArgList->SetString(2, errorMessage); diff --git a/CefSharp.BrowserSubprocess.Core/Serialization/V8Serialization.cpp b/CefSharp.BrowserSubprocess.Core/Serialization/V8Serialization.cpp index 0db728d7d..fe2ff5204 100644 --- a/CefSharp.BrowserSubprocess.Core/Serialization/V8Serialization.cpp +++ b/CefSharp.BrowserSubprocess.Core/Serialization/V8Serialization.cpp @@ -53,7 +53,7 @@ namespace CefSharp } else if (obj->IsDate()) { - SetCefTime(obj->GetDateValue(), list, index); + SetCefTime(list, index, obj->GetDateValue()); } else if (obj->IsArray()) { @@ -78,7 +78,7 @@ namespace CefSharp { auto context = CefV8Context::GetCurrentContext(); auto jsCallback = callbackRegistry->Register(context, obj); - SetJsCallback(jsCallback, list, index); + SetJsCallback(list, index, jsCallback); } else if (obj->IsObject()) { diff --git a/CefSharp.Core/Internals/ClientAdapter.cpp b/CefSharp.Core/Internals/ClientAdapter.cpp index 65e3b66ce..4006e5242 100644 --- a/CefSharp.Core/Internals/ClientAdapter.cpp +++ b/CefSharp.Core/Internals/ClientAdapter.cpp @@ -1066,8 +1066,8 @@ namespace CefSharp auto message = CefProcessMessage::Create(kEvaluateJavascriptRequest); auto argList = message->GetArgumentList(); - SetInt64(frameId, argList, 0); - SetInt64(idAndComplectionSource.Key, argList, 1); + SetInt64(argList, 0, frameId); + SetInt64(argList, 1, idAndComplectionSource.Key); argList->SetString(2, StringUtils::ToNative(script)); auto browserWrapper = static_cast(GetBrowserWrapper(browserId, isBrowserPopup)); @@ -1088,8 +1088,8 @@ namespace CefSharp { auto message = CefProcessMessage::Create(kJavascriptAsyncMethodCallResponse); auto argList = message->GetArgumentList(); - SetInt64(result->FrameId, argList, 0); - SetInt64(result->CallbackId.Value, argList, 1); + SetInt64(argList, 0, result->FrameId); + SetInt64(argList, 1, result->CallbackId.Value); argList->SetBool(2, result->Success); if (result->Success) { diff --git a/CefSharp.Core/Internals/JavascriptCallbackProxy.cpp b/CefSharp.Core/Internals/JavascriptCallbackProxy.cpp index 73545cdc5..10c0fddbd 100644 --- a/CefSharp.Core/Internals/JavascriptCallbackProxy.cpp +++ b/CefSharp.Core/Internals/JavascriptCallbackProxy.cpp @@ -31,9 +31,9 @@ namespace CefSharp auto callbackMessage = CefProcessMessage::Create(kJavascriptCallbackRequest); auto argList = callbackMessage->GetArgumentList(); - SetInt64(_callback->FrameId, argList, 0); - SetInt64(doneCallback.Key, argList, 1); - SetInt64(_callback->Id, argList, 2); + SetInt64(argList, 0, _callback->FrameId); + SetInt64(argList, 1, doneCallback.Key); + SetInt64(argList, 2, _callback->Id); auto paramList = CefListValue::Create(); for (int i = 0; i < parameters->Length; i++) { @@ -51,8 +51,8 @@ namespace CefSharp { auto result = CefProcessMessage::Create(kJavascriptCallbackDestroyRequest); auto argList = result->GetArgumentList(); - SetInt64(_callback->Id, argList, 0); - SetInt64(_callback->FrameId, argList, 1); + SetInt64(argList, 0, _callback->Id); + SetInt64(argList, 1, _callback->FrameId); return result; } diff --git a/CefSharp.Core/Internals/Serialization/JsObjectsSerialization.cpp b/CefSharp.Core/Internals/Serialization/JsObjectsSerialization.cpp index 29e2b7eac..19270fa40 100644 --- a/CefSharp.Core/Internals/Serialization/JsObjectsSerialization.cpp +++ b/CefSharp.Core/Internals/Serialization/JsObjectsSerialization.cpp @@ -16,7 +16,7 @@ namespace CefSharp void SerializeJsObject(JavascriptObject^ jsObject, const CefRefPtr &list, int index) { auto objList = CefListValue::Create(); - SetInt64(jsObject->Id, objList, 0); + SetInt64(objList, 0, jsObject->Id); objList->SetString(1, StringUtils::ToNative(jsObject->Name)); objList->SetString(2, StringUtils::ToNative(jsObject->JavascriptName)); @@ -25,7 +25,7 @@ namespace CefSharp methodList->SetInt(j++, jsObject->Methods->Count); for each (JavascriptMethod^ jsMethod in jsObject->Methods) { - SetInt64(jsMethod->Id, methodList, j++); + SetInt64(methodList, j++, jsMethod->Id); methodList->SetString(j++, StringUtils::ToNative(jsMethod->ManagedName)); methodList->SetString(j++, StringUtils::ToNative(jsMethod->JavascriptName)); methodList->SetInt(j++, jsMethod->ParameterCount); @@ -37,7 +37,7 @@ namespace CefSharp propertyList->SetInt(j++, jsObject->Properties->Count); for each(JavascriptProperty^ jsProperty in jsObject->Properties) { - SetInt64(jsProperty->Id, propertyList, j++); + SetInt64(propertyList, j++, jsProperty->Id); propertyList->SetString(j++, StringUtils::ToNative(jsProperty->ManagedName)); propertyList->SetString(j++, StringUtils::ToNative(jsProperty->JavascriptName)); propertyList->SetBool(j++, jsProperty->IsComplexType); diff --git a/CefSharp.Core/Internals/Serialization/Primitives.cpp b/CefSharp.Core/Internals/Serialization/Primitives.cpp index fc5961352..11f69e000 100644 --- a/CefSharp.Core/Internals/Serialization/Primitives.cpp +++ b/CefSharp.Core/Internals/Serialization/Primitives.cpp @@ -37,7 +37,7 @@ namespace CefSharp } template - void SetInt64(const int64 &value, const CefRefPtr& list, TIndex index) + void SetInt64(const CefRefPtr& list, TIndex index, const int64 &value) { unsigned char mem[1 + sizeof(int64)]; mem[0] = static_cast(PrimitiveType::INT64); @@ -65,7 +65,7 @@ namespace CefSharp } template - void SetCefTime(const CefTime &value, const CefRefPtr& list, TIndex index) + void SetCefTime(const CefRefPtr& list, TIndex index, const CefTime &value) { auto doubleT = value.GetDoubleT(); unsigned char mem[1 + sizeof(double)]; @@ -93,7 +93,7 @@ namespace CefSharp return IsType(PrimitiveType::CEFTIME, list, index); } template - void SetJsCallback(JavascriptCallback^ value, const CefRefPtr& list, TIndex index) + void SetJsCallback(const CefRefPtr& list, TIndex index, JavascriptCallback^ value) { auto id = value->Id; auto browserId = value->BrowserId; @@ -135,22 +135,22 @@ namespace CefSharp return IsType(PrimitiveType::JSCALLBACK, list, index); } - template void SetInt64(const int64 &value, const CefRefPtr& list, int index); - template void SetInt64(const int64 &value, const CefRefPtr& list, CefString index); + template void SetInt64(const CefRefPtr& list, int index, const int64 &value); + template void SetInt64(const CefRefPtr& list, CefString index, const int64 &value); template int64 GetInt64(const CefRefPtr& list, int index); template int64 GetInt64(const CefRefPtr& list, CefString index); template bool IsInt64(const CefRefPtr& list, int index); template bool IsInt64(const CefRefPtr& list, CefString index); - template void SetCefTime(const CefTime &value, const CefRefPtr& list, int index); - template void SetCefTime(const CefTime &value, const CefRefPtr& list, CefString index); + template void SetCefTime(const CefRefPtr& list, int index, const CefTime &value); + template void SetCefTime(const CefRefPtr& list, CefString index, const CefTime &value); template CefTime GetCefTime(const CefRefPtr& list, int index); template CefTime GetCefTime(const CefRefPtr& list, CefString index); template bool IsCefTime(const CefRefPtr& list, int index); template bool IsCefTime(const CefRefPtr& list, CefString index); - template void SetJsCallback(JavascriptCallback^ value, const CefRefPtr& list, int index); - template void SetJsCallback(JavascriptCallback^ value, const CefRefPtr& list, CefString index); + template void SetJsCallback(const CefRefPtr& list, int index, JavascriptCallback^ value); + template void SetJsCallback(const CefRefPtr& list, CefString index, JavascriptCallback^ value); template JavascriptCallback^ GetJsCallback(const CefRefPtr& list, int index); template JavascriptCallback^ GetJsCallback(const CefRefPtr& list, CefString index); template bool IsJsCallback(const CefRefPtr& list, int index); diff --git a/CefSharp.Core/Internals/Serialization/Primitives.h b/CefSharp.Core/Internals/Serialization/Primitives.h index 07403a5ad..22d436163 100644 --- a/CefSharp.Core/Internals/Serialization/Primitives.h +++ b/CefSharp.Core/Internals/Serialization/Primitives.h @@ -13,21 +13,21 @@ namespace CefSharp //Functions to serialize/deserialize specific types into CefBinaryValue template - void SetInt64(const int64 &value, const CefRefPtr& list, TIndex index); + void SetInt64(const CefRefPtr& list, TIndex index, const int64 &value); template int64 GetInt64(const CefRefPtr& list, TIndex index); template bool IsInt64(const CefRefPtr& list, TIndex index); template - void SetCefTime(const CefTime &value, const CefRefPtr& list, TIndex index); + void SetCefTime(const CefRefPtr& list, TIndex index, const CefTime &value); template CefTime GetCefTime(const CefRefPtr& list, TIndex index); template bool IsCefTime(const CefRefPtr& list, TIndex index); template - void SetJsCallback(JavascriptCallback^ value, const CefRefPtr& list, TIndex index); + void SetJsCallback(const CefRefPtr& list, TIndex index, JavascriptCallback^ value); template JavascriptCallback^ GetJsCallback(const CefRefPtr& list, TIndex index); template diff --git a/CefSharp.Core/Internals/Serialization/V8Serialization.cpp b/CefSharp.Core/Internals/Serialization/V8Serialization.cpp index 55a788fbc..187b9c216 100644 --- a/CefSharp.Core/Internals/Serialization/V8Serialization.cpp +++ b/CefSharp.Core/Internals/Serialization/V8Serialization.cpp @@ -97,7 +97,7 @@ namespace CefSharp } else if (type == DateTime::typeid) { - SetCefTime(ConvertDateTimeToCefTime(safe_cast(obj)), list, index); + SetCefTime(list, index, ConvertDateTimeToCefTime(safe_cast(obj))); } else if (type->IsArray) {