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
|
|
|
|
|
|
|
|
#include "include/cef_process_message.h"
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
namespace base {
|
|
|
|
class ListValue;
|
|
|
|
}
|
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,
|
2021-05-20 18:26:36 +02:00
|
|
|
base::ListValue 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.
|
2022-02-21 23:23:40 +01:00
|
|
|
[[nodiscard]] base::ListValue 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_
|