| Index: components/policy/core/common/schema.cc
|
| diff --git a/components/policy/core/common/schema.cc b/components/policy/core/common/schema.cc
|
| index d842773e8e4a354e737689cb3ac104ef46b5d4c2..55d9579238c5a2629ed67f5ed684f43370693832 100644
|
| --- a/components/policy/core/common/schema.cc
|
| +++ b/components/policy/core/common/schema.cc
|
| @@ -10,9 +10,9 @@
|
| #include <utility>
|
|
|
| #include "base/compiler_specific.h"
|
| -#include "base/containers/scoped_ptr_map.h"
|
| #include "base/logging.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "base/stl_util.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "components/json_schema/json_schema_constants.h"
|
| #include "components/json_schema/json_schema_validator.h"
|
| @@ -246,7 +246,7 @@ class Schema::InternalStorage
|
|
|
| // Cache for CompileRegex(), will memorize return value of every call to
|
| // CompileRegex() and return results directly next time.
|
| - mutable base::ScopedPtrMap<std::string, scoped_ptr<re2::RE2>> regex_cache_;
|
| + mutable std::map<std::string, scoped_ptr<re2::RE2>> regex_cache_;
|
|
|
| SchemaData schema_data_;
|
| std::vector<std::string> strings_;
|
| @@ -341,15 +341,14 @@ Schema::InternalStorage::ParseSchema(const base::DictionaryValue& schema,
|
|
|
| re2::RE2* Schema::InternalStorage::CompileRegex(
|
| const std::string& pattern) const {
|
| - base::ScopedPtrMap<std::string, scoped_ptr<re2::RE2>>::const_iterator it =
|
| - regex_cache_.find(pattern);
|
| + auto it = regex_cache_.find(pattern);
|
| if (it == regex_cache_.end()) {
|
| scoped_ptr<re2::RE2> compiled(new re2::RE2(pattern));
|
| re2::RE2* compiled_ptr = compiled.get();
|
| - regex_cache_.insert(pattern, compiled.Pass());
|
| + regex_cache_.insert(std::make_pair(pattern, std::move(compiled)));
|
| return compiled_ptr;
|
| }
|
| - return it->second;
|
| + return it->second.get();
|
| }
|
|
|
| // static
|
|
|