summaryrefslogtreecommitdiffstats
path: root/ppapi/native_client
diff options
context:
space:
mode:
authorpolina@google.com <polina@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-14 21:59:17 +0000
committerpolina@google.com <polina@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-14 21:59:17 +0000
commit6570e56784b0970646c5c4c704e155015400a032 (patch)
tree6b3adbd125f753a275233834545bedee2a4c8302 /ppapi/native_client
parentd280ab686b2dbfe743bbaa7d39e9d2f03af82e31 (diff)
downloadchromium_src-6570e56784b0970646c5c4c704e155015400a032.zip
chromium_src-6570e56784b0970646c5c4c704e155015400a032.tar.gz
chromium_src-6570e56784b0970646c5c4c704e155015400a032.tar.bz2
PPAPI Fullscreen: move out of Dev.
BUG=41780 TEST=in CL Review URL: http://codereview.chromium.org/8291002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105590 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/native_client')
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc8
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h4
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_fullscreen_rpc_server.cc4
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc2
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.cc6
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h6
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/ppb_fullscreen.srpc4
-rw-r--r--ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.cc38
-rw-r--r--ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.html1
-rw-r--r--ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc12
-rw-r--r--ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h4
11 files changed, 40 insertions, 49 deletions
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc
index 3870142..ab94ccf 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc
@@ -387,10 +387,10 @@ const PPB_Font_Dev* PPBFontInterface() {
return ppb;
}
-const PPB_Fullscreen_Dev* PPBFullscreenInterface() {
- static const PPB_Fullscreen_Dev* ppb =
- static_cast<const PPB_Fullscreen_Dev*>(
- GetBrowserInterfaceSafe(PPB_FULLSCREEN_DEV_INTERFACE));
+const PPB_Fullscreen* PPBFullscreenInterface() {
+ static const PPB_Fullscreen* ppb =
+ static_cast<const PPB_Fullscreen*>(
+ GetBrowserInterfaceSafe(PPB_FULLSCREEN_INTERFACE));
return ppb;
}
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h
index b61ce110..6ce901b 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h
@@ -8,7 +8,6 @@
#include "ppapi/c/dev/ppb_cursor_control_dev.h"
#include "ppapi/c/dev/ppb_find_dev.h"
#include "ppapi/c/dev/ppb_font_dev.h"
-#include "ppapi/c/dev/ppb_fullscreen_dev.h"
#include "ppapi/c/dev/ppb_memory_dev.h"
#include "ppapi/c/dev/ppb_mouse_lock_dev.h"
#include "ppapi/c/dev/ppb_scrollbar_dev.h"
@@ -23,6 +22,7 @@
#include "ppapi/c/ppb_file_io.h"
#include "ppapi/c/ppb_file_ref.h"
#include "ppapi/c/ppb_file_system.h"
+#include "ppapi/c/ppb_fullscreen.h"
#include "ppapi/c/ppb_graphics_2d.h"
#include "ppapi/c/ppb_graphics_3d.h"
#include "ppapi/c/ppb_image_data.h"
@@ -105,7 +105,7 @@ const PPB_FileRef* PPBFileRefInterface();
const PPB_FileSystem* PPBFileSystemInterface();
const PPB_Find_Dev* PPBFindInterface();
const PPB_Font_Dev* PPBFontInterface();
-const PPB_Fullscreen_Dev* PPBFullscreenInterface();
+const PPB_Fullscreen* PPBFullscreenInterface();
const PPB_Graphics2D* PPBGraphics2DInterface();
const PPB_Graphics3D* PPBGraphics3DInterface();
const PPB_Graphics3DTrusted* PPBGraphics3DTrustedInterface();
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_fullscreen_rpc_server.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_fullscreen_rpc_server.cc
index 3e54708..6a97097 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_fullscreen_rpc_server.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_fullscreen_rpc_server.cc
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// SRPC-abstraction wrappers around PPB_Fullscreen_Dev functions.
+// SRPC-abstraction wrappers around PPB_Fullscreen functions.
#include "native_client/src/shared/ppapi_proxy/browser_globals.h"
#include "native_client/src/shared/ppapi_proxy/utility.h"
-#include "ppapi/c/dev/ppb_fullscreen_dev.h"
#include "ppapi/c/pp_size.h"
+#include "ppapi/c/ppb_fullscreen.h"
#include "srpcgen/ppb_rpc.h"
using ppapi_proxy::DebugPrintf;
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc
index faff8e5..fa24d45 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc
@@ -60,7 +60,7 @@ InterfaceMapElement interface_map[] = {
{ PPB_FILESYSTEM_INTERFACE, PluginFileSystem::GetInterface(), true },
{ PPB_FIND_DEV_INTERFACE, PluginFind::GetInterface(), true },
{ PPB_FONT_DEV_INTERFACE, PluginFont::GetInterface(), true },
- { PPB_FULLSCREEN_DEV_INTERFACE, PluginFullscreen::GetInterface(), true },
+ { PPB_FULLSCREEN_INTERFACE, PluginFullscreen::GetInterface(), true },
{ PPB_GRAPHICS_2D_INTERFACE, PluginGraphics2D::GetInterface(), true },
{ PPB_GRAPHICS_3D_INTERFACE, PluginGraphics3D::GetInterface(), true },
{ PPB_IMAGEDATA_INTERFACE, PluginImageData::GetInterface(), true },
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.cc b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.cc
index 3890bbb..478817f 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.cc
@@ -5,8 +5,8 @@
#include "native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h"
#include "native_client/src/shared/ppapi_proxy/plugin_globals.h"
#include "native_client/src/shared/ppapi_proxy/utility.h"
-#include "ppapi/c/dev/ppb_fullscreen_dev.h"
#include "ppapi/c/pp_size.h"
+#include "ppapi/c/ppb_fullscreen.h"
#include "srpcgen/ppb_rpc.h"
namespace ppapi_proxy {
@@ -76,8 +76,8 @@ PP_Bool GetScreenSize(PP_Instance instance, struct PP_Size* size) {
} // namespace
-const PPB_Fullscreen_Dev* PluginFullscreen::GetInterface() {
- static const PPB_Fullscreen_Dev fullscreen_interface = {
+const PPB_Fullscreen* PluginFullscreen::GetInterface() {
+ static const PPB_Fullscreen fullscreen_interface = {
IsFullscreen,
SetFullscreen,
GetScreenSize
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h
index 02b5503..a3e62ab 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h
+++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h
@@ -6,14 +6,14 @@
#define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_PPB_FULLSCREEN_H_
#include "native_client/src/include/nacl_macros.h"
-#include "ppapi/c/dev/ppb_fullscreen_dev.h"
+#include "ppapi/c/ppb_fullscreen.h"
namespace ppapi_proxy {
-// Implements the untrusted side of the PPB_Fullscreen_Dev interface.
+// Implements the untrusted side of the PPB_Fullscreen interface.
class PluginFullscreen {
public:
- static const PPB_Fullscreen_Dev* GetInterface();
+ static const PPB_Fullscreen* GetInterface();
private:
NACL_DISALLOW_COPY_AND_ASSIGN(PluginFullscreen);
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/ppb_fullscreen.srpc b/ppapi/native_client/src/shared/ppapi_proxy/ppb_fullscreen.srpc
index 6dd7186..beb0e62 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/ppb_fullscreen.srpc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/ppb_fullscreen.srpc
@@ -2,8 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# RPC methods used to implement PPB_Fullscreen_Dev interface.
-# See ppapi/c/dev/ppb_fullscreen_dev.h for interface details.
+# RPC methods used to implement PPB_Fullscreen interface.
+# See ppapi/c/dev/ppb_fullscreen.h for interface details.
{
'name': 'PpbFullscreenRpc',
'rpcs': [
diff --git a/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.cc b/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.cc
index 333605e..432a444 100644
--- a/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.cc
+++ b/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Tests PPB_Fullscreen_Dev.
+// Tests PPB_Fullscreen.
#include <string.h>
@@ -11,8 +11,8 @@
#include "native_client/tests/ppapi_test_lib/test_interface.h"
#include "native_client/tests/ppapi_test_lib/testable_callback.h"
-#include "ppapi/c/dev/ppb_fullscreen_dev.h"
#include "ppapi/c/ppb_core.h"
+#include "ppapi/c/ppb_fullscreen.h"
#include "ppapi/c/ppb_graphics_2d.h"
#include "ppapi/c/ppb_input_event.h"
#include "ppapi/c/ppb_instance.h"
@@ -66,24 +66,17 @@ bool CreateGraphics2D(PP_Resource* graphics2d) {
// Test cases
////////////////////////////////////////////////////////////////////////////////
-// Test for the availability of PPB_FULLSCREEN_DEV_INTERFACE.
-void TestGetInterface() {
- printf("--- TestGetInterface\n");
- EXPECT(PPBFullscreenDev() != NULL);
- TEST_PASSED;
-}
-
// Test
// PP_Bool (*IsFullscreen)(PP_Instance instance);
void TestIsFullscreenTrue() {
printf("--- TestIsFullscreenTrue\n");
- EXPECT(PPBFullscreenDev()->IsFullscreen(pp_instance()) == PP_TRUE);
+ EXPECT(PPBFullscreen()->IsFullscreen(pp_instance()) == PP_TRUE);
TEST_PASSED;
}
void TestIsFullscreenFalse() {
printf("--- TestIsFullscreenFalse\n");
- EXPECT(PPBFullscreenDev()->IsFullscreen(pp_instance()) == PP_FALSE);
+ EXPECT(PPBFullscreen()->IsFullscreen(pp_instance()) == PP_FALSE);
TEST_PASSED;
}
@@ -94,7 +87,7 @@ bool g_normal_pending = false;
void TestSetFullscreenTrue() {
printf("--- TestSetFullscreenTrue\n");
- const PPB_Fullscreen_Dev* ppb = PPBFullscreenDev();
+ const PPB_Fullscreen* ppb = PPBFullscreen();
if (ppb->IsFullscreen(pp_instance()) == PP_FALSE) {
// Transition to fullscreen.
// This can only be done when processing a user gesture -
@@ -113,7 +106,7 @@ void TestSetFullscreenTrue() {
void TestSetFullscreenFalse() {
printf("--- TestSetFullscreenFalse\n");
- const PPB_Fullscreen_Dev* ppb = PPBFullscreenDev();
+ const PPB_Fullscreen* ppb = PPBFullscreen();
if (ppb->IsFullscreen(pp_instance()) == PP_TRUE) {
// Transition out of fullscreen.
EXPECT(CreateGraphics2D(&g_graphics2d));
@@ -142,7 +135,7 @@ void TestSetFullscreenFalse() {
void TestGetScreenSizeHelper(PP_Size min_size, PP_Size max_size) {
PP_Size size = PP_MakeSize(0, 0);
- EXPECT(PPBFullscreenDev()->GetScreenSize(pp_instance(), &size) == PP_TRUE);
+ EXPECT(PPBFullscreen()->GetScreenSize(pp_instance(), &size) == PP_TRUE);
EXPECT(IsSizeInRange(size, min_size, max_size));
}
@@ -179,15 +172,15 @@ PP_Bool HandleInputEvent(PP_Instance instance, PP_Resource event) {
// We got the user gesture we needed, no need to handle events anymore.
PPBInputEvent()->ClearInputEventRequest(pp_instance(),
PP_INPUTEVENT_CLASS_MOUSE);
- EXPECT(PPBFullscreenDev()->IsFullscreen(pp_instance()) == PP_FALSE);
+ EXPECT(PPBFullscreen()->IsFullscreen(pp_instance()) == PP_FALSE);
EXPECT(CreateGraphics2D(&g_graphics2d));
- EXPECT(PPBFullscreenDev()->SetFullscreen(pp_instance(), PP_TRUE) == PP_TRUE);
+ EXPECT(PPBFullscreen()->SetFullscreen(pp_instance(), PP_TRUE) == PP_TRUE);
g_fullscreen_pending = true;
// Transition is pending, so additional requests fail.
- EXPECT(PPBFullscreenDev()->SetFullscreen(pp_instance(), PP_TRUE) == PP_FALSE);
- EXPECT(PPBFullscreenDev()->SetFullscreen(pp_instance(), PP_FALSE) ==
+ EXPECT(PPBFullscreen()->SetFullscreen(pp_instance(), PP_TRUE) == PP_FALSE);
+ EXPECT(PPBFullscreen()->SetFullscreen(pp_instance(), PP_FALSE) ==
PP_FALSE);
- EXPECT(PPBFullscreenDev()->IsFullscreen(pp_instance()) == PP_FALSE);
+ EXPECT(PPBFullscreen()->IsFullscreen(pp_instance()) == PP_FALSE);
// No 2D or 3D device can be bound during transition.
EXPECT(PPBGraphics2D()->IsGraphics2D(g_graphics2d) == PP_TRUE);
EXPECT(PPBInstance()->BindGraphics(pp_instance(), g_graphics2d) ==
@@ -206,7 +199,7 @@ const PPP_InputEvent ppp_input_event_interface = {
PP_Size GetScreenSize() {
PP_Size screen_size = PP_MakeSize(0, 0);
- CHECK(PPBFullscreenDev()->GetScreenSize(pp_instance(), &screen_size));
+ CHECK(PPBFullscreen()->GetScreenSize(pp_instance(), &screen_size));
return screen_size;
}
@@ -245,14 +238,14 @@ void DidChangeView(PP_Instance instance,
const char* test = NULL;
PP_Size screen_size = GetScreenSize();
- if (g_fullscreen_pending && PPBFullscreenDev()->IsFullscreen(pp_instance())) {
+ if (g_fullscreen_pending && PPBFullscreen()->IsFullscreen(pp_instance())) {
test = "TestSetFullscreenTrue";
g_fullscreen_pending = false;
EXPECT(IsSizeEqual(position->size, screen_size));
// NOTE: we cannot reliably test for clip size being equal to the screen
// because it might be affected by JS console, info bars, etc.
} else if (g_normal_pending &&
- !PPBFullscreenDev()->IsFullscreen(pp_instance())) {
+ !PPBFullscreen()->IsFullscreen(pp_instance())) {
test = "TestSetFullscreenFalse";
g_normal_pending = false;
EXPECT(IsRectEqual(*position, g_normal_position));
@@ -277,7 +270,6 @@ const PPP_Instance ppp_instance_interface = {
} // namespace
void SetupTests() {
- RegisterTest("TestGetInterface", TestGetInterface);
RegisterTest("TestIsFullscreenTrue", TestIsFullscreenTrue);
RegisterTest("TestIsFullscreenFalse", TestIsFullscreenFalse);
RegisterTest("TestSetFullscreenTrue", TestSetFullscreenTrue);
diff --git a/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.html b/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.html
index a4b56b7..2ddbfd3 100644
--- a/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.html
+++ b/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.html
@@ -35,7 +35,6 @@
});
}
- addTest("TestGetInterface");
if (screen.width == 2560 && screen.height == 1600) // 30-inch.
addTest("TestGetScreenSize2560x1600");
else if (screen.width == 1920 && screen.height == 1200) // 24-inch.
diff --git a/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc b/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc
index bfbd773..c7fda1a 100644
--- a/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc
+++ b/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc
@@ -7,7 +7,6 @@
#include "ppapi/c/dev/ppb_context_3d_dev.h"
#include "ppapi/c/dev/ppb_cursor_control_dev.h"
#include "ppapi/c/dev/ppb_font_dev.h"
-#include "ppapi/c/dev/ppb_fullscreen_dev.h"
#include "ppapi/c/dev/ppb_memory_dev.h"
#include "ppapi/c/dev/ppb_scrollbar_dev.h"
#include "ppapi/c/dev/ppb_surface_3d_dev.h"
@@ -18,6 +17,7 @@
#include "ppapi/c/ppb_file_io.h"
#include "ppapi/c/ppb_file_ref.h"
#include "ppapi/c/ppb_file_system.h"
+#include "ppapi/c/ppb_fullscreen.h"
#include "ppapi/c/ppb_graphics_2d.h"
#include "ppapi/c/ppb_graphics_3d.h"
#include "ppapi/c/ppb_image_data.h"
@@ -65,6 +65,11 @@ const PPB_FileSystem* PPBFileSystem() {
GetBrowserInterface(PPB_FILESYSTEM_INTERFACE));
}
+const PPB_Fullscreen* PPBFullscreen() {
+ return reinterpret_cast<const PPB_Fullscreen*>(
+ GetBrowserInterfaceSafe(PPB_FULLSCREEN_INTERFACE));
+}
+
const PPB_Graphics2D* PPBGraphics2D() {
return reinterpret_cast<const PPB_Graphics2D*>(
GetBrowserInterfaceSafe(PPB_GRAPHICS_2D_INTERFACE));
@@ -153,11 +158,6 @@ const PPB_Font_Dev* PPBFontDev() {
GetBrowserInterface(PPB_FONT_DEV_INTERFACE));
}
-const PPB_Fullscreen_Dev* PPBFullscreenDev() {
- return reinterpret_cast<const PPB_Fullscreen_Dev*>(
- GetBrowserInterface(PPB_FULLSCREEN_DEV_INTERFACE));
-}
-
const PPB_Memory_Dev* PPBMemoryDev() {
return reinterpret_cast<const PPB_Memory_Dev*>(
GetBrowserInterface(PPB_MEMORY_DEV_INTERFACE));
diff --git a/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h b/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h
index 826ad1b..9071b2a 100644
--- a/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h
+++ b/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h
@@ -20,7 +20,7 @@ struct PPB_FileIO;
struct PPB_FileRef;
struct PPB_FileSystem;
struct PPB_Font_Dev;
-struct PPB_Fullscreen_Dev;
+struct PPB_Fullscreen;
struct PPB_Graphics2D;
struct PPB_Graphics3D;
struct PPB_ImageData;
@@ -54,6 +54,7 @@ const PPB_Core* PPBCore();
const PPB_FileIO* PPBFileIO();
const PPB_FileRef* PPBFileRef();
const PPB_FileSystem* PPBFileSystem();
+const PPB_Fullscreen* PPBFullscreen();
const PPB_Graphics2D* PPBGraphics2D();
const PPB_Graphics3D* PPBGraphics3D();
const PPB_ImageData* PPBImageData();
@@ -77,7 +78,6 @@ const PPB_WheelInputEvent* PPBWheelInputEvent();
const PPB_Context3D_Dev* PPBContext3DDev();
const PPB_CursorControl_Dev* PPBCursorControlDev();
const PPB_Font_Dev* PPBFontDev();
-const PPB_Fullscreen_Dev* PPBFullscreenDev();
const PPB_Memory_Dev* PPBMemoryDev();
const PPB_Scrollbar_Dev* PPBScrollbarDev();
const PPB_Surface3D_Dev* PPBSurface3DDev();