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

Unified Diff: chrome/test/data/extensions/platform_apps/web_view/filesystem/worker/worker.js

Issue 306473012: Plumb file system permission into WebviewGuest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small changes are made. Created 6 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: chrome/test/data/extensions/platform_apps/web_view/filesystem/worker/worker.js
diff --git a/chrome/test/data/extensions/platform_apps/web_view/filesystem/worker/worker.js b/chrome/test/data/extensions/platform_apps/web_view/filesystem/worker/worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..e704385920b495a01ae2e133a2faf0bbb03e2c2b
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/web_view/filesystem/worker/worker.js
@@ -0,0 +1,39 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+self.requestFileSystemSync = self.webkitRequestFileSystemSync ||
+ self.requestFileSystemSync;
+
+function onError(e) {
+ postMessage({ 'type': 'error', 'msg': e.toString() });
+}
+
+function echoMsg(msg) {
+ postMessage({'type': 'echo', 'msg': msg});
+}
+
+function requestFileSystem() {
+ try {
+ echoMsg("call requetFileSystem");
+ var filesystem = requestFileSystemSync(PERSISTENT, 1024 * 1024 /* 1MB */);
+ var result = filesystem ? 1 : 0;
+ postMessage({'type': 'result', 'msg': result});
+ } catch (e) {
+ onError(e);
+ }
+}
+
+addEventListener('message', function(e) {
+ var data = e.data;
+ switch(data.type) {
+ case 'echo':
+ postMessage({'type': 'echo', 'msg': data.msg});
+ return;
+ case 'requestFileSystem':
+ requestFileSystem();
+ return;
+ default:
+ postMessage({'type': 'error', 'msg': 'UNKNOWN MESSAGE TYPE'});
+ }
+});
« no previous file with comments | « chrome/test/data/extensions/platform_apps/web_view/filesystem/worker/test.js ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698