mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Moving the inspector WebSocket proxy server out of the framework directory simplifies the mappings for the HTTP servers. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/687673004
43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
// Copyright 2014 The Chromium 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 "mojo/application/application_runner_chromium.h"
|
|
#include "mojo/public/c/system/main.h"
|
|
#include "mojo/public/cpp/application/application_delegate.h"
|
|
#include "mojo/public/cpp/application/application_impl.h"
|
|
#include "sky/services/inspector/inspector_frontend_impl.h"
|
|
|
|
namespace sky {
|
|
namespace inspector {
|
|
|
|
class Server : public mojo::ApplicationDelegate {
|
|
public:
|
|
Server() {}
|
|
virtual ~Server() {}
|
|
|
|
private:
|
|
// Overridden from mojo::ApplicationDelegate:
|
|
virtual void Initialize(mojo::ApplicationImpl* app) override {
|
|
}
|
|
|
|
virtual bool ConfigureIncomingConnection(
|
|
mojo::ApplicationConnection* connection) override {
|
|
connection->AddService(&fronend_factory_);
|
|
return true;
|
|
}
|
|
|
|
InspectorFronendFactory fronend_factory_;
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(Server);
|
|
};
|
|
|
|
} // namespace inspector
|
|
} // namespace sky
|
|
|
|
MojoResult MojoMain(MojoHandle shell_handle) {
|
|
mojo::ApplicationRunnerChromium runner(new sky::inspector::Server);
|
|
runner.set_message_loop_type(base::MessageLoop::TYPE_IO);
|
|
return runner.Run(shell_handle);
|
|
}
|