OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2011 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 if (!m_frame->loader().client()->allowScriptExtension(extensions[i]->nam
e(), extensionGroup, worldId)) | 279 if (!m_frame->loader().client()->allowScriptExtension(extensions[i]->nam
e(), extensionGroup, worldId)) |
280 continue; | 280 continue; |
281 | 281 |
282 extensionNames[index++] = extensions[i]->name(); | 282 extensionNames[index++] = extensions[i]->name(); |
283 } | 283 } |
284 v8::ExtensionConfiguration extensionConfiguration(index, extensionNames.get(
)); | 284 v8::ExtensionConfiguration extensionConfiguration(index, extensionNames.get(
)); |
285 | 285 |
286 v8::Handle<v8::Context> context = v8::Context::New(m_isolate, &extensionConf
iguration, globalTemplate, m_global.newLocal(m_isolate)); | 286 v8::Handle<v8::Context> context = v8::Context::New(m_isolate, &extensionConf
iguration, globalTemplate, m_global.newLocal(m_isolate)); |
287 if (context.IsEmpty()) | 287 if (context.IsEmpty()) |
288 return; | 288 return; |
289 m_perContextData = V8PerContextData::create(context, m_world.get()); | 289 m_perContextData = V8PerContextData::create(context, m_world); |
290 | 290 |
291 double contextCreationDurationInMilliseconds = (currentTime() - contextCreat
ionStartInSeconds) * 1000; | 291 double contextCreationDurationInMilliseconds = (currentTime() - contextCreat
ionStartInSeconds) * 1000; |
292 const char* histogramName = "WebCore.V8WindowShell.createContext.MainWorld"; | 292 const char* histogramName = "WebCore.V8WindowShell.createContext.MainWorld"; |
293 if (!m_world->isMainWorld()) | 293 if (!m_world->isMainWorld()) |
294 histogramName = "WebCore.V8WindowShell.createContext.IsolatedWorld"; | 294 histogramName = "WebCore.V8WindowShell.createContext.IsolatedWorld"; |
295 blink::Platform::current()->histogramCustomCounts(histogramName, contextCrea
tionDurationInMilliseconds, 0, 10000, 50); | 295 blink::Platform::current()->histogramCustomCounts(histogramName, contextCrea
tionDurationInMilliseconds, 0, 10000, 50); |
296 } | 296 } |
297 | 297 |
298 static v8::Handle<v8::Object> toInnerGlobalObject(v8::Handle<v8::Context> contex
t) | 298 static v8::Handle<v8::Object> toInnerGlobalObject(v8::Handle<v8::Context> contex
t) |
299 { | 299 { |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 if (!isMainThread()) | 506 if (!isMainThread()) |
507 return true; | 507 return true; |
508 // We're initializing the context, so it is not yet in a status where we can | 508 // We're initializing the context, so it is not yet in a status where we can |
509 // validate the context. | 509 // validate the context. |
510 if (contextBeingInitialized) | 510 if (contextBeingInitialized) |
511 return true; | 511 return true; |
512 return !!toDOMWindow(context); | 512 return !!toDOMWindow(context); |
513 } | 513 } |
514 | 514 |
515 } // WebCore | 515 } // WebCore |
OLD | NEW |