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

Unified Diff: chrome/utility/chrome_content_utility_client.h

Issue 1028543002: Turn the utility process image decoder into a Mojo service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move to //services. Created 5 years, 9 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: 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);
};

Powered by Google App Engine
This is Rietveld 408576698