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

Side by Side Diff: Source/bindings/v8/DOMWrapperWorld.cpp

Issue 163913005: Remove WrapperWorldType from DOMDataStore (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/DOMDataStore.cpp ('k') | no next file » | 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 unsigned DOMWrapperWorld::isolatedWorldCount = 0; 49 unsigned DOMWrapperWorld::isolatedWorldCount = 0;
50 50
51 PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::create(int worldId, int extensionGr oup) 51 PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::create(int worldId, int extensionGr oup)
52 { 52 {
53 return adoptRef(new DOMWrapperWorld(worldId, extensionGroup)); 53 return adoptRef(new DOMWrapperWorld(worldId, extensionGroup));
54 } 54 }
55 55
56 DOMWrapperWorld::DOMWrapperWorld(int worldId, int extensionGroup) 56 DOMWrapperWorld::DOMWrapperWorld(int worldId, int extensionGroup)
57 : m_worldId(worldId) 57 : m_worldId(worldId)
58 , m_extensionGroup(extensionGroup) 58 , m_extensionGroup(extensionGroup)
59 , m_domDataStore(adoptPtr(new DOMDataStore(isMainWorld())))
59 { 60 {
60 if (isMainWorld())
61 m_domDataStore = adoptPtr(new DOMDataStore(MainWorld));
62 else if (isIsolatedWorld())
63 m_domDataStore = adoptPtr(new DOMDataStore(IsolatedWorld));
64 else if (isWorkerWorld())
65 m_domDataStore = adoptPtr(new DOMDataStore(WorkerWorld));
66 } 61 }
67 62
68 DOMWrapperWorld* DOMWrapperWorld::current(v8::Isolate* isolate) 63 DOMWrapperWorld* DOMWrapperWorld::current(v8::Isolate* isolate)
69 { 64 {
70 v8::Handle<v8::Context> context = isolate->GetCurrentContext(); 65 v8::Handle<v8::Context> context = isolate->GetCurrentContext();
71 if (context.IsEmpty() || !toDOMWindow(context)) 66 if (context.IsEmpty() || !toDOMWindow(context))
72 return 0; 67 return 0;
73 return world(context); 68 return world(context);
74 } 69 }
75 70
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 DOMActivityLoggerMap::iterator it = loggers.find(worldId); 221 DOMActivityLoggerMap::iterator it = loggers.find(worldId);
227 return it == loggers.end() ? 0 : it->value.get(); 222 return it == loggers.end() ? 0 : it->value.get();
228 } 223 }
229 224
230 bool DOMWrapperWorld::contextHasCorrectPrototype(v8::Handle<v8::Context> context ) 225 bool DOMWrapperWorld::contextHasCorrectPrototype(v8::Handle<v8::Context> context )
231 { 226 {
232 return V8WindowShell::contextHasCorrectPrototype(context); 227 return V8WindowShell::contextHasCorrectPrototype(context);
233 } 228 }
234 229
235 } // namespace WebCore 230 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/DOMDataStore.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698