2012-04-03 03:34:16 +02:00
|
|
|
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
|
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef CEF_LIBCEF_COMMON_PROCESS_MESSAGE_IMPL_H_
|
|
|
|
#define CEF_LIBCEF_COMMON_PROCESS_MESSAGE_IMPL_H_
|
|
|
|
#pragma once
|
|
|
|
|
2023-01-30 22:42:40 +01:00
|
|
|
#include "base/values.h"
|
2024-04-30 17:45:07 +02:00
|
|
|
#include "cef/include/cef_process_message.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
// CefProcessMessage implementation.
|
|
|
|
class CefProcessMessageImpl : public CefProcessMessage {
|
2012-04-03 03:34:16 +02:00
|
|
|
public:
|
2021-05-20 18:26:36 +02:00
|
|
|
// Constructor for referencing existing |arguments|.
|
2021-05-14 18:58:55 +02:00
|
|
|
CefProcessMessageImpl(const CefString& name,
|
|
|
|
CefRefPtr<CefListValue> arguments);
|
|
|
|
|
2021-05-20 18:26:36 +02:00
|
|
|
// Constructor for creating a new CefListValue that takes ownership of
|
|
|
|
// |arguments|.
|
2021-05-14 18:58:55 +02:00
|
|
|
CefProcessMessageImpl(const CefString& name,
|
2023-01-30 22:42:40 +01:00
|
|
|
base::Value::List arguments,
|
2012-04-03 03:34:16 +02:00
|
|
|
bool read_only);
|
|
|
|
|
2021-12-06 21:40:25 +01:00
|
|
|
CefProcessMessageImpl(const CefProcessMessageImpl&) = delete;
|
|
|
|
CefProcessMessageImpl& operator=(const CefProcessMessageImpl&) = delete;
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
~CefProcessMessageImpl() override;
|
|
|
|
|
2021-05-20 18:26:36 +02:00
|
|
|
// Transfer ownership of the underlying argument list to the caller, or create
|
|
|
|
// a copy if the argument list is already owned by something else.
|
2021-05-14 18:58:55 +02:00
|
|
|
// TODO: Pass by reference instead of ownership if/when Mojo adds support
|
|
|
|
// for that.
|
2023-01-30 22:42:40 +01:00
|
|
|
[[nodiscard]] base::Value::List TakeArgumentList();
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// CefProcessMessage methods.
|
2014-11-12 20:25:15 +01:00
|
|
|
bool IsValid() override;
|
|
|
|
bool IsReadOnly() override;
|
|
|
|
CefRefPtr<CefProcessMessage> Copy() override;
|
|
|
|
CefString GetName() override;
|
|
|
|
CefRefPtr<CefListValue> GetArgumentList() override;
|
2022-07-04 11:49:15 +02:00
|
|
|
CefRefPtr<CefSharedMemoryRegion> GetSharedMemoryRegion() override {
|
|
|
|
return nullptr;
|
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
private:
|
|
|
|
const CefString name_;
|
|
|
|
CefRefPtr<CefListValue> arguments_;
|
|
|
|
|
|
|
|
IMPLEMENT_REFCOUNTING(CefProcessMessageImpl);
|
2012-04-03 03:34:16 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_COMMON_PROCESS_MESSAGE_IMPL_H_
|