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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include "core/frame/LocalFrame.h" | 46 #include "core/frame/LocalFrame.h" |
47 #include "core/frame/csp/ContentSecurityPolicy.h" | 47 #include "core/frame/csp/ContentSecurityPolicy.h" |
48 #include "core/html/DocumentNameCollection.h" | 48 #include "core/html/DocumentNameCollection.h" |
49 #include "core/html/HTMLCollection.h" | 49 #include "core/html/HTMLCollection.h" |
50 #include "core/html/HTMLIFrameElement.h" | 50 #include "core/html/HTMLIFrameElement.h" |
51 #include "core/inspector/InspectorInstrumentation.h" | 51 #include "core/inspector/InspectorInstrumentation.h" |
52 #include "core/inspector/MainThreadDebugger.h" | 52 #include "core/inspector/MainThreadDebugger.h" |
53 #include "core/loader/DocumentLoader.h" | 53 #include "core/loader/DocumentLoader.h" |
54 #include "core/loader/FrameLoader.h" | 54 #include "core/loader/FrameLoader.h" |
55 #include "core/loader/FrameLoaderClient.h" | 55 #include "core/loader/FrameLoaderClient.h" |
| 56 #include "platform/Histogram.h" |
56 #include "platform/RuntimeEnabledFeatures.h" | 57 #include "platform/RuntimeEnabledFeatures.h" |
57 #include "platform/ScriptForbiddenScope.h" | 58 #include "platform/ScriptForbiddenScope.h" |
58 #include "platform/TraceEvent.h" | 59 #include "platform/TraceEvent.h" |
59 #include "platform/heap/Handle.h" | 60 #include "platform/heap/Handle.h" |
60 #include "platform/weborigin/SecurityOrigin.h" | 61 #include "platform/weborigin/SecurityOrigin.h" |
61 #include "public/platform/Platform.h" | 62 #include "public/platform/Platform.h" |
62 #include "wtf/Assertions.h" | 63 #include "wtf/Assertions.h" |
63 #include "wtf/OwnPtr.h" | 64 #include "wtf/OwnPtr.h" |
64 #include "wtf/StringExtras.h" | 65 #include "wtf/StringExtras.h" |
65 #include "wtf/text/CString.h" | 66 #include "wtf/text/CString.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 } | 328 } |
328 } | 329 } |
329 v8::ExtensionConfiguration extensionConfiguration(extensionNames.size(), ext
ensionNames.data()); | 330 v8::ExtensionConfiguration extensionConfiguration(extensionNames.size(), ext
ensionNames.data()); |
330 | 331 |
331 v8::Local<v8::Context> context = v8::Context::New(m_isolate, &extensionConfi
guration, globalTemplate, m_global.newLocal(m_isolate)); | 332 v8::Local<v8::Context> context = v8::Context::New(m_isolate, &extensionConfi
guration, globalTemplate, m_global.newLocal(m_isolate)); |
332 if (context.IsEmpty()) | 333 if (context.IsEmpty()) |
333 return; | 334 return; |
334 m_scriptState = ScriptState::create(context, m_world); | 335 m_scriptState = ScriptState::create(context, m_world); |
335 | 336 |
336 double contextCreationDurationInMilliseconds = (currentTime() - contextCreat
ionStartInSeconds) * 1000; | 337 double contextCreationDurationInMilliseconds = (currentTime() - contextCreat
ionStartInSeconds) * 1000; |
337 const char* histogramName = "WebCore.WindowProxy.createContext.MainWorld"; | 338 if (!m_world->isMainWorld()) { |
338 if (!m_world->isMainWorld()) | 339 DEFINE_STATIC_LOCAL(CustomCountHistogram, isolatedWorldHistogram, ("WebC
ore.WindowProxy.createContext.IsolatedWorld", 0, 10000, 50)); |
339 histogramName = "WebCore.WindowProxy.createContext.IsolatedWorld"; | 340 isolatedWorldHistogram.count(contextCreationDurationInMilliseconds); |
340 Platform::current()->histogramCustomCounts(histogramName, contextCreationDur
ationInMilliseconds, 0, 10000, 50); | 341 } else { |
| 342 DEFINE_STATIC_LOCAL(CustomCountHistogram, mainWorldHistogram, ("WebCore.
WindowProxy.createContext.MainWorld", 0, 10000, 50)); |
| 343 mainWorldHistogram.count(contextCreationDurationInMilliseconds); |
| 344 } |
341 } | 345 } |
342 | 346 |
343 static v8::Local<v8::Object> toInnerGlobalObject(v8::Local<v8::Context> context) | 347 static v8::Local<v8::Object> toInnerGlobalObject(v8::Local<v8::Context> context) |
344 { | 348 { |
345 return v8::Local<v8::Object>::Cast(context->Global()->GetPrototype()); | 349 return v8::Local<v8::Object>::Cast(context->Global()->GetPrototype()); |
346 } | 350 } |
347 | 351 |
348 bool WindowProxy::installDOMWindow() | 352 bool WindowProxy::installDOMWindow() |
349 { | 353 { |
350 DOMWindow* window = m_frame->domWindow(); | 354 DOMWindow* window = m_frame->domWindow(); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 } | 571 } |
568 | 572 |
569 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) | 573 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) |
570 { | 574 { |
571 if (!isContextInitialized()) | 575 if (!isContextInitialized()) |
572 return; | 576 return; |
573 setSecurityToken(origin); | 577 setSecurityToken(origin); |
574 } | 578 } |
575 | 579 |
576 } // namespace blink | 580 } // namespace blink |
OLD | NEW |