<commit_before>// Copyright (c) 2013 GitHub, Inc. All rights reserved.
// Copyright (c) 2012 Intel Corp. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ATOM_BROWSER_API_ATOM_API_ID_WEAK_MAP_H_
#define ATOM_BROWSER_API_ATOM_API_ID_WEAK_MAP_H_

#include <map>

#include "base/basictypes.h"
#include "vendor/node/src/node_object_wrap.h"

namespace atom {

namespace api {

class IDWeakMap : public node::ObjectWrap {
 public:
  static void Initialize(v8::Handle<v8::Object> target);

 private:
  IDWeakMap();
  virtual ~IDWeakMap();

  bool Has(int key) const;
  void Erase(v8::Isolate* isolate, int key);
  int GetNextID();

  static void WeakCallback(v8::Isolate* isolate,
                           v8::Persistent<v8::Value> value,
                           void *data);

  static v8::Handle<v8::Value> New(const v8::Arguments& args);
  static v8::Handle<v8::Value> Add(const v8::Arguments& args);
  static v8::Handle<v8::Value> Get(const v8::Arguments& args);
  static v8::Handle<v8::Value> Has(const v8::Arguments& args);
  static v8::Handle<v8::Value> Keys(const v8::Arguments& args);
  static v8::Handle<v8::Value> Remove(const v8::Arguments& args);

  int next_id_;

  std::map<int, v8::Persistent<v8::Value>> map_;

  DISALLOW_COPY_AND_ASSIGN(IDWeakMap);
};

}  // namespace api

}  // namespace atom

#endif  // ATOM_BROWSER_API_ATOM_API_ID_WEAK_MAP_H_<commit_msg>Fix header guard.<commit_after>// Copyright (c) 2013 GitHub, Inc. All rights reserved.
// Copyright (c) 2012 Intel Corp. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ATOM_COMMON_API_ATOM_API_ID_WEAK_MAP_H_
#define ATOM_COMMON_API_ATOM_API_ID_WEAK_MAP_H_

#include <map>

#include "base/basictypes.h"
#include "vendor/node/src/node_object_wrap.h"

namespace atom {

namespace api {

class IDWeakMap : public node::ObjectWrap {
 public:
  static void Initialize(v8::Handle<v8::Object> target);

 private:
  IDWeakMap();
  virtual ~IDWeakMap();

  bool Has(int key) const;
  void Erase(v8::Isolate* isolate, int key);
  int GetNextID();

  static void WeakCallback(v8::Isolate* isolate,
                           v8::Persistent<v8::Value> value,
                           void *data);

  static v8::Handle<v8::Value> New(const v8::Arguments& args);
  static v8::Handle<v8::Value> Add(const v8::Arguments& args);
  static v8::Handle<v8::Value> Get(const v8::Arguments& args);
  static v8::Handle<v8::Value> Has(const v8::Arguments& args);
  static v8::Handle<v8::Value> Keys(const v8::Arguments& args);
  static v8::Handle<v8::Value> Remove(const v8::Arguments& args);

  int next_id_;

  std::map<int, v8::Persistent<v8::Value>> map_;

  DISALLOW_COPY_AND_ASSIGN(IDWeakMap);
};

}  // namespace api

}  // namespace atom

#endif  // ATOM_COMMON_API_ATOM_API_ID_WEAK_MAP_H_
{'fraction_non_alphanumeric': 0.13052415210688592, 'fraction_numerical': 0.023295649194929772, 'mean_word_length': 4.387453874538745, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1058834', 'n_tokens_mistral': 1083, 'n_tokens_neox': 1025, 'n_words': 249}