Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/plugins/base/nsPluginNativeWindow.cpp
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* This Source Code Form is subject to the terms of the Mozilla Public
3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6
/**
7
 *  This file is the default implementation of plugin native window
8
 *  empty stubs, it should be replaced with real platform implementation
9
 *  for every platform
10
 */
11
12
#include "nsDebug.h"
13
#include "nsPluginNativeWindow.h"
14
15
class nsPluginNativeWindowImpl : public nsPluginNativeWindow
16
{
17
public:
18
  nsPluginNativeWindowImpl();
19
  virtual ~nsPluginNativeWindowImpl();
20
21
#ifdef MOZ_WIDGET_GTK
22
  NPSetWindowCallbackStruct mWsInfo;
23
#endif
24
};
25
26
nsPluginNativeWindowImpl::nsPluginNativeWindowImpl() : nsPluginNativeWindow()
27
0
{
28
0
  // initialize the struct fields
29
0
  window = nullptr;
30
0
  x = 0;
31
0
  y = 0;
32
0
  width = 0;
33
0
  height = 0;
34
0
  memset(&clipRect, 0, sizeof(clipRect));
35
0
  type = NPWindowTypeWindow;
36
0
37
0
#ifdef MOZ_WIDGET_GTK
38
0
  ws_info = &mWsInfo;
39
0
  mWsInfo.type = 0;
40
0
  mWsInfo.display = nullptr;
41
0
  mWsInfo.visual = nullptr;
42
0
  mWsInfo.colormap = 0;
43
0
  mWsInfo.depth = 0;
44
#elif defined(XP_UNIX) && !defined(XP_MACOSX)
45
  ws_info = nullptr;
46
#endif
47
}
48
49
nsPluginNativeWindowImpl::~nsPluginNativeWindowImpl()
50
0
{
51
0
}
52
53
nsresult PLUG_NewPluginNativeWindow(nsPluginNativeWindow ** aPluginNativeWindow)
54
0
{
55
0
  NS_ENSURE_ARG_POINTER(aPluginNativeWindow);
56
0
  *aPluginNativeWindow = new nsPluginNativeWindowImpl();
57
0
  return NS_OK;
58
0
}
59
60
nsresult PLUG_DeletePluginNativeWindow(nsPluginNativeWindow * aPluginNativeWindow)
61
0
{
62
0
  NS_ENSURE_ARG_POINTER(aPluginNativeWindow);
63
0
  delete static_cast<nsPluginNativeWindowImpl*>(aPluginNativeWindow);
64
0
  return NS_OK;
65
0
}