Skip to content

Instantly share code, notes, and snippets.

View deepak1556's full-sized avatar

Robo deepak1556

  • Microsoft
  • Japan
View GitHub Profile
@deepak1556
deepak1556 / external-pointer-table-tracer.cc
Created February 19, 2024 17:52
Dump EPT contents for an isolate
// Copyright 2024 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/sandbox/external-pointer-table-tracer.h"
#include <iostream>
#include "src/common/globals.h"
#include "src/execution/isolate.h"
@deepak1556
deepak1556 / frame.html
Last active September 14, 2021 20:52
Web Worker from OOP frame
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<h1>OOP frame</h1>
</body>
<script>
const corsUrl = "https://gist.githubusercontent.com/deepak1556/36c31867ad3a11c3b03a56ca8bd3f536/raw/24a02e75403d0e4fc2fb01959d5698eecc869f3d/worker.js";
@deepak1556
deepak1556 / main.js
Created August 30, 2021 17:56
Keyboard event tester in Electron
// Modules to control application life and create native browser window
const {app, BrowserWindow} = require('electron')
const path = require('path')
function createWindow () {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
@deepak1556
deepak1556 / content_shell.patch
Created August 19, 2021 21:22
Minimal repro for v8::HeapProfiler crash
diff --git a/content/shell/renderer/shell_render_frame_observer.cc b/content/shell/renderer/shell_render_frame_observer.cc
index ed6134a67e3e..dc6de8323542 100644
--- a/content/shell/renderer/shell_render_frame_observer.cc
+++ b/content/shell/renderer/shell_render_frame_observer.cc
@@ -8,7 +8,9 @@
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_frame_observer.h"
#include "content/shell/common/shell_switches.h"
+#include "third_party/blink/public/web/blink.h"
#include "third_party/blink/public/web/web_testing_support.h"
@deepak1556
deepak1556 / index.html
Created June 21, 2021 16:42
OOP shared worker
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
<script>
@deepak1556
deepak1556 / index.html
Last active March 12, 2021 01:07 — forked from jrieken/index.html
Service worker registration crash
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->
We are using Node.js <script>document.write(process.versions.node)</script>,
@deepak1556
deepak1556 / main.js
Created December 12, 2019 01:12
Super key menu labelling issue on linux
const {app, BrowserWindow, Menu} = require('electron')
app.on('ready', function() {
var mainWindow = new BrowserWindow({});
var menuTemplate = [
{
label: 'View',
submenu: [
{
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.23.28105\include\functional:10:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.23.28105\include\xmemory(758,76): error: call to implicitly-deleted copy constructor of 'std::pair<const unsigned int, Ex1>'
::new (const_cast<void*>(static_cast<const volatile void*>(_Ptr))) _Objty(_STD forward<_Types>(_Args)...);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.23.28105\include\list(541,25): note: in instantiation of function template specialization 'std::_Default_allocator_traits<std::allocator<std::_List_node<std::pair<const unsigned int, Ex1>,
void *> > >::construct<std::pair<const unsigned int, Ex1>, const std::pair<const unsigned int, Ex1> &>' requested here
_Alnode_traits::construct(this->_Al, _STD addressof(this->
thread #1, name = 'CrRendererMain', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x500000018)
* frame #0: 0x000000010eb6bdb5 Electron Framework`v8::Context::GetIsolate() [inlined] v8::internal::Isolate::FromHeap(v8::internal::Heap*) at isolate.h:910:71 [opt]
frame #1: 0x000000010eb6bdb5 Electron Framework`v8::Context::GetIsolate() [inlined] v8::internal::GetIsolateFromWritableObject(object=<unavailable>) at isolate-utils-inl.h:41 [opt]
frame #2: 0x000000010eb6bdab Electron Framework`v8::Context::GetIsolate() [inlined] v8::internal::Context::GetIsolate(this=<unavailable>) const at contexts-inl.h:48 [opt]
frame #3: 0x000000010eb6bdab Electron Framework`v8::Context::GetIsolate(this=0x00007f80db840248) at api.cc:5997 [opt]
frame #4: 0x0000000111b32d74 Electron Framework`blink::ToLocalDOMWindow(context=(val_ = 0x00007f80db840248)) at v8_binding_for_core.cc:645:28 [opt]
frame #5: 0x0000000111b3c6a7 Electron Framework`blink::PromiseRejectHandlerInMainThread(v8:
* thread #1, name = 'CrRendererMain', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x500000018)
* frame #0: 0x000000010b07cef5 Electron Framework`v8::Context::GetIsolate() [inlined] v8::internal::Isolate::FromHeap(v8::internal::Heap*) at isolate.h:910:71 [opt]
frame #1: 0x000000010b07cef5 Electron Framework`v8::Context::GetIsolate() [inlined] v8::internal::GetIsolateFromWritableObject(object=<unavailable>) at isolate-utils-inl.h:41 [opt]
frame #2: 0x000000010b07ceeb Electron Framework`v8::Context::GetIsolate() [inlined] v8::internal::Context::GetIsolate(this=<unavailable>) const at contexts-inl.h:48 [opt]
frame #3: 0x000000010b07ceeb Electron Framework`v8::Context::GetIsolate(this=0x00007fdcb203b218) at api.cc:5997 [opt]
frame #4: 0x000000010e0437e4 Electron Framework`blink::ToLocalDOMWindow(context=(val_ = 0x00007fdcb203b218)) at v8_binding_for_core.cc:645:28 [opt]
frame #5: 0x000000010e04d117 Electron Framework`blink::PromiseRejectHandlerInMainThread(v