| 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);
|
| }
|
|
|
|
|