1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_OPTIONS_H_
6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_OPTIONS_H_
10 #include "native_client/src/include/nacl_string.h"
11 #include "native_client/src/include/portability.h"
15 // Options for PNaCl translation.
22 // Return |true| if PNaCl is allowed to cache.
23 // PNaCl is allowed to cache if the server sends cache validators
24 // like Last-Modified time or ETags in the HTTP response, and
25 // it does not send "Cache-Control: no-store".
26 bool HasCacheKey() const { return (!cache_validators_
.empty()); }
28 // Return the cache key (which takes into account the bitcode hash,
29 // as well as the commandline options).
30 nacl::string
GetCacheKey() const;
32 // Return a character array of \x00 delimited commandline options.
33 std::vector
<char> GetOptCommandline() const;
35 bool translate() const { return translate_
; }
36 void set_translate(bool t
) { translate_
= t
; }
38 int32_t opt_level() const { return opt_level_
; }
39 void set_opt_level(int32_t l
);
41 void set_cache_validators(const nacl::string
& c
) {
42 cache_validators_
= c
;
46 // NOTE: There are users of this class that use the copy constructor.
47 // Currently the default copy constructor is good enough, but
48 // double-check that it is the case when more fields are added.
51 nacl::string cache_validators_
;
54 } // namespace plugin;
55 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_OPTIONS_H_