The popularity of location-based services (LBSs) leads to severe concerns on users' privacy. With the fast growth of Internet applications such as online social networks, more user information becomes available to the attackers, which allows them to construct new contextual information. This gives rise to new challenges for user privacy protection and often requires improvements on the existing privacypreserving methods. In this paper, we classify contextual information related to LBS query privacy and focus on two types of contexts-user prof iles and query dependency: user profiles have not been deeply studied in LBS query privacy protection, while we are the first to show the impact of query dependency on users' query privacy. More specifically, we present a general framework to enable the attackers to compute a distribution on users with respect to issuing an observed request. The framework can model attackers with different contextual information. We take user profiles and query dependency as examples to illustrate the implementation of the framework and their impact on users' query privacy. Our framework subsequently allows us to show the insufficiency of existing query privacy metrics, e.g., k-anonymity, and propose several new metrics. In the end, we develop new generalisation algorithms to compute regions satisfying users' privacy requirements This article is a revised and extended version of our two conference papers [7,8].Xihui Chen is supported by an AFR PhD grant from the National Research Fund, Luxembourg.