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

Side by Side Diff: Source/bindings/core/v8/DOMDataStore.h

Issue 707213002: bindings: Explicitly passes a v8::Isolate to DOMDataStore. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed a review comment. Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/core/v8/DOMWrapperWorld.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 28 matching lines...) Expand all
39 #include "wtf/StdLibExtras.h" 39 #include "wtf/StdLibExtras.h"
40 #include <v8.h> 40 #include <v8.h>
41 41
42 namespace blink { 42 namespace blink {
43 43
44 class Node; 44 class Node;
45 45
46 class DOMDataStore { 46 class DOMDataStore {
47 WTF_MAKE_NONCOPYABLE(DOMDataStore); 47 WTF_MAKE_NONCOPYABLE(DOMDataStore);
48 public: 48 public:
49 explicit DOMDataStore(bool isMainWorld) 49 DOMDataStore(v8::Isolate* isolate, bool isMainWorld)
50 : m_isMainWorld(isMainWorld) 50 : m_isMainWorld(isMainWorld)
51 , m_wrapperMap(v8::Isolate::GetCurrent()) { } 51 , m_wrapperMap(isolate) { }
52 ~DOMDataStore() 52 ~DOMDataStore()
53 { 53 {
54 // We never actually destruct the main world's DOMDataStore. 54 // We never actually destruct the main world's DOMDataStore.
55 ASSERT(!m_isMainWorld); 55 ASSERT(!m_isMainWorld);
56 m_wrapperMap.clear(); 56 m_wrapperMap.clear();
57 } 57 }
58 58
59 static DOMDataStore& current(v8::Isolate* isolate) 59 static DOMDataStore& current(v8::Isolate* isolate)
60 { 60 {
61 return DOMWrapperWorld::current(isolate).domDataStore(); 61 return DOMWrapperWorld::current(isolate).domDataStore();
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 v8::UniquePersistent<v8::Object> value, 276 v8::UniquePersistent<v8::Object> value,
277 ScriptWrappableBase* key) 277 ScriptWrappableBase* key)
278 { 278 {
279 RELEASE_ASSERT(!value.IsEmpty()); // See crbug.com/368095. 279 RELEASE_ASSERT(!value.IsEmpty()); // See crbug.com/368095.
280 releaseObject(v8::Local<v8::Object>::New(isolate, value)); 280 releaseObject(v8::Local<v8::Object>::New(isolate, value));
281 } 281 }
282 282
283 } // namespace blink 283 } // namespace blink
284 284
285 #endif // DOMDataStore_h 285 #endif // DOMDataStore_h
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/DOMWrapperWorld.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698