Commit 747672dd authored by mseaborn's avatar mseaborn Committed by Commit bot

NaCl cleanup: Remove unneeded definition of ResolveFileToken()

This will allow the ResolveFileToken field to be removed from
NaClValidationCache on the NaCl side.

Chromium no longer uses the NaCl side's ability to call back to
ResolveFileToken().  File tokens are handled entirely on the Chromium
side.

Removing this is safe because the NaCl side doesn't call
ResolveFileToken() if the NaClDesc doesn't have a file token
associated with it, or if ResolveFileToken is NULL (and we're setting
it to NULL using memset()).

BUG=https://code.google.com/p/nativeclient/issues/detail?id=4073
TEST=browser_tests

Review URL: https://codereview.chromium.org/897353002

Cr-Commit-Position: refs/heads/master@{#315050}
parent 88df4926
...@@ -31,15 +31,6 @@ NaClValidationQuery* NaClValidationQueryContext::CreateQuery() { ...@@ -31,15 +31,6 @@ NaClValidationQuery* NaClValidationQueryContext::CreateQuery() {
return query; return query;
} }
bool NaClValidationQueryContext::ResolveFileToken(
struct NaClFileToken* file_token,
int32* fd,
std::string* path) {
// This should no longer be used.
CHECK(false);
return false;
}
NaClValidationQuery::NaClValidationQuery(NaClValidationDB* db, NaClValidationQuery::NaClValidationQuery(NaClValidationDB* db,
const std::string& profile_key) const std::string& profile_key)
: state_(READY), : state_(READY),
...@@ -138,24 +129,6 @@ static void DestroyQuery(void* query) { ...@@ -138,24 +129,6 @@ static void DestroyQuery(void* query) {
delete static_cast<NaClValidationQuery*>(query); delete static_cast<NaClValidationQuery*>(query);
} }
static int ResolveFileToken(void* handle, struct NaClFileToken* file_token,
int32* fd, char** file_path,
uint32* file_path_length) {
std::string path;
*file_path = NULL;
*file_path_length = 0;
bool ok = static_cast<NaClValidationQueryContext*>(handle)->
ResolveFileToken(file_token, fd, &path);
if (ok) {
*file_path = static_cast<char*>(malloc(path.length() + 1));
CHECK(*file_path);
memcpy(*file_path, path.data(), path.length());
(*file_path)[path.length()] = 0;
*file_path_length = static_cast<uint32>(path.length());
}
return ok;
}
struct NaClValidationCache* CreateValidationCache( struct NaClValidationCache* CreateValidationCache(
NaClValidationDB* db, const std::string& profile_key, NaClValidationDB* db, const std::string& profile_key,
const std::string& nacl_version) { const std::string& nacl_version) {
...@@ -169,6 +142,5 @@ struct NaClValidationCache* CreateValidationCache( ...@@ -169,6 +142,5 @@ struct NaClValidationCache* CreateValidationCache(
cache->QueryKnownToValidate = QueryKnownToValidate; cache->QueryKnownToValidate = QueryKnownToValidate;
cache->SetKnownToValidate = SetKnownToValidate; cache->SetKnownToValidate = SetKnownToValidate;
cache->DestroyQuery = DestroyQuery; cache->DestroyQuery = DestroyQuery;
cache->ResolveFileToken = ResolveFileToken;
return cache; return cache;
} }
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "base/strings/string_piece.h" #include "base/strings/string_piece.h"
#include "crypto/hmac.h" #include "crypto/hmac.h"
struct NaClFileToken;
struct NaClValidationCache; struct NaClValidationCache;
class NaClValidationDB; class NaClValidationDB;
class NaClValidationQuery; class NaClValidationQuery;
...@@ -24,9 +23,6 @@ class NaClValidationQueryContext { ...@@ -24,9 +23,6 @@ class NaClValidationQueryContext {
NaClValidationQuery* CreateQuery(); NaClValidationQuery* CreateQuery();
bool ResolveFileToken(struct NaClFileToken* file_token, int32* fd,
std::string* path);
private: private:
NaClValidationDB* db_; NaClValidationDB* db_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment