blob: 99fae7fe52b4e185416a4e0f2530f4ab83177d8e [file] [log] [blame]
// Copyright 2022 The Cobalt Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef COBALT_WORKER_WORKER_SETTINGS_H_
#define COBALT_WORKER_WORKER_SETTINGS_H_
#include "cobalt/script/global_environment.h"
#include "cobalt/script/javascript_engine.h"
#include "cobalt/web/environment_settings.h"
#include "cobalt/web/message_port.h"
namespace cobalt {
namespace worker {
// Worker Environment Settings object as described in
// https://html.spec.whatwg.org/commit-snapshots/465a6b672c703054de278b0f8133eb3ad33d93f4/#script-settings-for-workers
class WorkerSettings : public web::EnvironmentSettings {
public:
WorkerSettings();
explicit WorkerSettings(web::MessagePort* message_port);
web::MessagePort* message_port() const { return message_port_; }
private:
// Outer message port.
web::MessagePort* message_port_ = nullptr;
};
} // namespace worker
} // namespace cobalt
#endif // COBALT_WORKER_WORKER_SETTINGS_H_