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

Side by Side Diff: webkit/plugins/ppapi/quota_file_io.h

Issue 7508010: Pepper quota fix: fire callbacks asynchronously to avoid crash in write callback chain (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed 'protected' Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | webkit/plugins/ppapi/quota_file_io.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WEBKIT_PLUGINS_PPAPI_QUOTA_FILE_IO_H_ 5 #ifndef WEBKIT_PLUGINS_PPAPI_QUOTA_FILE_IO_H_
6 #define WEBKIT_PLUGINS_PPAPI_QUOTA_FILE_IO_H_ 6 #define WEBKIT_PLUGINS_PPAPI_QUOTA_FILE_IO_H_
7 7
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/file_util_proxy.h" 10 #include "base/file_util_proxy.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 void DidQueryForQuotaCheck(); 70 void DidQueryForQuotaCheck();
71 71
72 // The plugin instance that owns this (via PPB_FileIO_Impl). 72 // The plugin instance that owns this (via PPB_FileIO_Impl).
73 PluginInstance* instance_; 73 PluginInstance* instance_;
74 74
75 // The file information associated to this instance. 75 // The file information associated to this instance.
76 base::PlatformFile file_; 76 base::PlatformFile file_;
77 GURL file_url_; 77 GURL file_url_;
78 quota::StorageType storage_type_; 78 quota::StorageType storage_type_;
79 79
80 // Operations waiting for a quota check to finish. 80 // Pending operations that are waiting quota checks and pending
81 // callbacks that are to be fired after the operation;
82 // we use two separate queues for them so that we can safely dequeue the
83 // pending callbacks while enqueueing new operations. (This could
84 // happen when callbacks are dispatched synchronously due to error etc.)
81 std::deque<PendingOperationBase*> pending_operations_; 85 std::deque<PendingOperationBase*> pending_operations_;
86 std::deque<PendingOperationBase*> pending_callbacks_;
82 87
83 // Valid only while there're pending quota checks. 88 // Valid only while there're pending quota checks.
84 int64_t cached_file_size_; 89 int64_t cached_file_size_;
85 int64_t cached_available_space_; 90 int64_t cached_available_space_;
86 91
87 // Quota-related queries and errors occured during inflight quota checks. 92 // Quota-related queries and errors occured during inflight quota checks.
88 int outstanding_quota_queries_; 93 int outstanding_quota_queries_;
89 int outstanding_errors_; 94 int outstanding_errors_;
90 95
91 // For parallel writes bookkeeping. 96 // For parallel writes bookkeeping.
92 int64_t max_written_offset_; 97 int64_t max_written_offset_;
93 int inflight_operations_; 98 int inflight_operations_;
94 99
95 base::ScopedCallbackFactory<QuotaFileIO> callback_factory_; 100 base::ScopedCallbackFactory<QuotaFileIO> callback_factory_;
96 DISALLOW_COPY_AND_ASSIGN(QuotaFileIO); 101 DISALLOW_COPY_AND_ASSIGN(QuotaFileIO);
97 }; 102 };
98 103
99 } // namespace ppapi 104 } // namespace ppapi
100 } // namespace webkit 105 } // namespace webkit
101 106
102 #endif // WEBKIT_PLUGINS_PPAPI_QUOTA_FILE_IO_H_ 107 #endif // WEBKIT_PLUGINS_PPAPI_QUOTA_FILE_IO_H_
OLDNEW
« no previous file with comments | « no previous file | webkit/plugins/ppapi/quota_file_io.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698