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

Side by Side Diff: cc/base/math_util.cc

Issue 390233003: Decrement CreateDoubleValue count (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "cc/base/math_util.h" 5 #include "cc/base/math_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 10
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 res->AppendInteger(box.x()); 643 res->AppendInteger(box.x());
644 res->AppendInteger(box.y()); 644 res->AppendInteger(box.y());
645 res->AppendInteger(box.z()); 645 res->AppendInteger(box.z());
646 res->AppendInteger(box.width()); 646 res->AppendInteger(box.width());
647 res->AppendInteger(box.height()); 647 res->AppendInteger(box.height());
648 res->AppendInteger(box.depth()); 648 res->AppendInteger(box.depth());
649 return res.PassAs<base::Value>(); 649 return res.PassAs<base::Value>();
650 } 650 }
651 651
652 scoped_ptr<base::Value> MathUtil::AsValueSafely(double value) { 652 scoped_ptr<base::Value> MathUtil::AsValueSafely(double value) {
653 return scoped_ptr<base::Value>(base::Value::CreateDoubleValue( 653 return scoped_ptr<base::Value>(new base::FundamentalValue(
654 std::min(value, std::numeric_limits<double>::max()))); 654 std::min(value, std::numeric_limits<double>::max())));
655 } 655 }
656 656
657 scoped_ptr<base::Value> MathUtil::AsValueSafely(float value) { 657 scoped_ptr<base::Value> MathUtil::AsValueSafely(float value) {
658 return scoped_ptr<base::Value>(base::Value::CreateDoubleValue( 658 return scoped_ptr<base::Value>(new base::FundamentalValue(
659 std::min(value, std::numeric_limits<float>::max()))); 659 std::min(value, std::numeric_limits<float>::max())));
660 } 660 }
661 661
662 } // namespace cc 662 } // namespace cc
OLDNEW
« no previous file with comments | « base/prefs/pref_value_map_unittest.cc ('k') | components/policy/core/browser/configuration_policy_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698