blob: 4269ade839e231c86c81ef2fd7acf6ea5655dae2 [file] [log] [blame]
// Copyright 2013 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.
// Defines messages between the browser and worker process, as well as between
// the renderer and worker process.
// Multiply-included message file, hence no include guard.
#include <string>
#include <utility>
#include <vector>
#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "content/common/content_export.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_utils.h"
#define IPC_MESSAGE_START MessagePortMsgStart
// Singly-included section, not converted.
typedef std::pair<base::string16, std::vector<int> > QueuedMessage;
// MessagePort messages
// These are messages sent from the browser to child processes.
// Sends a message to a message port.
base::string16 /* message */,
std::vector<int> /* sent_message_port_ids */,
std::vector<int> /* new_routing_ids */)
// Tells the Message Port Channel object that there are no more in-flight
// messages arriving.
// MessagePortHost messages
// These are messages sent from child processes to the browser.
// Creates a new Message Port Channel object. The first paramaeter is the
// message port channel's routing id in this process. The second parameter
// is the process-wide-unique identifier for that port.
int /* route_id */,
int /* message_port_id */)
// Sent when a Message Port Channel object is destroyed.
int /* message_port_id */)
// Sends a message to a message port. Optionally sends a message port as
// as well if sent_message_port_id != MSG_ROUTING_NONE.
int /* sender_message_port_id */,
base::string16 /* message */,
std::vector<int> /* sent_message_port_ids */)
// Causes messages sent to the remote port to be delivered to this local port.
int /* local_message_port_id */,
int /* remote_message_port_id */)
// Causes the browser to queue messages sent to this port until the the port
// has made sure that all in-flight messages were routed to the new
// destination.
int /* message_port_id */)
// Sends the browser all the queued messages that arrived at this message port
// after it was sent in a postMessage call.
// NOTE: MSVS can't compile the macro if std::vector<std::pair<string16, int> >
// is used, so we typedef it in worker_messages.h.
int /* message_port_id */,
std::vector<QueuedMessage> /* queued_messages */)