1 // Copyright 2013 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/renderer/pepper/host_resource_var.h"
9 HostResourceVar::HostResourceVar()
11 pending_renderer_host_id_(0),
12 pending_browser_host_id_(0) {}
14 HostResourceVar::HostResourceVar(PP_Resource pp_resource)
15 : pp_resource_(pp_resource),
16 pending_renderer_host_id_(0),
17 pending_browser_host_id_(0) {}
19 HostResourceVar::HostResourceVar(int pending_renderer_host_id,
20 const IPC::Message& creation_message)
22 pending_renderer_host_id_(pending_renderer_host_id),
23 pending_browser_host_id_(0),
24 creation_message_(new IPC::Message(creation_message)) {}
26 PP_Resource HostResourceVar::GetPPResource() const { return pp_resource_; }
28 int HostResourceVar::GetPendingRendererHostId() const {
29 return pending_renderer_host_id_;
32 int HostResourceVar::GetPendingBrowserHostId() const {
33 return pending_browser_host_id_;
36 const IPC::Message* HostResourceVar::GetCreationMessage() const {
37 return creation_message_.get();
40 bool HostResourceVar::IsPending() const {
41 return pp_resource_ == 0 && creation_message_;
44 HostResourceVar::~HostResourceVar() {}
46 } // namespace content