Index: chrome/utility/chrome_content_utility_client.h |
diff --git a/chrome/utility/chrome_content_utility_client.h b/chrome/utility/chrome_content_utility_client.h |
index 1d244197b55103bf0a95ed9f1dfd4691b7232d0d..18fe6b01e768baa5fa6c5e7e90044f0903941f8c 100644 |
--- a/chrome/utility/chrome_content_utility_client.h |
+++ b/chrome/utility/chrome_content_utility_client.h |
@@ -42,6 +42,14 @@ class ChromeContentUtilityClient : public content::ContentUtilityClient { |
max_ipc_message_size_ = max_message_size; |
} |
+ // Reference counting for Mojo services. A reference count is incremented when |
+ // Mojo services are connected to, and decremented when the connection is |
+ // destroyed. When the count reaches 0, this process is freed. The assumption |
+ // is that multiple Mojo services can be connected to in the same utility |
+ // process. This is a Mojo alternative to "batch mode" for Chrome IPC. |
+ void MojoRef(); |
+ void MojoUnref(); |
+ |
private: |
// IPC message handlers. |
void OnUnpackWebResource(const std::string& resource_data); |
@@ -84,6 +92,8 @@ class ChromeContentUtilityClient : public content::ContentUtilityClient { |
// Maximum IPC msg size (default to kMaximumMessageSize; override for testing) |
static int64_t max_ipc_message_size_; |
+ int32_t mojo_service_ref_count_; |
+ |
DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient); |
}; |