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

Unified Diff: Source/modules/geolocation/PositionOptions.cpp

Issue 745503002: Replace Dictionary with PositionOptions in geolocation/. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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: Source/modules/geolocation/PositionOptions.cpp
diff --git a/Source/modules/geolocation/PositionOptions.cpp b/Source/modules/geolocation/PositionOptions.cpp
deleted file mode 100644
index ec06ec5b55de6d2b113072bc7b8bede2b0c7277a..0000000000000000000000000000000000000000
--- a/Source/modules/geolocation/PositionOptions.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2014 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 "config.h"
-#include "modules/geolocation/PositionOptions.h"
-
-#include "bindings/core/v8/Dictionary.h"
-#include <limits.h>
-
-namespace blink {
-
-PositionOptions* PositionOptions::create(const Dictionary& options)
-{
- return new PositionOptions(options);
-}
-
-PositionOptions::PositionOptions(const Dictionary& options)
- : m_highAccuracy(false)
- , m_maximumAge(0)
- , m_timeout(std::numeric_limits<unsigned>::max())
-{
- if (options.hasProperty("enableHighAccuracy")) {
- bool highAccuracy;
- if (DictionaryHelper::get(options, "enableHighAccuracy", highAccuracy))
- m_highAccuracy = highAccuracy;
- }
- if (options.hasProperty("maximumAge")) {
- double maximumAge;
- if (DictionaryHelper::get(options, "maximumAge", maximumAge)) {
- if (maximumAge < 0)
- m_maximumAge = 0;
- else if (maximumAge > std::numeric_limits<unsigned>::max())
- m_maximumAge = std::numeric_limits<unsigned>::max();
- else
- m_maximumAge = maximumAge;
haraken 2014/11/20 16:02:07 Do we have test cases for the edge case behavior (
zino 2014/11/20 17:27:15 We already have tests. |maximumAge|: https://cod
- }
- }
- if (options.hasProperty("timeout")) {
- double timeout;
- if (DictionaryHelper::get(options, "timeout", timeout)) {
- if (timeout < 0)
- m_timeout = 0;
- else if (timeout > std::numeric_limits<unsigned>::max())
- m_timeout = std::numeric_limits<unsigned>::max();
- else
- m_timeout = timeout;
- }
- }
-}
-
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698