Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Unified Diff: tests/fake_browser_ppapi/fake_core.cc

Issue 7292002: Remove plugin connection to PPAPI scriptable objects (var deprecated). Also (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/fake_browser_ppapi/fake_core.h ('k') | tests/fake_browser_ppapi/fake_file_io.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/fake_browser_ppapi/fake_core.cc
===================================================================
--- tests/fake_browser_ppapi/fake_core.cc (revision 6005)
+++ tests/fake_browser_ppapi/fake_core.cc (working copy)
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2011 The Native Client 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 "native_client/tests/fake_browser_ppapi/fake_core.h"
-#include <stdio.h>
-#include "native_client/src/include/nacl_macros.h"
-#include "native_client/src/include/portability.h"
-#include "native_client/tests/fake_browser_ppapi/utility.h"
-#include "ppapi/c/ppb_core.h"
-#include "ppapi/c/pp_completion_callback.h"
-#include "ppapi/c/pp_resource.h"
-
-using fake_browser_ppapi::DebugPrintf;
-
-namespace {
-
-// The plugin does reference counting indirectly by using PPAPI C++ layer.
-// The assumption is that PPAPI tests cover reference counting, so we don't
-// need to test it here. Instead every resource will be registered with the
-// host on creation and deallocated in its destructor.
-
-static void AddRefResource(PP_Resource resource) {
- DebugPrintf("Core::AddRefResource: resource=%"NACL_PRIu64"\n", resource);
-}
-
-static void ReleaseResource(PP_Resource resource) {
- DebugPrintf("Core::ReleaseResource: resource=%"NACL_PRIu64"\n", resource);
-}
-
-static void* MemAlloc(uint32_t num_bytes) {
- DebugPrintf("Core::MemAlloc: num_bytes=%"NACL_PRIuS"\n", num_bytes);
- return malloc(num_bytes);
-}
-
-static void MemFree(void* ptr) {
- DebugPrintf("Core::MemFree: ptr=%p\n", ptr);
- free(ptr);
-}
-
-static PP_Time GetTime() {
- DebugPrintf("Core::GetTime\n");
- static double time = 0.0;
- // TODO(sehr): Do we need a real time here?
- time += 1.0;
- return static_cast<PP_Time>(time);
-}
-
-static PP_TimeTicks GetTimeTicks() {
- DebugPrintf("Core::GetTime\n");
- static double time = 0.0;
- // TODO(sehr): Do we need a real time here?
- time += 1.0;
- return static_cast<PP_Time>(time);
-}
-
-static void CallOnMainThread(int32_t delay_in_milliseconds,
- PP_CompletionCallback callback,
- int32_t result) {
- UNREFERENCED_PARAMETER(callback);
- DebugPrintf("Core::CallOnMainThread: delay=%" NACL_PRIu32
- ", result=%" NACL_PRIu32 "\n",
- delay_in_milliseconds,
- result);
- // NACL_UNIMPLEMENTED(); // possibly leak some resources
-}
-
-static PP_Bool IsMainThread() {
- DebugPrintf("Core::IsMainThread: always true\n");
- return PP_TRUE;
-}
-
-} // namespace
-
-namespace fake_browser_ppapi {
-
-const PPB_Core* Core::GetInterface() {
- static const PPB_Core core_interface = {
- AddRefResource,
- ReleaseResource,
- MemAlloc,
- MemFree,
- GetTime,
- GetTimeTicks,
- CallOnMainThread,
- IsMainThread
- };
- return &core_interface;
-}
-
-} // namespace fake_browser_ppapi
« no previous file with comments | « tests/fake_browser_ppapi/fake_core.h ('k') | tests/fake_browser_ppapi/fake_file_io.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698