| Index: third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
|
| index c6cb29661fc2cab3797a97d98c6bc06d8cc97012..6c80ae514c38ad42eadb21303bb576a85ed71a9b 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
|
| @@ -246,35 +246,43 @@ bool WindowProxy::initialize()
|
| }
|
| }
|
|
|
| - if (!setupWindowPrototypeChain()) {
|
| - disposeContext(DoNotDetachGlobal);
|
| - return false;
|
| + {
|
| + TRACE_EVENT0("v8", "WindowProxy::initialize (prototype chain)");
|
| + if (!setupWindowPrototypeChain()) {
|
| + disposeContext(DoNotDetachGlobal);
|
| + return false;
|
| + }
|
| }
|
|
|
| - SecurityOrigin* origin = 0;
|
| - if (m_world->isMainWorld()) {
|
| - // ActivityLogger for main world is updated within updateDocument().
|
| - updateDocument();
|
| - origin = m_frame->securityContext()->getSecurityOrigin();
|
| - // FIXME: Can this be removed when CSP moves to browser?
|
| - ContentSecurityPolicy* csp = m_frame->securityContext()->contentSecurityPolicy();
|
| - context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSecurityPolicy::SuppressReport));
|
| - context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isolate, csp->evalDisabledErrorMessage()));
|
| - } else {
|
| - updateActivityLogger();
|
| - origin = m_world->isolatedWorldSecurityOrigin();
|
| - setSecurityToken(origin);
|
| - }
|
| - if (m_frame->isLocalFrame()) {
|
| - LocalFrame* frame = toLocalFrame(m_frame);
|
| - MainThreadDebugger::instance()->contextCreated(m_scriptState.get(), frame, origin);
|
| - frame->loader().client()->didCreateScriptContext(context, m_world->extensionGroup(), m_world->worldId());
|
| + {
|
| + TRACE_EVENT0("v8", "WindowProxy::initialize (misc init)");
|
| + SecurityOrigin* origin = 0;
|
| + if (m_world->isMainWorld()) {
|
| + // ActivityLogger for main world is updated within updateDocument().
|
| + updateDocument();
|
| + origin = m_frame->securityContext()->getSecurityOrigin();
|
| + // FIXME: Can this be removed when CSP moves to browser?
|
| + ContentSecurityPolicy* csp = m_frame->securityContext()->contentSecurityPolicy();
|
| + context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSecurityPolicy::SuppressReport));
|
| + context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isolate, csp->evalDisabledErrorMessage()));
|
| + } else {
|
| + updateActivityLogger();
|
| + origin = m_world->isolatedWorldSecurityOrigin();
|
| + setSecurityToken(origin);
|
| + }
|
| + if (m_frame->isLocalFrame()) {
|
| + LocalFrame* frame = toLocalFrame(m_frame);
|
| + MainThreadDebugger::instance()->contextCreated(m_scriptState.get(), frame, origin);
|
| + TRACE_EVENT0("v8", "WindowProxy::initialize (did create script context)");
|
| + frame->loader().client()->didCreateScriptContext(context, m_world->extensionGroup(), m_world->worldId());
|
| + }
|
| }
|
| // If Origin Trials have been registered before the V8 context was ready,
|
| // then inject them into the context now
|
| if (m_world->isMainWorld()) {
|
| ExecutionContext* executionContext = m_scriptState->getExecutionContext();
|
| if (executionContext) {
|
| + TRACE_EVENT0("v8", "WindowProxy::initialize (origin trial init)");
|
| OriginTrialContext* originTrialContext = OriginTrialContext::from(executionContext);
|
| if (originTrialContext)
|
| originTrialContext->initializePendingFeatures();
|
| @@ -321,6 +329,7 @@ void WindowProxy::createContext()
|
|
|
| v8::Local<v8::Context> context;
|
| {
|
| + TRACE_EVENT0("v8", "WindowProxy::createContext");
|
| V8PerIsolateData::UseCounterDisabledScope useCounterDisabled(V8PerIsolateData::from(m_isolate));
|
| context = v8::Context::New(m_isolate, &extensionConfiguration, globalTemplate, m_global.newLocal(m_isolate));
|
| }
|
| @@ -391,6 +400,7 @@ void WindowProxy::updateDocumentWrapper(v8::Local<v8::Object> wrapper)
|
|
|
| void WindowProxy::updateDocumentProperty()
|
| {
|
| + TRACE_EVENT0("v8", "WindowProxy::updateDocumentProperty");
|
| if (!m_world->isMainWorld())
|
| return;
|
|
|
| @@ -417,6 +427,7 @@ void WindowProxy::updateDocumentProperty()
|
|
|
| void WindowProxy::updateActivityLogger()
|
| {
|
| + TRACE_EVENT0("v8", "WindowProxy::updateActivityLogger");
|
| m_scriptState->perContextData()->setActivityLogger(V8DOMActivityLogger::activityLogger(
|
| m_world->worldId(), m_frame->isLocalFrame() && toLocalFrame(m_frame)->document() ? toLocalFrame(m_frame)->document()->baseURI() : KURL()));
|
| }
|
| @@ -474,6 +485,7 @@ void WindowProxy::setSecurityToken(SecurityOrigin* origin)
|
|
|
| void WindowProxy::updateDocument()
|
| {
|
| + TRACE_EVENT0("v8", "WindowProxy::updateDocument");
|
| ASSERT(m_world->isMainWorld());
|
| if (!isGlobalInitialized())
|
| return;
|
| @@ -556,6 +568,7 @@ void WindowProxy::namedItemRemoved(HTMLDocument* document, const AtomicString& n
|
|
|
| void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin)
|
| {
|
| + TRACE_EVENT0("v8", "WindowProxy::updateSecurityOrigin");
|
| if (!isContextInitialized())
|
| return;
|
| setSecurityToken(origin);
|
|
|