| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/memory/scoped_vector.h" | 6 #include "base/memory/scoped_vector.h" |
| 7 #include "base/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
| 8 #include "mojo/common/binding_set.h" | 8 #include "mojo/common/binding_set.h" |
| 9 #include "mojo/public/cpp/bindings/interface_request.h" | 9 #include "mojo/public/cpp/bindings/interface_request.h" |
| 10 #include "mojo/public/cpp/bindings/strong_binding.h" | 10 #include "mojo/public/cpp/bindings/strong_binding.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 public: | 28 public: |
| 29 HttpServerImpl(mojo::ApplicationImpl* app, | 29 HttpServerImpl(mojo::ApplicationImpl* app, |
| 30 HttpServerFactoryImpl* factory, | 30 HttpServerFactoryImpl* factory, |
| 31 mojo::NetAddressPtr requested_local_address); | 31 mojo::NetAddressPtr requested_local_address); |
| 32 ~HttpServerImpl() override; | 32 ~HttpServerImpl() override; |
| 33 | 33 |
| 34 void AddBinding(mojo::InterfaceRequest<HttpServer> request); | 34 void AddBinding(mojo::InterfaceRequest<HttpServer> request); |
| 35 | 35 |
| 36 // HttpServer: | 36 // HttpServer: |
| 37 void SetHandler(const mojo::String& path, | 37 void SetHandler(const mojo::String& path, |
| 38 HttpHandlerPtr http_handler, | 38 mojo::InterfaceHandle<HttpHandler> http_handler, |
| 39 const mojo::Callback<void(bool)>& callback) override; | 39 const mojo::Callback<void(bool)>& callback) override; |
| 40 | 40 |
| 41 void GetPort(const GetPortCallback& callback) override; | 41 void GetPort(const GetPortCallback& callback) override; |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 struct Handler { | 44 struct Handler { |
| 45 Handler(const std::string& pattern, HttpHandlerPtr http_handler); | 45 Handler(const std::string& pattern, HttpHandlerPtr http_handler); |
| 46 ~Handler(); | 46 ~Handler(); |
| 47 scoped_ptr<re2::RE2> pattern; | 47 scoped_ptr<re2::RE2> pattern; |
| 48 HttpHandlerPtr http_handler; | 48 HttpHandlerPtr http_handler; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 // TODO(vtl): Maybe this should be an std::set or unordered_set, which would | 88 // TODO(vtl): Maybe this should be an std::set or unordered_set, which would |
| 89 // simplify OnHandlerConnectionError(). | 89 // simplify OnHandlerConnectionError(). |
| 90 ScopedVector<Handler> handlers_; | 90 ScopedVector<Handler> handlers_; |
| 91 | 91 |
| 92 base::WeakPtrFactory<HttpServerImpl> weak_ptr_factory_; | 92 base::WeakPtrFactory<HttpServerImpl> weak_ptr_factory_; |
| 93 DISALLOW_COPY_AND_ASSIGN(HttpServerImpl); | 93 DISALLOW_COPY_AND_ASSIGN(HttpServerImpl); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 } // namespace http_server | 96 } // namespace http_server |
| OLD | NEW |