| Index: content/browser/service_worker/service_worker_global_scope_host_impl.cc
|
| diff --git a/content/browser/service_worker/service_worker_global_scope_host_impl.cc b/content/browser/service_worker/service_worker_global_scope_host_impl.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..064e9a483533709f19733eb71422cc69a560645c
|
| --- /dev/null
|
| +++ b/content/browser/service_worker/service_worker_global_scope_host_impl.cc
|
| @@ -0,0 +1,40 @@
|
| +// Copyright 2016 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/service_worker/service_worker_global_scope_host_impl.h"
|
| +
|
| +#include <utility>
|
| +#include "content/browser/service_worker/service_worker_version.h"
|
| +
|
| +
|
| +namespace content {
|
| +
|
| +// static
|
| +void ServiceWorkerGlobalScopeHostImpl::Create(
|
| + base::WeakPtr<ServiceWorkerVersion> version,
|
| + blink::mojom::ServiceWorkerGlobalScopeHostRequest request) {
|
| + new ServiceWorkerGlobalScopeHostImpl(version, std::move(request));
|
| +}
|
| +
|
| +
|
| +ServiceWorkerGlobalScopeHostImpl::ServiceWorkerGlobalScopeHostImpl(
|
| + base::WeakPtr<ServiceWorkerVersion> version,
|
| + blink::mojom::ServiceWorkerGlobalScopeHostRequest request)
|
| + : version_(version),
|
| + binding_(this, std::move(request)) { }
|
| +
|
| +ServiceWorkerGlobalScopeHostImpl::~ServiceWorkerGlobalScopeHostImpl() { }
|
| +
|
| +void ServiceWorkerGlobalScopeHostImpl::SetClient(
|
| + blink::mojom::ServiceWorkerGlobalScopeClientPtr client) {
|
| + if (version_)
|
| + version_->AddMojoService(std::move(client), true);
|
| +}
|
| +void ServiceWorkerGlobalScopeHostImpl::DidHandleSimpleEvent(
|
| + int request_id, ServiceWorkerStatusCode status) {
|
| + LOG(ERROR) << "DidHandleSimpleEvent(" << request_id << "," << status << ")";
|
| + if (version_)
|
| + version_->OnSimpleEventResponse(request_id, status);
|
| +}
|
| +} // namespace content
|
|
|