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

Unified Diff: content/browser/geolocation/geolocation.cc

Issue 11269002: Introduce GeolocationPermissionRequestID, a wrapper struct to contain the (render process ID, rende… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 2 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/geolocation/geolocation.cc
===================================================================
--- content/browser/geolocation/geolocation.cc (revision 163741)
+++ content/browser/geolocation/geolocation.cc (working copy)
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop_proxy.h"
+#include "base/stringprintf.h"
#include "content/browser/geolocation/geolocation_provider.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/geoposition.h"
@@ -51,6 +52,37 @@
} // namespace
+
+// GeolocationPermissionRequestID ---------------------------------------------
+
+GeolocationPermissionRequestID::GeolocationPermissionRequestID(
+ int render_process_id,
+ int render_view_id,
+ int bridge_id)
+ : render_process_id(render_process_id),
+ render_view_id(render_view_id),
+ bridge_id(bridge_id) {
+}
+
+bool GeolocationPermissionRequestID::Equals(
+ const GeolocationPermissionRequestID& other) const {
+ return IsForSameTabAs(other) && (bridge_id == other.bridge_id);
+}
+
+bool GeolocationPermissionRequestID::IsForSameTabAs(
+ const GeolocationPermissionRequestID& other) const {
+ return (render_process_id == other.render_process_id) &&
+ (render_view_id == other.render_view_id);
+}
+
+std::string GeolocationPermissionRequestID::ToString() const {
+ return base::StringPrintf("%d,%d,%d", render_process_id, render_view_id,
+ bridge_id);
+}
+
+
+// ----------------------------------------------------------------------------
+
void OverrideLocationForTesting(
const Geoposition& position,
const base::Closure& completion_callback) {

Powered by Google App Engine
This is Rietveld 408576698