| Index: content/browser/loader/loader_test_service_context.cc
|
| diff --git a/content/browser/loader/loader_test_service_context.cc b/content/browser/loader/loader_test_service_context.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e227ecd2889f958deb25f27d5da8feefa3ee0523
|
| --- /dev/null
|
| +++ b/content/browser/loader/loader_test_service_context.cc
|
| @@ -0,0 +1,34 @@
|
| +// Copyright 2015 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 "content/browser/loader/loader_test_service_context.h"
|
| +
|
| +#include <algorithm>
|
| +
|
| +#include "base/logging.h"
|
| +
|
| +namespace content {
|
| +
|
| +LoaderTestServiceContext::LoaderTestServiceContext() = default;
|
| +LoaderTestServiceContext::~LoaderTestServiceContext() = default;
|
| +
|
| +void LoaderTestServiceContext::CreateService(
|
| + mojo::InterfaceRequest<LoaderTestService> request) {
|
| + fprintf(stderr, "%s\n", __PRETTY_FUNCTION__);
|
| + scoped_ptr<LoaderTestServiceImpl> service(
|
| + new LoaderTestServiceImpl(std::move(request), this));
|
| + services_.push_back(std::move(service));
|
| +}
|
| +
|
| +void LoaderTestServiceContext::ServiceHadConnectionError(
|
| + LoaderTestService* service) {
|
| + auto it = std::find_if(services_.begin(), services_.end(),
|
| + [service](const scoped_ptr<LoaderTestServiceImpl>& x) {
|
| + return x.get() == service;
|
| + });
|
| + DCHECK(it != services_.end());
|
| + services_.erase(it);
|
| +}
|
| +
|
| +} // namespace content
|
|
|