X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcontent%2Fbrowser%2Fzygote_host%2Fzygote_host_impl_linux.h;h=08044fa5a888c5ee8667d0c01d0455bda2df0767;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=95591a4b1be800295d375de9bd734fa50cbf5167;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/content/browser/zygote_host/zygote_host_impl_linux.h b/src/content/browser/zygote_host/zygote_host_impl_linux.h index 95591a4..08044fa 100644 --- a/src/content/browser/zygote_host/zygote_host_impl_linux.h +++ b/src/content/browser/zygote_host/zygote_host_impl_linux.h @@ -5,6 +5,7 @@ #ifndef CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ #define CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ +#include #include #include @@ -26,6 +27,9 @@ class CONTENT_EXPORT ZygoteHostImpl : public ZygoteHost { void Init(const std::string& sandbox_cmd); + // After the last known Zygote child exits, notify the Zygote to exit. + void TearDownAfterLastChild(); + // Tries to start a process of type indicated by process_type. // Returns its pid on success, otherwise // base::kNullProcessHandle; @@ -62,6 +66,16 @@ class CONTENT_EXPORT ZygoteHostImpl : public ZygoteHost { ZygoteHostImpl(); virtual ~ZygoteHostImpl(); + // Notify the Zygote to exit immediately. This object should not be + // used afterwards. + void TearDown(); + + // Should be called every time a Zygote child is born. + void ZygoteChildBorn(pid_t process); + + // Should be called every time a Zygote child died. + void ZygoteChildDied(pid_t process); + // Sends |data| to the zygote via |control_fd_|. If |fds| is non-NULL, the // included file descriptors will also be passed. The caller is responsible // for acquiring |control_lock_|. @@ -80,6 +94,11 @@ class CONTENT_EXPORT ZygoteHostImpl : public ZygoteHost { std::string sandbox_binary_; bool have_read_sandbox_status_word_; int sandbox_status_; + // A lock protecting list_of_running_zygote_children_ and + // should_teardown_after_last_child_exits_. + base::Lock child_tracking_lock_; + std::set list_of_running_zygote_children_; + bool should_teardown_after_last_child_exits_; }; } // namespace content