OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/loader/loader_test_service_context.h" |
| 6 |
| 7 #include <algorithm> |
| 8 |
| 9 #include "base/logging.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 LoaderTestServiceContext::LoaderTestServiceContext() = default; |
| 14 LoaderTestServiceContext::~LoaderTestServiceContext() = default; |
| 15 |
| 16 void LoaderTestServiceContext::CreateService( |
| 17 mojo::InterfaceRequest<LoaderTestService> request) { |
| 18 fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); |
| 19 scoped_ptr<LoaderTestServiceImpl> service( |
| 20 new LoaderTestServiceImpl(std::move(request), this)); |
| 21 services_.push_back(std::move(service)); |
| 22 } |
| 23 |
| 24 void LoaderTestServiceContext::ServiceHadConnectionError( |
| 25 LoaderTestService* service) { |
| 26 auto it = std::find_if(services_.begin(), services_.end(), |
| 27 [service](const scoped_ptr<LoaderTestServiceImpl>& x) { |
| 28 return x.get() == service; |
| 29 }); |
| 30 DCHECK(it != services_.end()); |
| 31 services_.erase(it); |
| 32 } |
| 33 |
| 34 } // namespace content |
OLD | NEW |