mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
feat: expose frame & move properties to console-message event object (#43617)
* feat: expose frame on console-message event refactor: use property names similar to ServiceWorker's console-message event refactor: don't use deprecated params in tests doc: console-message breaking change chore: add deprecation warning docs: restore deprecated argument descriptions * move console-message deprecations to v34 --------- Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "third_party/blink/public/common/input/web_mouse_event.h"
|
||||
#include "third_party/blink/public/common/input/web_mouse_wheel_event.h"
|
||||
#include "third_party/blink/public/common/widget/device_emulation_params.h"
|
||||
#include "third_party/blink/public/mojom/devtools/console_message.mojom.h"
|
||||
#include "third_party/blink/public/mojom/loader/referrer.mojom.h"
|
||||
#include "ui/base/clipboard/clipboard.h"
|
||||
#include "ui/events/blink/blink_event_util.h"
|
||||
@@ -699,4 +700,18 @@ bool Converter<blink::CloneableMessage>::FromV8(v8::Isolate* isolate,
|
||||
return electron::SerializeV8Value(isolate, val, out);
|
||||
}
|
||||
|
||||
// static
|
||||
v8::Local<v8::Value> Converter<blink::mojom::ConsoleMessageLevel>::ToV8(
|
||||
v8::Isolate* isolate,
|
||||
const blink::mojom::ConsoleMessageLevel& in) {
|
||||
using Val = blink::mojom::ConsoleMessageLevel;
|
||||
static constexpr auto Lookup = base::MakeFixedFlatMap<Val, std::string_view>({
|
||||
{Val::kVerbose, "debug"},
|
||||
{Val::kInfo, "info"},
|
||||
{Val::kWarning, "warning"},
|
||||
{Val::kError, "error"},
|
||||
});
|
||||
return StringToV8(isolate, Lookup.at(in));
|
||||
}
|
||||
|
||||
} // namespace gin
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "third_party/blink/public/common/input/web_input_event.h"
|
||||
#include "third_party/blink/public/common/messaging/cloneable_message.h"
|
||||
#include "third_party/blink/public/common/web_cache/web_cache_resource_type_stats.h"
|
||||
#include "third_party/blink/public/mojom/devtools/console_message.mojom-forward.h"
|
||||
#include "third_party/blink/public/mojom/loader/referrer.mojom-forward.h"
|
||||
|
||||
namespace blink {
|
||||
@@ -126,6 +127,12 @@ struct Converter<blink::CloneableMessage> {
|
||||
blink::CloneableMessage* out);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Converter<blink::mojom::ConsoleMessageLevel> {
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
||||
const blink::mojom::ConsoleMessageLevel& in);
|
||||
};
|
||||
|
||||
v8::Local<v8::Value> EditFlagsToV8(v8::Isolate* isolate, int editFlags);
|
||||
v8::Local<v8::Value> MediaFlagsToV8(v8::Isolate* isolate, int mediaFlags);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user