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

Unified Diff: ppapi/example/example.cc

Issue 6823016: Create a VarPrivate interface to contain the scripting helper functions of Var. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 | « ppapi/cpp/var.cc ('k') | ppapi/ppapi_cpp.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/example/example.cc
===================================================================
--- ppapi/example/example.cc (revision 81054)
+++ ppapi/example/example.cc (working copy)
@@ -25,6 +25,7 @@
#include "ppapi/cpp/image_data.h"
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/module.h"
+#include "ppapi/cpp/private/var_private.h"
#include "ppapi/cpp/rect.h"
#include "ppapi/cpp/url_loader.h"
#include "ppapi/cpp/url_request_info.h"
@@ -61,7 +62,7 @@
virtual pp::Var GetProperty(const pp::Var& name, pp::Var* exception) {
if (name.is_string() && name.AsString() == "blah")
- return pp::Var(instance_, new MyScriptableObject(instance_));
+ return pp::VarPrivate(instance_, new MyScriptableObject(instance_));
return pp::Var();
}
@@ -203,9 +204,9 @@
<< " usb=" << std::hex << key_event.usb_key_code;
// Locate the field to update in the page DOM
- pp::Var window = GetWindowObject();
- pp::Var doc = window.GetProperty("document");
- pp::Var last_key_down = doc.Call("getElementById", "lastKeyDown");
+ pp::VarPrivate window = GetWindowObject();
+ pp::VarPrivate doc = window.GetProperty("document");
+ pp::VarPrivate last_key_down = doc.Call("getElementById", "lastKeyDown");
last_key_down.SetProperty("innerHTML", last_key_down_text.str());
}
@@ -226,7 +227,7 @@
}
virtual pp::Var GetInstanceObject() {
- return pp::Var(this, new MyScriptableObject(this));
+ return pp::VarPrivate(this, new MyScriptableObject(this));
}
pp::ImageData PaintImage(int width, int height) {
@@ -294,9 +295,9 @@
void UpdateFps() {
// Time code doesn't currently compile on Windows, just skip FPS for now.
#ifndef _WIN32
- pp::Var window = GetWindowObject();
- pp::Var doc = window.GetProperty("document");
- pp::Var fps = doc.Call("getElementById", "fps");
+ pp::VarPrivate window = GetWindowObject();
+ pp::VarPrivate doc = window.GetProperty("document");
+ pp::VarPrivate fps = doc.Call("getElementById", "fps");
struct timeval tv;
struct timezone tz = {0, 0};
@@ -374,11 +375,11 @@
private:
void SayHello() {
- pp::Var window = GetWindowObject();
- pp::Var doc = window.GetProperty("document");
- pp::Var body = doc.GetProperty("body");
+ pp::VarPrivate window = GetWindowObject();
+ pp::VarPrivate doc = window.GetProperty("document");
+ pp::VarPrivate body = doc.GetProperty("body");
- pp::Var obj(this, new MyScriptableObject(this));
+ pp::VarPrivate obj(this, new MyScriptableObject(this));
// Our object should have its toString method called.
Log(PP_LOGLEVEL_LOG, "Testing MyScriptableObject::toString():");
« no previous file with comments | « ppapi/cpp/var.cc ('k') | ppapi/ppapi_cpp.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698