From e2442fb052b4d170bc4d9312350971287eb1188b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 13 Jun 2016 09:27:13 +0900 Subject: [PATCH] Move converter for std::map to native_mate --- atom/browser/api/atom_api_auto_updater.cc | 1 - atom/common/api/atom_api_crash_reporter.cc | 1 - .../string_map_converter.h | 35 ------------------- filenames.gypi | 1 - vendor/native_mate | 2 +- 5 files changed, 1 insertion(+), 39 deletions(-) delete mode 100644 atom/common/native_mate_converters/string_map_converter.h diff --git a/atom/browser/api/atom_api_auto_updater.cc b/atom/browser/api/atom_api_auto_updater.cc index a1cd0dd3e2b..cb9bce14721 100644 --- a/atom/browser/api/atom_api_auto_updater.cc +++ b/atom/browser/api/atom_api_auto_updater.cc @@ -9,7 +9,6 @@ #include "atom/browser/native_window.h" #include "atom/browser/window_list.h" #include "atom/common/native_mate_converters/callback.h" -#include "atom/common/native_mate_converters/string_map_converter.h" #include "atom/common/node_includes.h" #include "native_mate/dictionary.h" #include "native_mate/object_template_builder.h" diff --git a/atom/common/api/atom_api_crash_reporter.cc b/atom/common/api/atom_api_crash_reporter.cc index 5db1461f88c..184a70c72c1 100644 --- a/atom/common/api/atom_api_crash_reporter.cc +++ b/atom/common/api/atom_api_crash_reporter.cc @@ -6,7 +6,6 @@ #include #include "atom/common/crash_reporter/crash_reporter.h" -#include "atom/common/native_mate_converters/string_map_converter.h" #include "base/bind.h" #include "native_mate/dictionary.h" diff --git a/atom/common/native_mate_converters/string_map_converter.h b/atom/common/native_mate_converters/string_map_converter.h deleted file mode 100644 index 54458ab67b3..00000000000 --- a/atom/common/native_mate_converters/string_map_converter.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2016 GitHub, Inc. -// Use of this source code is governed by the MIT license that can be -// found in the LICENSE file. - -#ifndef ATOM_COMMON_NATIVE_MATE_CONVERTERS_STRING_MAP_CONVERTER_H_ -#define ATOM_COMMON_NATIVE_MATE_CONVERTERS_STRING_MAP_CONVERTER_H_ - -#include -#include - -#include "native_mate/converter.h" - -namespace mate { - -template<> -struct Converter > { - static bool FromV8(v8::Isolate* isolate, - v8::Local val, - std::map* out) { - if (!val->IsObject()) - return false; - - v8::Local dict = val->ToObject(); - v8::Local keys = dict->GetOwnPropertyNames(); - for (uint32_t i = 0; i < keys->Length(); ++i) { - v8::Local key = keys->Get(i); - (*out)[V8ToString(key)] = V8ToString(dict->Get(key)); - } - return true; - } -}; - -} // namespace mate - -#endif // ATOM_COMMON_NATIVE_MATE_CONVERTERS_STRING_MAP_CONVERTER_H_ diff --git a/filenames.gypi b/filenames.gypi index ed25a4038a3..2b87e36fa4d 100644 --- a/filenames.gypi +++ b/filenames.gypi @@ -377,7 +377,6 @@ 'atom/common/native_mate_converters/net_converter.cc', 'atom/common/native_mate_converters/net_converter.h', 'atom/common/native_mate_converters/string16_converter.h', - 'atom/common/native_mate_converters/string_map_converter.h', 'atom/common/native_mate_converters/ui_base_types_converter.h', 'atom/common/native_mate_converters/v8_value_converter.cc', 'atom/common/native_mate_converters/v8_value_converter.h', diff --git a/vendor/native_mate b/vendor/native_mate index 4ad6ecd1961..e75f2aa087d 160000 --- a/vendor/native_mate +++ b/vendor/native_mate @@ -1 +1 @@ -Subproject commit 4ad6ecd19617ac33c09e93ccb6d8e652ac1ac126 +Subproject commit e75f2aa087db346efc4b530f9e1ce7d3a72a3434