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

Unified Diff: ppapi/native_client/tests/ppapi_geturl/module.h

Issue 7740013: Cloning a bunch of stuff from the native_client repository at r6528 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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
Index: ppapi/native_client/tests/ppapi_geturl/module.h
===================================================================
--- ppapi/native_client/tests/ppapi_geturl/module.h (revision 0)
+++ ppapi/native_client/tests/ppapi_geturl/module.h (revision 0)
@@ -0,0 +1,62 @@
+// 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.
+#ifndef TESTS_PPAPI_GETURL_MODULE_H_
+#define TESTS_PPAPI_GETURL_MODULE_H_
+
+#include <string>
+
+#include "ppapi/c/pp_module.h"
+#include "ppapi/c/pp_resource.h"
+#include "ppapi/c/ppb.h"
+#include "ppapi/c/ppb_core.h"
+#include "ppapi/c/ppb_messaging.h"
+#include "ppapi/c/ppb_var.h"
+#include "ppapi/c/ppp.h"
+
+// ppapi_geturl example is deliberately using C PPAPI interface.
+// C++ PPAPI layer has pp::Module wrapper class.
+class Module {
+ public:
+ static Module* Create(PP_Module module_id,
+ PPB_GetInterface get_browser_interface);
+ static Module* Get();
+ static void Free();
+
+ const void* GetPluginInterface(const char* interface_name);
+ const void* GetBrowserInterface(const char* interface_name);
+ PP_Module module_id() { return module_id_; }
+ const PPB_Core* ppb_core_interface() const { return ppb_core_interface_; }
+ const PPB_Messaging* ppb_messaging_interface() const {
+ return ppb_messaging_interface_;
+ }
+ const PPB_Var* ppb_var_interface() const { return ppb_var_interface_; }
+
+ static char* VarToCStr(const PP_Var& var);
+ static std::string VarToStr(const PP_Var& var);
+ static PP_Var StrToVar(const char* str);
+ static PP_Var StrToVar(const std::string& str);
+ static std::string ErrorCodeToStr(int32_t error_code);
+
+ // Constructs a parameterized message string then uses messaging.PostMessage
+ // to send this message back to the browser. The receiving message handler
+ // is defined in ppapi_geturl.html
+ void ReportResult(PP_Instance pp_instance,
+ const char* url,
+ bool as_file,
+ const char* text,
+ bool success);
+ private:
+ PP_Module module_id_;
+ PPB_GetInterface get_browser_interface_;
+ const PPB_Core* ppb_core_interface_;
+ const PPB_Messaging* ppb_messaging_interface_;
+ const PPB_Var* ppb_var_interface_;
+
+ Module(PP_Module module_id, PPB_GetInterface get_browser_interface);
+ ~Module() { }
+ Module(const Module&);
+ void operator=(const Module&);
+};
+
+#endif // TESTS_PPAPI_GETURL_MODULE_H_
« no previous file with comments | « ppapi/native_client/tests/ppapi_geturl/build.scons ('k') | ppapi/native_client/tests/ppapi_geturl/module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698