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-14 18:58:55 +02:00
|
|
|
// Constructor for an owned list of arguments.
|
|
|
|
CefProcessMessageImpl(const CefString& name,
|
|
|
|
CefRefPtr<CefListValue> arguments);
|
|
|
|
|
|
|
|
// Constructor for an unowned list of arguments.
|
|
|
|
// Call Detach() when |arguments| is no longer valid.
|
|
|
|
CefProcessMessageImpl(const CefString& name,
|
|
|
|
base::ListValue* arguments,
|
2012-04-03 03:34:16 +02:00
|
|
|
bool read_only);
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
~CefProcessMessageImpl() override;
|
|
|
|
|
|
|
|
// Stop referencing the underlying argument list (which we never owned).
|
|
|
|
void Detach();
|
|
|
|
|
|
|
|
// Transfer ownership of the underlying argument list to the caller.
|
|
|
|
// TODO: Pass by reference instead of ownership if/when Mojo adds support
|
|
|
|
// for that.
|
|
|
|
base::ListValue TakeArgumentList() WARN_UNUSED_RESULT;
|
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;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
private:
|
|
|
|
const CefString name_;
|
|
|
|
CefRefPtr<CefListValue> arguments_;
|
|
|
|
const bool should_detach_ = false;
|
|
|
|
|
|
|
|
IMPLEMENT_REFCOUNTING(CefProcessMessageImpl);
|
2012-04-03 03:34:16 +02:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(CefProcessMessageImpl);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_COMMON_PROCESS_MESSAGE_IMPL_H_
|