mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Don't start the Observatory when testing Sky viewer
This commit is contained in:
parent
4c6f6cd8a8
commit
1408fcff9a
@ -11,6 +11,7 @@
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#include "dart/runtime/bin/embedded_dart_io.h"
|
||||
#include "dart/runtime/include/dart_mirrors_api.h"
|
||||
#include "gen/sky/platform/RuntimeEnabledFeatures.h"
|
||||
#include "sky/engine/bindings/builtin.h"
|
||||
#include "sky/engine/bindings/builtin_natives.h"
|
||||
#include "sky/engine/bindings/builtin_sky.h"
|
||||
@ -257,11 +258,13 @@ static Dart_Isolate IsolateCreateCallback(const char* script_uri,
|
||||
// Start the handle watcher from the service isolate so it isn't available
|
||||
// for debugging or general Observatory interaction.
|
||||
EnsureHandleWatcherStarted();
|
||||
std::string ip = "127.0.0.1";
|
||||
const intptr_t port = 8181;
|
||||
const bool service_isolate_booted =
|
||||
DartServiceIsolate::Startup(ip, port, LibraryTagHandler, error);
|
||||
CHECK(service_isolate_booted) << error;
|
||||
if (RuntimeEnabledFeatures::observatoryEnabled()) {
|
||||
std::string ip = "127.0.0.1";
|
||||
const intptr_t port = 8181;
|
||||
const bool service_isolate_booted =
|
||||
DartServiceIsolate::Startup(ip, port, LibraryTagHandler, error);
|
||||
CHECK(service_isolate_booted) << error;
|
||||
}
|
||||
}
|
||||
Dart_ExitIsolate();
|
||||
return isolate;
|
||||
|
||||
@ -118,3 +118,5 @@ WOFF2 status=stable
|
||||
PseudoClassesInMatchingCriteriaInAuthorShadowTrees status=test
|
||||
|
||||
CredentialManager status=test
|
||||
|
||||
Observatory status=stable
|
||||
|
||||
@ -94,6 +94,8 @@ public:
|
||||
|
||||
BLINK_EXPORT static void enableLaxMixedContentChecking(bool);
|
||||
|
||||
BLINK_EXPORT static void enableObservatory(bool);
|
||||
|
||||
private:
|
||||
WebRuntimeFeatures();
|
||||
};
|
||||
|
||||
@ -176,4 +176,9 @@ void WebRuntimeFeatures::enableLaxMixedContentChecking(bool enable)
|
||||
RuntimeEnabledFeatures::setLaxMixedContentCheckingEnabled(enable);
|
||||
}
|
||||
|
||||
void WebRuntimeFeatures::enableObservatory(bool enable)
|
||||
{
|
||||
RuntimeEnabledFeatures::setObservatoryEnabled(enable);
|
||||
}
|
||||
|
||||
} // namespace blink
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
#include "mojo/public/cpp/application/interface_factory_impl.h"
|
||||
#include "mojo/services/content_handler/public/interfaces/content_handler.mojom.h"
|
||||
#include "sky/engine/public/web/Sky.h"
|
||||
#include "sky/engine/public/web/WebRuntimeFeatures.h"
|
||||
#include "sky/services/platform/platform_impl.h"
|
||||
#include "sky/viewer/content_handler_impl.h"
|
||||
#include "sky/viewer/document_view.h"
|
||||
@ -34,6 +35,8 @@ class Viewer : public mojo::ApplicationDelegate,
|
||||
void Initialize(mojo::ApplicationImpl* app) override {
|
||||
RuntimeFlags::Initialize(app);
|
||||
|
||||
blink::WebRuntimeFeatures::enableObservatory(!RuntimeFlags::Get().testing());
|
||||
|
||||
mojo::NetworkServicePtr network_service;
|
||||
app->ConnectToService("mojo:network_service", &network_service);
|
||||
platform_impl_.reset(new PlatformImpl(network_service.Pass()));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user