summaryrefslogtreecommitdiffstats
path: root/ppapi/host/host_message_context.cc
blob: 28df040074cd988fdd68ef5eaf3626b4fd6ca6f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright (c) 2012 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.

#include "ppapi/host/host_message_context.h"

namespace ppapi {
namespace host {

ReplyMessageContext::ReplyMessageContext() {
}

ReplyMessageContext::ReplyMessageContext(
    const ppapi::proxy::ResourceMessageReplyParams& cp,
    IPC::Message* sync_reply_msg,
    int routing_id)
    : params(cp),
      sync_reply_msg(sync_reply_msg),
      routing_id(routing_id) {
}

ReplyMessageContext::~ReplyMessageContext() {
}

HostMessageContext::HostMessageContext(
    const ppapi::proxy::ResourceMessageCallParams& cp)
    : params(cp),
      sync_reply_msg(NULL),
      routing_id(MSG_ROUTING_NONE) {
}

HostMessageContext::HostMessageContext(
    int routing_id,
    const ppapi::proxy::ResourceMessageCallParams& cp)
    : params(cp),
      sync_reply_msg(NULL),
      routing_id(routing_id) {
}

HostMessageContext::HostMessageContext(
    const ppapi::proxy::ResourceMessageCallParams& cp,
    IPC::Message* reply_msg)
    : params(cp),
      sync_reply_msg(reply_msg),
      routing_id(MSG_ROUTING_NONE) {
}

HostMessageContext::~HostMessageContext() {
}

ReplyMessageContext HostMessageContext::MakeReplyMessageContext() const {
  ppapi::proxy::ResourceMessageReplyParams reply_params(params.pp_resource(),
                                                        params.sequence());
  return ReplyMessageContext(reply_params, sync_reply_msg, routing_id);
}

}  // namespace host
}  // namespace ppapi