OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2009 Apple Inc. All rights reserved. |
4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. | 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions are | 7 * modification, are permitted provided that the following conditions are |
8 * met: | 8 * met: |
9 * | 9 * |
10 * * Redistributions of source code must retain the above copyright | 10 * * Redistributions of source code must retain the above copyright |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 void ScriptController::clearForClose() | 134 void ScriptController::clearForClose() |
135 { | 135 { |
136 double start = currentTime(); | 136 double start = currentTime(); |
137 m_windowProxyManager->clearForClose(); | 137 m_windowProxyManager->clearForClose(); |
138 Platform::current()->histogramCustomCounts("WebCore.ScriptController.clearFo rClose", (currentTime() - start) * 1000, 0, 10000, 50); | 138 Platform::current()->histogramCustomCounts("WebCore.ScriptController.clearFo rClose", (currentTime() - start) * 1000, 0, 10000, 50); |
139 } | 139 } |
140 | 140 |
141 void ScriptController::updateSecurityOrigin(SecurityOrigin* origin) | 141 void ScriptController::updateSecurityOrigin(SecurityOrigin* origin) |
142 { | 142 { |
143 m_windowProxyManager->mainWorldProxy()->updateSecurityOrigin(origin); | 143 m_windowProxyManager->mainWorldProxy()->updateSecurityOrigin(origin); |
144 Vector<std::pair<ScriptState*, SecurityOrigin*>> isolatedContexts; | |
145 m_windowProxyManager->collectIsolatedContexts(isolatedContexts); | |
146 for (auto isolatedContext : isolatedContexts) { | |
147 WindowProxy* proxy = m_windowProxyManager->existingWindowProxy(isolatedC ontext.first->world()); | |
haraken
2015/09/14 15:28:59
I think we should call windowProxy, not existingWi
epertoso
2015/09/14 15:59:37
But windowProxy() will create a proxy if there isn
haraken
2015/09/14 23:46:04
I can't come up with a scenario where the isolated
epertoso
2015/09/15 08:24:58
Done.
| |
148 if (proxy) | |
149 proxy->setSecurityToken(isolatedContext.second); | |
haraken
2015/09/14 15:28:59
How about calling updateSecurityOrigin, just like
epertoso
2015/09/14 15:59:37
updateSecurityOrigin has an ASSERT that implies it
haraken
2015/09/14 23:46:04
I think it does make sense to remove the assert no
epertoso
2015/09/15 08:24:58
Done.
| |
150 } | |
144 } | 151 } |
145 | 152 |
146 v8::MaybeLocal<v8::Value> ScriptController::callFunction(v8::Local<v8::Function> function, v8::Local<v8::Value> receiver, int argc, v8::Local<v8::Value> info[]) | 153 v8::MaybeLocal<v8::Value> ScriptController::callFunction(v8::Local<v8::Function> function, v8::Local<v8::Value> receiver, int argc, v8::Local<v8::Value> info[]) |
147 { | 154 { |
148 // Keep LocalFrame (and therefore ScriptController) alive. | 155 // Keep LocalFrame (and therefore ScriptController) alive. |
149 RefPtrWillBeRawPtr<LocalFrame> protect(frame()); | 156 RefPtrWillBeRawPtr<LocalFrame> protect(frame()); |
150 return ScriptController::callFunction(frame()->document(), function, receive r, argc, info, isolate()); | 157 return ScriptController::callFunction(frame()->document(), function, receive r, argc, info, isolate()); |
151 } | 158 } |
152 | 159 |
153 v8::MaybeLocal<v8::Value> ScriptController::callFunction(ExecutionContext* conte xt, v8::Local<v8::Function> function, v8::Local<v8::Value> receiver, int argc, v 8::Local<v8::Value> info[], v8::Isolate* isolate) | 160 v8::MaybeLocal<v8::Value> ScriptController::callFunction(ExecutionContext* conte xt, v8::Local<v8::Function> function, v8::Local<v8::Value> receiver, int argc, v 8::Local<v8::Value> info[], v8::Isolate* isolate) |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
593 for (size_t i = 0; i < resultArray->Length(); ++i) { | 600 for (size_t i = 0; i < resultArray->Length(); ++i) { |
594 v8::Local<v8::Value> value; | 601 v8::Local<v8::Value> value; |
595 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) | 602 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) |
596 return; | 603 return; |
597 results->append(value); | 604 results->append(value); |
598 } | 605 } |
599 } | 606 } |
600 } | 607 } |
601 | 608 |
602 } // namespace blink | 609 } // namespace blink |
OLD | NEW |