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

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

Issue 290993006: Pepper: Remove Quota management from TempFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nits Created 6 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: ppapi/native_client/src/trusted/plugin/service_runtime.cc
diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.cc b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
index 06d03ba950b158582c8feafa4d9e04c32574c2a2..a4f3a8b879da63532c394636d3a0c9ea42e4fbe9 100644
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.cc
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
@@ -88,12 +88,6 @@ class OpenManifestEntryAsyncCallback {
namespace {
-// For doing crude quota enforcement on writes to temp files.
-// We do not allow a temp file bigger than 128 MB for now.
-// There is currently a limit of 32M for nexe text size, so 128M
-// should be plenty for static data
-const int64_t kMaxTempQuota = 0x8000000;
-
class ManifestService {
public:
ManifestService(nacl::WeakRefAnchor* anchor,
@@ -475,36 +469,9 @@ void PluginReverseInterface::ReportExitStatus(int exit_status) {
int64_t PluginReverseInterface::RequestQuotaForWrite(
nacl::string file_id, int64_t offset, int64_t bytes_to_write) {
- NaClLog(4,
- "PluginReverseInterface::RequestQuotaForWrite:"
- " (file_id='%s', offset=%" NACL_PRId64 ", bytes_to_write=%"
- NACL_PRId64 ")\n", file_id.c_str(), offset, bytes_to_write);
- uint64_t file_key = STRTOULL(file_id.c_str(), NULL, 10);
- nacl::MutexLocker take(&mu_);
- if (quota_files_.count(file_key) == 0) {
- // Look up failed to find the requested quota managed resource.
- NaClLog(4, "PluginReverseInterface::RequestQuotaForWrite: failed...\n");
- return 0;
- }
-
- // Because we now only support this interface for tempfiles which are not
- // pepper objects, we can just do some crude quota enforcement here rather
- // than calling out to pepper from the main thread.
- if (offset + bytes_to_write >= kMaxTempQuota)
- return 0;
-
return bytes_to_write;
}
-void PluginReverseInterface::AddTempQuotaManagedFile(
- const nacl::string& file_id) {
- NaClLog(4, "PluginReverseInterface::AddTempQuotaManagedFile: "
- "(file_id='%s')\n", file_id.c_str());
- uint64_t file_key = STRTOULL(file_id.c_str(), NULL, 10);
- nacl::MutexLocker take(&mu_);
- quota_files_.insert(file_key);
-}
-
ServiceRuntime::ServiceRuntime(Plugin* plugin,
int32_t manifest_id,
bool main_service_runtime,
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/service_runtime.h ('k') | ppapi/native_client/src/trusted/plugin/temporary_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698