[M108 Aura Migration][NaCl][PPFwk] Add error logs + SVACE/DLOG/Static analysis fix
[platform/framework/web/chromium-efl.git] / content / renderer / pepper / host_resource_var.cc
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.
4
5 #include "content/renderer/pepper/host_resource_var.h"
6
7 namespace content {
8
9 HostResourceVar::HostResourceVar()
10     : pp_resource_(0),
11       pending_renderer_host_id_(0),
12       pending_browser_host_id_(0) {}
13
14 HostResourceVar::HostResourceVar(PP_Resource pp_resource)
15     : pp_resource_(pp_resource),
16       pending_renderer_host_id_(0),
17       pending_browser_host_id_(0) {}
18
19 HostResourceVar::HostResourceVar(int pending_renderer_host_id,
20                                  const IPC::Message& creation_message)
21     : pp_resource_(0),
22       pending_renderer_host_id_(pending_renderer_host_id),
23       pending_browser_host_id_(0),
24       creation_message_(new IPC::Message(creation_message)) {}
25
26 PP_Resource HostResourceVar::GetPPResource() const { return pp_resource_; }
27
28 int HostResourceVar::GetPendingRendererHostId() const {
29   return pending_renderer_host_id_;
30 }
31
32 int HostResourceVar::GetPendingBrowserHostId() const {
33   return pending_browser_host_id_;
34 }
35
36 const IPC::Message* HostResourceVar::GetCreationMessage() const {
37   return creation_message_.get();
38 }
39
40 bool HostResourceVar::IsPending() const {
41   return pp_resource_ == 0 && creation_message_;
42 }
43
44 HostResourceVar::~HostResourceVar() {}
45
46 }  // namespace content