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

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

Issue 217053007: Revert of Make DOMWrapperWorld::current() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revert 213543004 too Created 6 years, 9 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/V8PerContextData.cpp ('k') | Source/bindings/v8/V8WindowShell.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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 void V8PerIsolateData::dispose(v8::Isolate* isolate) 89 void V8PerIsolateData::dispose(v8::Isolate* isolate)
90 { 90 {
91 void* data = isolate->GetData(gin::kEmbedderBlink); 91 void* data = isolate->GetData(gin::kEmbedderBlink);
92 delete static_cast<V8PerIsolateData*>(data); 92 delete static_cast<V8PerIsolateData*>(data);
93 isolate->SetData(gin::kEmbedderBlink, 0); 93 isolate->SetData(gin::kEmbedderBlink, 0);
94 } 94 }
95 95
96 V8PerIsolateData::DOMTemplateMap& V8PerIsolateData::currentDOMTemplateMap() 96 V8PerIsolateData::DOMTemplateMap& V8PerIsolateData::currentDOMTemplateMap()
97 { 97 {
98 if (DOMWrapperWorld::current(m_isolate).isMainWorld()) 98 if (DOMWrapperWorld::current(m_isolate)->isMainWorld())
99 return m_domTemplateMapForMainWorld; 99 return m_domTemplateMapForMainWorld;
100 return m_domTemplateMapForNonMainWorld; 100 return m_domTemplateMapForNonMainWorld;
101 } 101 }
102 102
103 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::domTemplate(void* domTemplate Key, v8::FunctionCallback callback, v8::Handle<v8::Value> data, v8::Handle<v8::S ignature> signature, int length) 103 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::domTemplate(void* domTemplate Key, v8::FunctionCallback callback, v8::Handle<v8::Value> data, v8::Handle<v8::S ignature> signature, int length)
104 { 104 {
105 DOMTemplateMap& domTemplateMap = currentDOMTemplateMap(); 105 DOMTemplateMap& domTemplateMap = currentDOMTemplateMap();
106 DOMTemplateMap::iterator result = domTemplateMap.find(domTemplateKey); 106 DOMTemplateMap::iterator result = domTemplateMap.find(domTemplateKey);
107 if (result != domTemplateMap.end()) 107 if (result != domTemplateMap.end())
108 return result->value.Get(m_isolate); 108 return result->value.Get(m_isolate);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 186 }
187 187
188 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate() 188 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate()
189 { 189 {
190 if (m_toStringTemplate.isEmpty()) 190 if (m_toStringTemplate.isEmpty())
191 m_toStringTemplate.set(m_isolate, v8::FunctionTemplate::New(m_isolate, c onstructorOfToString)); 191 m_toStringTemplate.set(m_isolate, v8::FunctionTemplate::New(m_isolate, c onstructorOfToString));
192 return m_toStringTemplate.newLocal(m_isolate); 192 return m_toStringTemplate.newLocal(m_isolate);
193 } 193 }
194 194
195 } // namespace WebCore 195 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8PerContextData.cpp ('k') | Source/bindings/v8/V8WindowShell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698