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

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

Issue 14750007: NaCl: enable meta-based validation for shared libraries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/nacl_browser.h
diff --git a/chrome/browser/nacl_host/nacl_browser.h b/chrome/browser/nacl_host/nacl_browser.h
index f3d86460119f8565c535869d6d59961091837403..d30af55a7d205f97d3472fb962db5cdc8c71d9c0 100644
--- a/chrome/browser/nacl_host/nacl_browser.h
+++ b/chrome/browser/nacl_host/nacl_browser.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_NACL_HOST_NACL_BROWSER_H_
#include "base/bind.h"
+#include "base/containers/mru_cache.h"
#include "base/files/file_util_proxy.h"
#include "base/memory/singleton.h"
#include "base/memory/weak_ptr.h"
@@ -15,6 +16,15 @@
class URLPattern;
class GURL;
+namespace nacl {
+
+// Open an immutable executable file that can be mmaped.
+// This function should only be called on a tread that can perform file IO.
+void OpenNaClExecutableImpl(const base::FilePath& file_path,
+ base::PlatformFile* file);
+
+}
+
// Represents shared state for all NaClProcessHost objects in the browser.
class NaClBrowser {
public:
@@ -70,6 +80,9 @@ class NaClBrowser {
return validation_cache_.GetValidationCacheKey();
}
+ uint64 PutFilePath(const base::FilePath& path);
+ bool GetFilePath(uint64 nonce, base::FilePath *path);
+
bool QueryKnownToValidate(const std::string& signature, bool off_the_record);
void SetKnownToValidate(const std::string& signature, bool off_the_record);
void ClearValidationCache(const base::Closure& callback);
@@ -123,6 +136,9 @@ class NaClBrowser {
NaClResourceState validation_cache_state_;
base::Callback<void(int)> debug_stub_port_listener_;
+ typedef base::HashingMRUCache<uint64, base::FilePath> PathCacheType;
+ PathCacheType path_cache_;
+
bool ok_;
// A list of pending tasks to start NaCl processes.
« no previous file with comments | « no previous file | chrome/browser/nacl_host/nacl_browser.cc » ('j') | chrome/browser/nacl_host/nacl_process_host.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698