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

Unified Diff: native_client_sdk/src/examples/api/file_io/example.js

Issue 15969018: Add directory_entry.cc to libppapi_cpp (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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: native_client_sdk/src/examples/api/file_io/example.js
diff --git a/native_client_sdk/src/examples/api/file_io/example.js b/native_client_sdk/src/examples/api/file_io/example.js
index e73f4b946238dc1f230c85befcd1f7b9267d12bd..1183c9cd433c1652397f20a6f9b462647cb50a36 100644
--- a/native_client_sdk/src/examples/api/file_io/example.js
+++ b/native_client_sdk/src/examples/api/file_io/example.js
@@ -19,6 +19,7 @@ function attachListeners() {
document.getElementById('saveButton').addEventListener('click', saveFile);
document.getElementById('loadButton').addEventListener('click', loadFile);
document.getElementById('deleteButton').addEventListener('click', deleteFile);
+ document.getElementById('listButton').addEventListener('click', listDir);
}
function loadFile() {
@@ -55,6 +56,17 @@ function deleteFile() {
}
}
+function listDir() {
+ if (common.naclModule) {
+ var dirName = document.getElementById('dirName').value;
+
+ // Package a message using a simple protocol containing:
+ // instruction file_name_length file_name
+ var msg = "ls " + dirName.length + " " + dirName;
+ common.naclModule.postMessage(msg);
+ }
+}
+
// Called by the common.js module.
function handleMessage(message_event) {
var messageParts = message_event.data.split("|", 3);
« no previous file with comments | « native_client_sdk/src/build_tools/sdk_files.list ('k') | native_client_sdk/src/examples/api/file_io/file_io.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698