Skip to content

Instantly share code, notes, and snippets.

View chinmaygarde's full-sized avatar

Chinmay Garde chinmaygarde

  • San Francisco, CA
  • 05:05 (UTC -07:00)
View GitHub Profile
@chinmaygarde
chinmaygarde / Engine.diff
Created July 10, 2018 23:33
Flutter Engine On Create Isolate Callback Expose
diff --git a/shell/common/engine.cc b/shell/common/engine.cc
index f06c155db..baf0625e1 100644
--- a/shell/common/engine.cc
+++ b/shell/common/engine.cc
@@ -106,6 +106,13 @@ bool Engine::Restart(RunConfiguration configuration) {
return Run(std::move(configuration));
}
+extern "C" {
+typedef void (*OnRootIsolateDidStart)(void);
@chinmaygarde
chinmaygarde / Dockerfile
Created July 2, 2018 18:09
Flutter Android on Docker
# Flutter (https://flutter.io) Developement Environment for Linux
# ===============================================================
#
# This environment passes all Linux Flutter Doctor checks and is sufficient
# for building Android applications and running Flutter tests.
#
# To build iOS applications, a Mac development environment is necessary.
#
FROM debian:stretch
@chinmaygarde
chinmaygarde / bloat_2_flame.rb
Created June 12, 2018 22:52
Bloaty Output 2 Flame Graph for Engine Size.
require 'pathname'
def make_relative_to_src(line)
line.gsub(/\.\.\/\.\.\//, '')
end
def split_path_components(path_name)
Pathname.new(path_name).each_filename.to_a
end
diff --git a/runtime/flutter_runner/engine.cc b/runtime/flutter_runner/engine.cc
index c47dc7d09..53988d796 100644
--- a/runtime/flutter_runner/engine.cc
+++ b/runtime/flutter_runner/engine.cc
@@ -163,6 +163,8 @@ Engine::Engine(Delegate& delegate,
settings_.verbose_logging = true;
+ settings_.advisory_script_uri = debug_label;
+
$FH/engine/src/out/host_debug_unopt/dart-sdk/bin/dart
$FH/engine/src/out/host_debug_unopt/gen/frontend_server.dart.snapshot
--sdk-root
$FH/engine/src/out/host_debug_unopt/flutter_patched_sdk/
--incremental
--strong
--sync-async
--target=flutter
--output-dill
output.dill
diff --git a/content_handler/compositor_context.cc b/content_handler/compositor_context.cc
index 904ef4fad..04b882db4 100644
--- a/content_handler/compositor_context.cc
+++ b/content_handler/compositor_context.cc
@@ -60,13 +60,15 @@ CompositorContext::CompositorContext(
std::string debug_label,
zx::eventpair import_token,
OnMetricsUpdate session_metrics_did_change_callback,
- fxl::Closure session_error_callback)
+ fxl::Closure session_error_callback,
diff --git a/bin/ui/view_manager/view_impl.cc b/bin/ui/view_manager/view_impl.cc
index 7f535c66a..500c65792 100644
--- a/bin/ui/view_manager/view_impl.cc
+++ b/bin/ui/view_manager/view_impl.cc
@@ -15,6 +15,8 @@ ViewImpl::ViewImpl(ViewRegistry* registry, ViewState* state)
ViewImpl::~ViewImpl() {}
void ViewImpl::GetToken(views_v1::View::GetTokenCallback callback) {
+ FXL_LOG(INFO) << "~~~~ In function '" << __FUNCTION__ << "' of file "
+ << __FILE__ << ":" << __LINE__;
@chinmaygarde
chinmaygarde / memgrapher.rb
Last active May 8, 2018 03:18
MemGraph to Graph.
# Create Graphs from Memgraph dumps.
# Sample Usage:
# fx shell memgraph -tvH | ruby memgrapher.rb | dot -T pdf > memgraph.pdf
require 'json'
class Entry
def initialize
@id = 0
#0 0x00000001820b6a3c in _platform_memmove ()
#1 0x00000001a28ec918 in gldModifyTexSubImage ()
#2 0x00000001a365606c in glTexSubImage2D_Exec ()
#3 0x00000001854a8890 in glTexSubImage2D ()
#4 0x0000000105ba8760 in GrGLFunction<void (*)(unsigned int, int, int, int, int, int, unsigned int, unsigned int, void const*)>::GrGLFunction(void (*)(unsigned int, int, int, int, int, int, unsigned int, unsigned int, void const*))::'lambda'(void const*, unsigned int, int, int, int, int, int, unsigned int, unsigned int, void const*)::operator()(void const*, unsigned int, int, int, int, int, int, unsigned int, unsigned int, void const*) const at /Volumes/Mojo/engine/src/out/ios_debug_unopt/../../third_party/skia/include/gpu/gl/GrGLFunctions.h:279
#5 0x0000000105ba86d0 in GrGLFunction<void (*)(unsigned int, int, int, int, int, int, unsigned int, unsigned int, void const*)>::GrGLFunction(void (*)(unsigned int, int, int, int, int, int, unsigned int, unsigned int, void const*))::'lambda'(void const*, unsigned int, int, int,
[00067.890] 27815.28147> fidl channel writing error at ../../garnet/public/lib/fidl/cpp/internal/proxy_controller.cc:60: zx_status_t -11, type , 24 bytes, 1 handles
start of symbolized stack:
#01: _Exit at ??:?
#02: fidl::internal::ReportChannelWritingError(fidl::Message const&, fidl_type const*, int, char const*, int) at ../../out/x64/../../garnet/public/lib/fidl/cpp/internal/logging.cc:59
#03: fidl::internal::ProxyController::Send(fidl_type const*, fidl::Message, std::__2::unique_ptr<fidl::internal::MessageHandler, std::__2::default_delete<fidl::internal::MessageHandler> >) at ../../out/x64/../../garnet/public/lib/fidl/cpp/internal/proxy_controller.cc:60
#04: component::ServiceProvider_Proxy::ConnectToService(fidl::StringPtr, zx::channel) at ../../out/x64/fidling/gen/fuchsia/cpp/component.cc:49
#05: component::ServiceProviderBridge::ConnectToService(fidl::StringPtr, zx::channel) at ../../out/x64/../../garnet/public/lib/svc/cpp/service_provider_bridge.cc:66
#06: operator() at ../../out/x64/../../garnet/publ