@@ -438,15 +438,29 @@ class Shell final : public PlatformView::Delegate,
438
438
const std::shared_ptr<fml::ConcurrentTaskRunner>
439
439
GetConcurrentWorkerTaskRunner () const ;
440
440
441
+ // Infer the VM ref and the isolate snapshot based on the settings.
442
+ //
443
+ // If the VM is already running, the settings are ignored, but the returned
444
+ // isolate snapshot always prioritize what is specified by the settings, and
445
+ // falls back to the one VM was launched with.
446
+ //
447
+ // This function is what Shell::Create uses to infer snapshot settings.
448
+ //
449
+ // TODO(dkwingsmt): Extracting this method is part of a bigger change. If the
450
+ // entire change is not eventually landed, we should merge this method back
451
+ // to Create. https://github.com/flutter/flutter/issues/136826
452
+ static std::pair<DartVMRef, fml::RefPtr<const DartSnapshot>>
453
+ InferVmInitDataFromSettings (Settings& settings);
454
+
441
455
private:
442
456
using ServiceProtocolHandler =
443
457
std::function<bool (const ServiceProtocol::Handler::ServiceProtocolMap&,
444
458
rapidjson::Document*)>;
445
459
446
460
// / A collection of message channels (by name) that have sent at least one
447
- // / message from a non-platform thread. Used to prevent printing the error log
448
- // / more than once per channel, as a badly behaving plugin may send multiple
449
- // / messages per second indefinitely.
461
+ // / message from a non-platform thread. Used to prevent printing the error
462
+ // / log more than once per channel, as a badly behaving plugin may send
463
+ // / multiple messages per second indefinitely.
450
464
std::mutex misbehaving_message_channels_mutex_;
451
465
std::set<std::string> misbehaving_message_channels_;
452
466
const TaskRunners task_runners_;
@@ -497,19 +511,20 @@ class Shell final : public PlatformView::Delegate,
497
511
bool frame_timings_report_scheduled_ = false ;
498
512
499
513
// Vector of FrameTiming::kCount * n timestamps for n frames whose timings
500
- // have not been reported yet. Vector of ints instead of FrameTiming is stored
501
- // here for easier conversions to Dart objects.
514
+ // have not been reported yet. Vector of ints instead of FrameTiming is
515
+ // stored here for easier conversions to Dart objects.
502
516
std::vector<int64_t > unreported_timings_;
503
517
504
- // / Manages the displays. This class is thread safe, can be accessed from any
505
- // / of the threads.
518
+ // / Manages the displays. This class is thread safe, can be accessed from
519
+ // / any of the threads.
506
520
std::unique_ptr<DisplayManager> display_manager_;
507
521
508
522
// protects expected_frame_size_ which is set on platform thread and read on
509
523
// raster thread
510
524
std::mutex resize_mutex_;
511
525
512
- // used to discard wrong size layer tree produced during interactive resizing
526
+ // used to discard wrong size layer tree produced during interactive
527
+ // resizing
513
528
std::unordered_map<int64_t , SkISize> expected_frame_sizes_;
514
529
515
530
// Used to communicate the right frame bounds via service protocol.
@@ -746,7 +761,8 @@ class Shell final : public PlatformView::Delegate,
746
761
747
762
// Service protocol handler
748
763
//
749
- // The returned SkSLs are base64 encoded. Decode before storing them to files.
764
+ // The returned SkSLs are base64 encoded. Decode before storing them to
765
+ // files.
750
766
bool OnServiceProtocolGetSkSLs (
751
767
const ServiceProtocol::Handler::ServiceProtocolMap& params,
752
768
rapidjson::Document* response);
@@ -767,8 +783,8 @@ class Shell final : public PlatformView::Delegate,
767
783
768
784
// Service protocol handler
769
785
//
770
- // Forces the FontCollection to reload the font manifest. Used to support hot
771
- // reload for fonts.
786
+ // Forces the FontCollection to reload the font manifest. Used to support
787
+ // hot reload for fonts.
772
788
bool OnServiceProtocolReloadAssetFonts (
773
789
const ServiceProtocol::Handler::ServiceProtocolMap& params,
774
790
rapidjson::Document* response);
0 commit comments