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

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: Moved constructor&destructor to api.cc 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') | no next file with comments »
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 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after
1529 * Tries to parse the string |json_string| and returns it as value if 1529 * Tries to parse the string |json_string| and returns it as value if
1530 * successful. 1530 * successful.
1531 * 1531 *
1532 * \param json_string The string to parse. 1532 * \param json_string The string to parse.
1533 * \return The corresponding value if successfully parsed. 1533 * \return The corresponding value if successfully parsed.
1534 */ 1534 */
1535 static Local<Value> Parse(Local<String> json_string); 1535 static Local<Value> Parse(Local<String> json_string);
1536 }; 1536 };
1537 1537
1538 1538
1539 /**
1540 * A map whose keys are referenced weakly. It is similar to JavaScript WeakMap
1541 * but can be created without entering a v8::Context and hence shouldn't
1542 * escape to JavaScript.
1543 */
1544 class V8_EXPORT WeakKeyMap {
1545 public:
1546 static WeakKeyMap* New(Isolate* isolate);
1547 ~WeakKeyMap();
1548 void Set(Handle<Value> key, Handle<Value> value);
1549 Local<Value> Get(Handle<Value> key);
1550 bool Has(Handle<Value> key);
1551 bool Delete(Handle<Value> key);
1552
1553 private:
1554 WeakKeyMap(Isolate* isolate, Handle<Object> weak_map);
1555
1556 Isolate* isolate_;
1557 UniquePersistent<Object> map_;
1558
1559 // Disallow copying and assigning.
1560 WeakKeyMap(WeakKeyMap&);
1561 void operator=(WeakKeyMap&);
1562 };
1563
1564
1539 // --- Value --- 1565 // --- Value ---
1540 1566
1541 1567
1542 /** 1568 /**
1543 * The superclass of all JavaScript values and objects. 1569 * The superclass of all JavaScript values and objects.
1544 */ 1570 */
1545 class V8_EXPORT Value : public Data { 1571 class V8_EXPORT Value : public Data {
1546 public: 1572 public:
1547 /** 1573 /**
1548 * Returns true if this value is the undefined value. See ECMA-262 1574 * Returns true if this value is the undefined value. See ECMA-262
(...skipping 5938 matching lines...) Expand 10 before | Expand all | Expand 10 after
7487 */ 7513 */
7488 7514
7489 7515
7490 } // namespace v8 7516 } // namespace v8
7491 7517
7492 7518
7493 #undef TYPE_CHECK 7519 #undef TYPE_CHECK
7494 7520
7495 7521
7496 #endif // V8_H_ 7522 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698