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

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

Issue 138643003: Simpler return value of HashTable::add/HashMap:add and others (Closed)
Patch Set: Daily master update (now with base url?) 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
« no previous file with comments | « Source/bindings/v8/DOMWrapperMap.h ('k') | Source/bindings/v8/NPV8Object.cpp » ('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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 isolatedWorldCount--; 120 isolatedWorldCount--;
121 ASSERT(map.size() == isolatedWorldCount); 121 ASSERT(map.size() == isolatedWorldCount);
122 } 122 }
123 123
124 PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::ensureIsolatedWorld(int worldId, in t extensionGroup) 124 PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::ensureIsolatedWorld(int worldId, in t extensionGroup)
125 { 125 {
126 ASSERT(isIsolatedWorldId(worldId)); 126 ASSERT(isIsolatedWorldId(worldId));
127 127
128 WorldMap& map = isolatedWorldMap(); 128 WorldMap& map = isolatedWorldMap();
129 WorldMap::AddResult result = map.add(worldId, 0); 129 WorldMap::AddResult result = map.add(worldId, 0);
130 RefPtr<DOMWrapperWorld> world = result.iterator->value; 130 RefPtr<DOMWrapperWorld> world = result.storedValue->value;
131 if (world) { 131 if (world) {
132 ASSERT(world->worldId() == worldId); 132 ASSERT(world->worldId() == worldId);
133 ASSERT(world->extensionGroup() == extensionGroup); 133 ASSERT(world->extensionGroup() == extensionGroup);
134 return world.release(); 134 return world.release();
135 } 135 }
136 136
137 world = DOMWrapperWorld::create(worldId, extensionGroup); 137 world = DOMWrapperWorld::create(worldId, extensionGroup);
138 result.iterator->value = world.get(); 138 result.storedValue->value = world.get();
139 isolatedWorldCount++; 139 isolatedWorldCount++;
140 ASSERT(map.size() == isolatedWorldCount); 140 ASSERT(map.size() == isolatedWorldCount);
141 141
142 return world.release(); 142 return world.release();
143 } 143 }
144 144
145 v8::Handle<v8::Context> DOMWrapperWorld::context(ScriptController& controller) 145 v8::Handle<v8::Context> DOMWrapperWorld::context(ScriptController& controller)
146 { 146 {
147 return controller.windowShell(this)->context(); 147 return controller.windowShell(this)->context();
148 } 148 }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 DOMActivityLoggerMap::iterator it = loggers.find(worldId); 228 DOMActivityLoggerMap::iterator it = loggers.find(worldId);
229 return it == loggers.end() ? 0 : it->value.get(); 229 return it == loggers.end() ? 0 : it->value.get();
230 } 230 }
231 231
232 bool DOMWrapperWorld::contextHasCorrectPrototype(v8::Handle<v8::Context> context ) 232 bool DOMWrapperWorld::contextHasCorrectPrototype(v8::Handle<v8::Context> context )
233 { 233 {
234 return V8WindowShell::contextHasCorrectPrototype(context); 234 return V8WindowShell::contextHasCorrectPrototype(context);
235 } 235 }
236 236
237 } // namespace WebCore 237 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/DOMWrapperMap.h ('k') | Source/bindings/v8/NPV8Object.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698