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

Side by Side Diff: include/v8.h

Issue 886473005: Add WeakMap to v8.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project 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 /** \mainpage V8 API Reference Guide 5 /** \mainpage V8 API Reference Guide
6 * 6 *
7 * V8 is Google's open source JavaScript engine. 7 * V8 is Google's open source JavaScript engine.
8 * 8 *
9 * This set of documents provides reference material generated from the 9 * This set of documents provides reference material generated from the
10 * V8 header file, include/v8.h. 10 * V8 header file, include/v8.h.
(...skipping 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 * Tries to parse the string |json_string| and returns it as value if 1520 * Tries to parse the string |json_string| and returns it as value if
1521 * successful. 1521 * successful.
1522 * 1522 *
1523 * \param json_string The string to parse. 1523 * \param json_string The string to parse.
1524 * \return The corresponding value if successfully parsed. 1524 * \return The corresponding value if successfully parsed.
1525 */ 1525 */
1526 static Local<Value> Parse(Local<String> json_string); 1526 static Local<Value> Parse(Local<String> json_string);
1527 }; 1527 };
1528 1528
1529 1529
1530 /**
1531 * A map whose keys are referenced weakly. It is similar to JavaScript WeakMap
1532 * but
1533 * can be created without entering a v8::Context.
Michael Starzinger 2015/02/03 13:21:54 nit: Can we add "... and hence shouldn't escape to
yurys 2015/02/03 13:39:06 Absolutely. Done.
1534 */
1535 class V8_EXPORT WeakMap {
1536 public:
1537 static WeakMap* New(Isolate* isolate);
1538 void Set(Handle<Value> key, Handle<Value> value);
1539 Local<Value> Get(Handle<Value> key);
1540 bool Has(Handle<Value> key);
1541 bool Delete(Handle<Value> key);
1542
1543 private:
1544 WeakMap(Isolate* isolate, Handle<Object> weak_map)
1545 : isolate_(isolate), map_(isolate, weak_map) {}
1546 Isolate* isolate_;
1547 UniquePersistent<Object> map_;
1548
1549 WeakMap(WeakMap&);
Michael Starzinger 2015/02/03 13:21:54 nit: // Disallow copying and assigning.
yurys 2015/02/03 13:39:07 Done.
1550 void operator=(WeakMap&);
1551 };
1552
1553
1530 // --- Value --- 1554 // --- Value ---
1531 1555
1532 1556
1533 /** 1557 /**
1534 * The superclass of all JavaScript values and objects. 1558 * The superclass of all JavaScript values and objects.
1535 */ 1559 */
1536 class V8_EXPORT Value : public Data { 1560 class V8_EXPORT Value : public Data {
1537 public: 1561 public:
1538 /** 1562 /**
1539 * Returns true if this value is the undefined value. See ECMA-262 1563 * Returns true if this value is the undefined value. See ECMA-262
(...skipping 5932 matching lines...) Expand 10 before | Expand all | Expand 10 after
7472 */ 7496 */
7473 7497
7474 7498
7475 } // namespace v8 7499 } // namespace v8
7476 7500
7477 7501
7478 #undef TYPE_CHECK 7502 #undef TYPE_CHECK
7479 7503
7480 7504
7481 #endif // V8_H_ 7505 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698