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

Unified Diff: ppapi/native_client/src/trusted/plugin/service_runtime.h

Issue 10815080: Add an interface for nacl to create delete-on-close temp files, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert buildbot hack Created 8 years, 5 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: ppapi/native_client/src/trusted/plugin/service_runtime.h
diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.h b/ppapi/native_client/src/trusted/plugin/service_runtime.h
index 38ade822a6af469f06b3402937d34914034a14a8..89c0e9659750940f80109569d11cc67224f27538 100644
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.h
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.h
@@ -11,6 +11,8 @@
#ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SERVICE_RUNTIME_H_
#define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SERVICE_RUNTIME_H_
+#include <map>
+
#include "native_client/src/include/nacl_macros.h"
#include "native_client/src/include/nacl_scoped_ptr.h"
#include "native_client/src/include/nacl_string.h"
@@ -90,20 +92,35 @@ struct CloseManifestEntryResource {
bool* op_result_ptr;
};
+enum QuotaDataType {
+ PepperQuotaType,
+ TempQuotaType
+};
+
+struct QuotaData {
+ QuotaData(QuotaDataType type_, PP_Resource resource_)
+ : type(type_), resource(resource_) {}
+ QuotaData()
+ : type(PepperQuotaType), resource(0) {}
+
+ QuotaDataType type;
+ PP_Resource resource;
+};
+
struct QuotaRequest {
public:
- QuotaRequest(PP_Resource file_resource,
+ QuotaRequest(QuotaData quota_data,
int64_t start_offset,
int64_t quota_bytes_requested,
int64_t* quota_bytes_granted,
bool* op_complete)
- : resource(file_resource),
+ : data(quota_data),
offset(start_offset),
bytes_requested(quota_bytes_requested),
bytes_granted(quota_bytes_granted),
op_complete_ptr(op_complete) { }
- PP_Resource resource;
+ QuotaData data;
int64_t offset;
int64_t bytes_requested;
int64_t* bytes_granted;
@@ -151,6 +168,7 @@ class PluginReverseInterface: public nacl::ReverseInterface {
void AddQuotaManagedFile(const nacl::string& file_id,
const pp::FileIO& file_io);
+ void AddTempQuotaManagedFile(const nacl::string& file_id);
protected:
virtual void Log_MainThreadContinuation(LogToJavaScriptConsoleResource* p,
@@ -191,7 +209,7 @@ class PluginReverseInterface: public nacl::ReverseInterface {
ServiceRuntime* service_runtime_;
NaClMutex mu_;
NaClCondVar cv_;
- std::map<int64_t, PP_Resource> quota_map_;
+ std::map<int64_t, QuotaData> quota_map_;
bool shutting_down_;
nacl::scoped_ptr<PnaclCoordinator> pnacl_coordinator_;

Powered by Google App Engine
This is Rietveld 408576698