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

Unified Diff: chrome/browser/nacl_host/pnacl_file_host.h

Issue 9158005: RFC: Add an interface for having the browser open a pnacl support file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add a test, do some tweaks. Created 8 years, 10 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/browser/nacl_host/pnacl_file_host.h
diff --git a/chrome/browser/nacl_host/pnacl_file_host.h b/chrome/browser/nacl_host/pnacl_file_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..e95d07da947c721baae128fd6c5cf6995a323cd3
--- /dev/null
+++ b/chrome/browser/nacl_host/pnacl_file_host.h
@@ -0,0 +1,41 @@
+// Copyright (c) 2012 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.
+
+#ifndef CHROME_BROWSER_NACL_HOST_PNACL_FILE_HOST_H_
+#define CHROME_BROWSER_NACL_HOST_PNACL_FILE_HOST_H_
+#pragma once
+
+#include <string>
+#include "base/platform_file.h"
+
+class ChromeRenderMessageFilter;
+class FilePath;
+
+namespace IPC {
+class Message;
+} // namespace IPC
+
+// Opens Pnacl Files in the Browser process, on behalf of the NaCl plugin.
+
+namespace pnacl_file_host {
+
+// Open a Pnacl file (readonly) on behalf of the NaCl plugin.
+void GetReadonlyPnaclFd(ChromeRenderMessageFilter* chrome_render_message_filter,
+ const std::string& filename,
+ IPC::Message* reply_msg);
+
+// Return true if the filename requested is valid for opening.
+// Sets file_to_open to the FilePath which we will attempt to open.
+bool PnaclCanOpenFile(const std::string& filename,
+ FilePath *file_to_open);
+
+// Simply opens the file. Returns true on success.
+// Exposed for testing.
+bool PnaclDoOpenFile(const FilePath& file_to_open,
+ base::PlatformFile* out_file);
+
+
+} // namespace pnacl_file_host
+
+#endif // CHROME_BROWSER_NACL_HOST_PNACL_FILE_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698