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

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

Issue 23788005: Remove calls to HandleScope default ctor. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: code review (pfeldman) Created 7 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 static void setDebugData(v8::Handle<v8::Context> context, v8::Handle<v8::Value> value) 188 static void setDebugData(v8::Handle<v8::Context> context, v8::Handle<v8::Value> value)
189 { 189 {
190 v8::Context::Scope contextScope(context); 190 v8::Context::Scope contextScope(context);
191 context->SetEmbedderData(v8ContextDebugIdIndex, value); 191 context->SetEmbedderData(v8ContextDebugIdIndex, value);
192 } 192 }
193 193
194 bool V8PerContextDebugData::setContextDebugData(v8::Handle<v8::Context> context, const char* worldName, int debugId) 194 bool V8PerContextDebugData::setContextDebugData(v8::Handle<v8::Context> context, const char* worldName, int debugId)
195 { 195 {
196 if (!debugData(context)->IsUndefined()) 196 if (!debugData(context)->IsUndefined())
197 return false; 197 return false;
198 v8::HandleScope scope; 198 v8::HandleScope scope(context->GetIsolate());
199 v8::Handle<v8::Value> debugData = createDebugData(worldName, debugId); 199 v8::Handle<v8::Value> debugData = createDebugData(worldName, debugId);
200 setDebugData(context, debugData); 200 setDebugData(context, debugData);
201 return true; 201 return true;
202 } 202 }
203 203
204 int V8PerContextDebugData::contextDebugId(v8::Handle<v8::Context> context) 204 int V8PerContextDebugData::contextDebugId(v8::Handle<v8::Context> context)
205 { 205 {
206 v8::HandleScope scope; 206 v8::HandleScope scope(context->GetIsolate());
207 v8::Handle<v8::Value> data = debugData(context); 207 v8::Handle<v8::Value> data = debugData(context);
208 208
209 if (!data->IsString()) 209 if (!data->IsString())
210 return -1; 210 return -1;
211 v8::String::AsciiValue ascii(data); 211 v8::String::AsciiValue ascii(data);
212 char* comma = strnstr(*ascii, ",", ascii.length()); 212 char* comma = strnstr(*ascii, ",", ascii.length());
213 if (!comma) 213 if (!comma)
214 return -1; 214 return -1;
215 return atoi(comma + 1); 215 return atoi(comma + 1);
216 } 216 }
217 217
218 } // namespace WebCore 218 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8LazyEventListener.cpp ('k') | Source/bindings/v8/V8WorkerGlobalScopeEventListener.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698