core: Add error reporting for corrupted symbols (#4458)
This commit is contained in:
@@ -92,6 +92,10 @@ public:
|
||||
|
||||
// Renderer
|
||||
virtual void onRenderError(std::exception_ptr) {}
|
||||
|
||||
/// Called with a description of a corrupted symbol detected by the symbol guard checks
|
||||
/// (see `MLN_SYMBOL_GUARDS`), on the thread which detected it.
|
||||
virtual void onSymbolError(const std::string&) {}
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <mbgl/tile/tile_operation.hpp>
|
||||
#include <mbgl/gfx/backend.hpp>
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
#include <mbgl/util/symbol_error_observer.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <exception>
|
||||
@@ -19,9 +20,9 @@ namespace gfx {
|
||||
class ShaderRegistry;
|
||||
}
|
||||
|
||||
class RendererObserver {
|
||||
class RendererObserver : public SymbolErrorObserver {
|
||||
public:
|
||||
virtual ~RendererObserver() = default;
|
||||
~RendererObserver() override = default;
|
||||
|
||||
enum class RenderMode : uint32_t {
|
||||
Partial,
|
||||
|
||||
19
include/mbgl/util/symbol_error_observer.hpp
Normal file
19
include/mbgl/util/symbol_error_observer.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
/// Receives errors detected by the symbol guard checks (see `MLN_SYMBOL_GUARDS`).
|
||||
/// Both `TileObserver` and `RendererObserver` derive from this, so that whichever of them owns
|
||||
/// the thread a check ran on can be installed as that thread's error destination, see `ErrorSink`.
|
||||
class SymbolErrorObserver {
|
||||
public:
|
||||
virtual ~SymbolErrorObserver() = default;
|
||||
|
||||
/// Called with a description of a single corrupted item, on the thread which detected it.
|
||||
/// Several calls may be made for the same bucket if it holds more than one corrupted item.
|
||||
virtual void onSymbolError(const std::string&) {}
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
Reference in New Issue
Block a user