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

Side by Side Diff: content/browser/device_orientation/provider_unittest.cc

Issue 12210030: Linux/ChromeOS Chromium style checker cleanup, content/ edition. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <map> 5 #include <map>
6 #include <queue> 6 #include <queue>
7 7
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 #include "content/browser/device_orientation/data_fetcher.h" 10 #include "content/browser/device_orientation/data_fetcher.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 ~MockDeviceDataFactory() { 272 ~MockDeviceDataFactory() {
273 } 273 }
274 274
275 // Owned by ProviderImpl. Holds a reference back to MockDeviceDataFactory. 275 // Owned by ProviderImpl. Holds a reference back to MockDeviceDataFactory.
276 class MockDataFetcher : public DataFetcher { 276 class MockDataFetcher : public DataFetcher {
277 public: 277 public:
278 explicit MockDataFetcher(MockDeviceDataFactory* device_data_factory) 278 explicit MockDataFetcher(MockDeviceDataFactory* device_data_factory)
279 : device_data_factory_(device_data_factory) { } 279 : device_data_factory_(device_data_factory) { }
280 280
281 // From DataFetcher. Called by the Provider. 281 // From DataFetcher. Called by the Provider.
282 virtual const DeviceData* GetDeviceData(DeviceData::Type device_data_type) { 282 virtual const DeviceData* GetDeviceData(
283 DeviceData::Type device_data_type) OVERRIDE {
283 base::AutoLock auto_lock(device_data_factory_->lock_); 284 base::AutoLock auto_lock(device_data_factory_->lock_);
284 if (device_data_factory_->is_failing_) 285 if (device_data_factory_->is_failing_)
285 return NULL; 286 return NULL;
286 return device_data_factory_->device_data_map_[device_data_type]; 287 return device_data_factory_->device_data_map_[device_data_type];
287 } 288 }
288 289
289 private: 290 private:
290 scoped_refptr<MockDeviceDataFactory> device_data_factory_; 291 scoped_refptr<MockDeviceDataFactory> device_data_factory_;
291 }; 292 };
292 293
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 MessageLoop::current()->Run(); 701 MessageLoop::current()->Run();
701 702
702 provider_->RemoveObserver(checker_a.get()); 703 provider_->RemoveObserver(checker_a.get());
703 provider_->RemoveObserver(checker_b.get()); 704 provider_->RemoveObserver(checker_b.get());
704 MockDeviceDataFactory::SetCurInstance(NULL); 705 MockDeviceDataFactory::SetCurInstance(NULL);
705 } 706 }
706 707
707 } // namespace 708 } // namespace
708 709
709 } // namespace content 710 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698