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

Unified Diff: content/browser/indexed_db/indexed_db_dispatcher_host.h

Issue 2062203004: IDBObserver: Lifetime Management: Adding Observer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding Observer Created 4 years, 6 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: content/browser/indexed_db/indexed_db_dispatcher_host.h
diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host.h b/content/browser/indexed_db/indexed_db_dispatcher_host.h
index ba7a65fe36a28ac86dabe84b51889b2aa7d1e551..1af72764864a70db99237fbe1673f1c74ebd09ee 100644
--- a/content/browser/indexed_db/indexed_db_dispatcher_host.h
+++ b/content/browser/indexed_db/indexed_db_dispatcher_host.h
@@ -30,6 +30,7 @@ struct IndexedDBHostMsg_DatabaseCreateIndex_Params;
struct IndexedDBHostMsg_DatabaseCreateObjectStore_Params;
struct IndexedDBHostMsg_DatabaseCreateTransaction_Params;
struct IndexedDBHostMsg_DatabaseDeleteRange_Params;
+struct IndexedDBHostMsg_DatabaseObserve_Params;
struct IndexedDBHostMsg_DatabaseGet_Params;
struct IndexedDBHostMsg_DatabaseGetAll_Params;
struct IndexedDBHostMsg_DatabaseOpenCursor_Params;
@@ -108,6 +109,12 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter {
int64_t host_transaction_id);
static uint32_t TransactionIdToProcessId(int64_t host_transaction_id);
+ // These are called to map a 32-bit front-end (renderer-specific) observer
+ // id to and from a back-end ("host") observer id that encodes the process
+ // id in the high 32 bits. The mapping is host-specific and ids are validated.
+ int64_t HostObserverId(int64_t observer_id);
dmurph 2016/06/15 12:49:43 Why do we need these? Can we just store the ipc_th
palakj1 2016/06/16 07:05:40 I see your point. Keeping connection_id and observ
dmurph 2016/06/16 07:30:33 Ah, so the thread id is always int32_t, huh. Sure,
+ int64_t RendererObserverId(int64_t host_observer_id);
+
std::string HoldBlobData(const IndexedDBBlobInfo& blob_info);
private:
@@ -174,6 +181,7 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter {
void OnVersionChangeIgnored(int32_t ipc_database_id);
void OnDestroyed(int32_t ipc_database_id);
+ void OnObserve(const IndexedDBHostMsg_DatabaseObserve_Params& params);
void OnGet(const IndexedDBHostMsg_DatabaseGet_Params& params);
void OnGetAll(const IndexedDBHostMsg_DatabaseGetAll_Params& params);
// OnPutWrapper starts on the IO thread so that it can grab BlobDataHandles
@@ -217,6 +225,7 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter {
TransactionIDToSizeMap transaction_size_map_;
TransactionIDToOriginMap transaction_origin_map_;
TransactionIDToDatabaseIDMap transaction_database_map_;
+ std::vector<int64_t> observers_;
// Weak pointers are used when an asynchronous quota request is made, in
// case the dispatcher is torn down before the response returns.
@@ -299,7 +308,6 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter {
// Only access on IndexedDB thread.
std::unique_ptr<DatabaseDispatcherHost> database_dispatcher_host_;
std::unique_ptr<CursorDispatcherHost> cursor_dispatcher_host_;
-
// Used to set file permissions for blob storage.
int ipc_process_id_;

Powered by Google App Engine
This is Rietveld 408576698