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

Unified Diff: tests/fake_browser_ppapi/fake_window.cc

Issue 3391010: Update the PPAPI DEPS revision. This change included parameter profile chang... (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 10 years, 3 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_window.h ('k') | tests/fake_browser_ppapi/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/fake_browser_ppapi/fake_window.cc
===================================================================
--- tests/fake_browser_ppapi/fake_window.cc (revision 3312)
+++ tests/fake_browser_ppapi/fake_window.cc (working copy)
@@ -21,7 +21,7 @@
namespace {
-PP_Var* NewStringVar(const char* str) {
+PP_Var* NewStringVar(PP_Module browser_module, const char* str) {
static const PPB_Var* ppb_var = NULL;
if (ppb_var == NULL) {
ppb_var = reinterpret_cast<const PPB_Var*>(PluginVar::GetInterface());
@@ -31,14 +31,14 @@
}
PP_Var* var = reinterpret_cast<PP_Var*>(malloc(sizeof(*var)));
- *var = ppb_var->VarFromUtf8(str, strlen(str));
+ *var = ppb_var->VarFromUtf8(browser_module, str, strlen(str));
return var;
}
// Returns a PP_Var that mocks the window.location object.
-PP_Var* LocationObject(const char* page_url) {
+PP_Var* LocationObject(PP_Module browser_module, const char* page_url) {
// Populate the properties map.
- PP_Var* href = NewStringVar(page_url);
+ PP_Var* href = NewStringVar(browser_module, page_url);
Object::PropertyMap properties;
properties["href"] = href;
@@ -47,7 +47,7 @@
// Create and return a PP_Var for location.
PP_Var* location = reinterpret_cast<PP_Var*>(malloc(sizeof(*location)));
- *location = Object::New(properties, methods);
+ *location = Object::New(browser_module, properties, methods);
return location;
}
@@ -72,7 +72,7 @@
}
// Returns a PP_Var that mocks the window.console object.
-PP_Var* ConsoleObject() {
+PP_Var* ConsoleObject(PP_Module browser_module) {
// Populate the properties map.
Object::PropertyMap properties;
@@ -81,7 +81,7 @@
methods["log"] = ConsoleLog;
PP_Var* console = reinterpret_cast<PP_Var*>(malloc(sizeof(*console)));
- *console = Object::New(properties, methods);
+ *console = Object::New(browser_module, properties, methods);
return console;
}
@@ -106,17 +106,20 @@
namespace fake_browser_ppapi {
-FakeWindow::FakeWindow(Host* host, const char* page_url) : host_(host) {
+FakeWindow::FakeWindow(PP_Module browser_module,
+ Host* host,
+ const char* page_url) : host_(host) {
// Populate the properties map.
Object::PropertyMap properties;
- properties["console"] = ConsoleObject();
- properties["location"] = LocationObject(page_url);
+ properties["console"] = ConsoleObject(browser_module);
+ properties["location"] = LocationObject(browser_module, page_url);
// Populate the methods map.
Object::MethodMap methods;
methods["alert"] = Alert;
- Object* window_object = new Object(properties, methods);
+ Object* window_object = new Object(browser_module, properties, methods);
window_var_ =
- host_->var_interface()->CreateObject(&ppapi_proxy::Object::object_class,
+ host_->var_interface()->CreateObject(browser_module,
+ &ppapi_proxy::Object::object_class,
window_object);
}
« no previous file with comments | « tests/fake_browser_ppapi/fake_window.h ('k') | tests/fake_browser_ppapi/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698