Both PAL_Win32 and PAL_CPP11 have the exact same `WorkerThread` implementation (copy/pasted). This change extracts out the `WorkerThread` class from the Win32/CPP11 files _verbatim_ and puts them in a separate WorkerThread.hpp|cpp. The only change to the WorkerThread class is the introduction of an `IWorkerThread` interface and `WorkerThreadFactory`. This interface will be useful for when MIP creates its own custom WorkerThread that dispatches tasks to an external DLL.
I considered creating a separate PAL_CoreLib or PAL_MIP implementation, but it would everything except `WorkerThread` with the existing Win32/CPP11 PALs, so that seemed like the wrong abstraction.
I would like to merge this change to the main onesdk branch so that when I create the custom CoreLib/MIP implementation in a separate branch (for now), those changes will be very localized.
HttpClientFactory chooses HttpClient implementation based on build flags. This factory can later be extended additional HttpClient implementations if necessary
Win 10 UWP SDK sporadic crash in HTTP stack.
Essentially it's the same fix that was previously done on Win32 Desktop: when we pass the buffer ptr to debug callback, the request has been already released and this may lead to trying to access the heap block possibly re-allocated for something else. The fix is to avoid de-allocation of HTTP req/resp until the handling is done, so when the wrapper is destroyed - the request object is also destroyed.
Related work items: #1510118
What's done:
* Cleaned-up all clang compiler warnings during library build
* PAL Device ID GUID
* PAL appId
Further TODO:
* BVT for Mac
* Verify all header-only APIs for warnings
* Guidance on custom HTTP provider - Edge team should handle this
* Possibly use our own sqlite3 instead of OS, as very old OS X dyn sqlite3 might be too old
Related work items: #1470816
* Remove RuntimeConfigDecorator. The decorate method does nothing, so it just eats memory.
* Move all data members of EventProperties into EventPropertiesStorage, and heap allocate that rather than heap allocating all the STL types. This has the bonus that the stack usage of every EventProperties is now sizeof(void*)
Fixes:
* implement HTTP stack passing of request body to callback for DDV tool
* add Microsoft googletest nupkg to enable visualization of test results in Visual Studio
* fix stats and stats session IDs
* MS Edge: fix telemetry not working if RO context is already inited
* Fix SetType API not working that breaks ODIN annotation processor
* BVT test fixes
Related work items: #1403111, #1403119, #1459042
* address an issue with FlushAndTeardown taking too long: check for DB record count and pending uploads
* address an issue with possible duplication on shutdown (in-flight records successfully uploaded have not been unmarked)
* make API test with respect to logging and upload more strict
* remove Mincore.lib from the build, use Version.lib instead (needed for Win 7 compat)
* downgrade several printouts from INFO to TRACE to reduce the noise at INFO level
* send ram records first and respect their latency: critical goes to in-flight first prior to normal
* respect the "wantMore" flag. We were getting a situation where some records were "stuck" in marked state without being uploaded if these didn't fit into HTTP request
Related work items: #1400900
LogManagerFactory: move ILogManager create/destroy to factory
LogManagerImpl: add GetLogController method, thus restricting controller functionality via protected inheritance
LogManagerProvider: refactor GetLogManager to Get because LogManagerProvider provides only LogManager's, right... not FOos or Bars
EventProperties: add rough-in for safely passing EventProperties as a C struct across ABI boundary (this would be needed for header-only ABI stable Aria)
ILogManager: make controller functionality protected and add GetLogController
LogManagerBase: adjust the template to match the 2nd level API surface changes
LogManagerProvider: reinstate CreateLogManager and DestroyLogManager, although we discussed that we "don't remember" of the practical reasons why we named them this way.
NullObjects: implement the API changes for NULL object LogManager
Version: just a version change. Ideally we should kill the header from repo
EventProperties: pack/unpack methods for translation of EventProperties into lean C struct, for passing across the ABI boundary (not advertising this to the customers just yet, subject to change)
- implementation of Flush method - to move records from in-ram sqlite to on-disk sqlite db
- ability to forward debug callbacks to outside shim (needed for templated LogManager impl). No API changes, but internal impl!
- DebugSource.cpp : forward events to outside shim located at LogManager impl templated surface
- RuntimeConfig_Default.hpp : no longer need to set the path here, as it's done in LogManagerImpl
- ESCConfigCache.cpp : format changes and moved GetAppLocalTempDirectory to MAT as common cross-plat routine
- HttpResponseDecoder.cpp : temporary debug-only change to catch references to deallocated ptrs and assert on that
- IOfflineStorage.hpp : add Flush method (move ram to disk) and a callback for records saved to disk
- DebugEvents.hpp : proxy-forward callbacks to another "cascaded" listener
- ILogManager.hpp : AttachEventSource / DetachEventSource - attach "cascaded" proxy source (as there could be many templ ref to one instance)
- LogManagerBase.hpp : save primary tenant token back to configuration and attach "local" Debug event source proxy on a template
- NullObjects.hpp : add stubs to NULL-object pattern implementation
- Variant.hpp / VariantType.hpp : add draft implementation of thread-safe variants and fix vs201x memory corruption in destructor
- ISqlite3Proxy.hpp : expose v3 close method
- OfflineStorage_SQLite.cpp : move lock to outside of m_db check (race condition fix)
- OfflineStorageHandler.cpp : implementation of async flush copy from ram to disk + callback for records saved to disk
- Move local temp dir detection from UTC helpers to common MAT code
- Statistics.cpp : fix stats record decoration
- TelemetrySystem.cpp : reenable stats and move storage stop after telemetry system stop (otherwise there is a race condition)
- TPM : proper atomic check for uploads scheduled
- Added couple common utils from v1 codebase
Provide an example of how to use LogManager singleton in Guest mode (guest.cpp)
Rename EVTStatus to SDK name-neutral status_t as described in design doc.