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

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

Issue 6597044: Revert 76228 - Move core pieces of geolocation from chrome to content.This is... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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/location_provider.cc
===================================================================
--- content/browser/geolocation/location_provider.cc (revision 76230)
+++ content/browser/geolocation/location_provider.cc (working copy)
@@ -1,63 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/geolocation/location_provider.h"
-
-#include "base/logging.h"
-
-LocationProviderBase::LocationProviderBase() {
-}
-
-LocationProviderBase::~LocationProviderBase() {
- DCHECK(CalledOnValidThread());
-}
-
-void LocationProviderBase::RegisterListener(ListenerInterface* listener) {
- DCHECK(CalledOnValidThread());
- DCHECK(listener);
- std::pair<ListenerMap::iterator, bool> result =
- listeners_.insert(std::make_pair(listener, 0));
- DCHECK(result.first != listeners_.end());
-
- int& ref_count = result.first->second;
- const bool& is_new = result.second;
- ++ref_count;
-
- // Check the post condition...
- if (is_new) {
- DCHECK(ref_count == 1);
- } else {
- DCHECK(ref_count > 1);
- }
-}
-
-void LocationProviderBase::UnregisterListener(ListenerInterface *listener) {
- DCHECK(CalledOnValidThread());
- DCHECK(listener);
- ListenerMap::iterator iter = listeners_.find(listener);
- if (iter != listeners_.end()) {
- if (--iter->second == 0) {
- listeners_.erase(iter);
- }
- }
-}
-
-bool LocationProviderBase::has_listeners() const {
- return !listeners_.empty();
-}
-
-void LocationProviderBase::UpdateListeners() {
- DCHECK(CalledOnValidThread());
- for (ListenerMap::const_iterator iter = listeners_.begin();
- iter != listeners_.end();
- ++iter) {
- iter->first->LocationUpdateAvailable(this);
- }
-}
-
-#if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_WIN)
-LocationProviderBase* NewSystemLocationProvider() {
- return NULL;
-}
-#endif
« no previous file with comments | « content/browser/geolocation/location_provider.h ('k') | content/browser/geolocation/mock_location_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698