| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 if (output.length() >= maxChars - frameSeparatorLength) | 278 if (output.length() >= maxChars - frameSeparatorLength) |
| 279 return; | 279 return; |
| 280 | 280 |
| 281 output.append(frameSeparator, frameSeparatorLength); | 281 output.append(frameSeparator, frameSeparatorLength); |
| 282 frameContentAsPlainText(maxChars, curLocalChild, output); | 282 frameContentAsPlainText(maxChars, curLocalChild, output); |
| 283 if (output.length() >= maxChars) | 283 if (output.length() >= maxChars) |
| 284 return; // Filled up the buffer. | 284 return; // Filled up the buffer. |
| 285 } | 285 } |
| 286 } | 286 } |
| 287 | 287 |
| 288 static Vector<ScriptSourceCode> createSourcesVector(const WebScriptSource* sourc
esIn, unsigned numSources) | 288 static WillBeHeapVector<ScriptSourceCode> createSourcesVector(const WebScriptSou
rce* sourcesIn, unsigned numSources) |
| 289 { | 289 { |
| 290 Vector<ScriptSourceCode> sources; | 290 WillBeHeapVector<ScriptSourceCode> sources; |
| 291 sources.append(sourcesIn, numSources); | 291 sources.append(sourcesIn, numSources); |
| 292 return sources; | 292 return sources; |
| 293 } | 293 } |
| 294 | 294 |
| 295 WebPluginContainerImpl* WebLocalFrameImpl::pluginContainerFromFrame(LocalFrame*
frame) | 295 WebPluginContainerImpl* WebLocalFrameImpl::pluginContainerFromFrame(LocalFrame*
frame) |
| 296 { | 296 { |
| 297 if (!frame) | 297 if (!frame) |
| 298 return 0; | 298 return 0; |
| 299 if (!frame->document() || !frame->document()->isPluginDocument()) | 299 if (!frame->document() || !frame->document()->isPluginDocument()) |
| 300 return 0; | 300 return 0; |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 v8::HandleScope handleScope(toIsolate(frame())); | 732 v8::HandleScope handleScope(toIsolate(frame())); |
| 733 frame()->script().executeScriptInMainWorld(ScriptSourceCode(source.code, sou
rce.url, position)); | 733 frame()->script().executeScriptInMainWorld(ScriptSourceCode(source.code, sou
rce.url, position)); |
| 734 } | 734 } |
| 735 | 735 |
| 736 void WebLocalFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScrip
tSource* sourcesIn, unsigned numSources, int extensionGroup) | 736 void WebLocalFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScrip
tSource* sourcesIn, unsigned numSources, int extensionGroup) |
| 737 { | 737 { |
| 738 ASSERT(frame()); | 738 ASSERT(frame()); |
| 739 RELEASE_ASSERT(worldID > 0); | 739 RELEASE_ASSERT(worldID > 0); |
| 740 RELEASE_ASSERT(worldID < EmbedderWorldIdLimit); | 740 RELEASE_ASSERT(worldID < EmbedderWorldIdLimit); |
| 741 | 741 |
| 742 Vector<ScriptSourceCode> sources = createSourcesVector(sourcesIn, numSources
); | 742 WillBeHeapVector<ScriptSourceCode> sources = createSourcesVector(sourcesIn,
numSources); |
| 743 v8::HandleScope handleScope(toIsolate(frame())); | 743 v8::HandleScope handleScope(toIsolate(frame())); |
| 744 frame()->script().executeScriptInIsolatedWorld(worldID, sources, extensionGr
oup, 0); | 744 frame()->script().executeScriptInIsolatedWorld(worldID, sources, extensionGr
oup, 0); |
| 745 } | 745 } |
| 746 | 746 |
| 747 void WebLocalFrameImpl::setIsolatedWorldSecurityOrigin(int worldID, const WebSec
urityOrigin& securityOrigin) | 747 void WebLocalFrameImpl::setIsolatedWorldSecurityOrigin(int worldID, const WebSec
urityOrigin& securityOrigin) |
| 748 { | 748 { |
| 749 ASSERT(frame()); | 749 ASSERT(frame()); |
| 750 DOMWrapperWorld::setIsolatedWorldSecurityOrigin(worldID, securityOrigin.get(
)); | 750 DOMWrapperWorld::setIsolatedWorldSecurityOrigin(worldID, securityOrigin.get(
)); |
| 751 } | 751 } |
| 752 | 752 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 | 822 |
| 823 SuspendableScriptExecutor::createAndRun(frame(), 0, createSourcesVector(&sou
rce, 1), 0, userGesture, callback); | 823 SuspendableScriptExecutor::createAndRun(frame(), 0, createSourcesVector(&sou
rce, 1), 0, userGesture, callback); |
| 824 } | 824 } |
| 825 | 825 |
| 826 void WebLocalFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScrip
tSource* sourcesIn, unsigned numSources, int extensionGroup, WebVector<v8::Local
<v8::Value>>* results) | 826 void WebLocalFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScrip
tSource* sourcesIn, unsigned numSources, int extensionGroup, WebVector<v8::Local
<v8::Value>>* results) |
| 827 { | 827 { |
| 828 ASSERT(frame()); | 828 ASSERT(frame()); |
| 829 RELEASE_ASSERT(worldID > 0); | 829 RELEASE_ASSERT(worldID > 0); |
| 830 RELEASE_ASSERT(worldID < EmbedderWorldIdLimit); | 830 RELEASE_ASSERT(worldID < EmbedderWorldIdLimit); |
| 831 | 831 |
| 832 Vector<ScriptSourceCode> sources = createSourcesVector(sourcesIn, numSources
); | 832 WillBeHeapVector<ScriptSourceCode> sources = createSourcesVector(sourcesIn,
numSources); |
| 833 | 833 |
| 834 if (results) { | 834 if (results) { |
| 835 Vector<v8::Local<v8::Value>> scriptResults; | 835 Vector<v8::Local<v8::Value>> scriptResults; |
| 836 frame()->script().executeScriptInIsolatedWorld(worldID, sources, extensi
onGroup, &scriptResults); | 836 frame()->script().executeScriptInIsolatedWorld(worldID, sources, extensi
onGroup, &scriptResults); |
| 837 WebVector<v8::Local<v8::Value>> v8Results(scriptResults.size()); | 837 WebVector<v8::Local<v8::Value>> v8Results(scriptResults.size()); |
| 838 for (unsigned i = 0; i < scriptResults.size(); i++) | 838 for (unsigned i = 0; i < scriptResults.size(); i++) |
| 839 v8Results[i] = v8::Local<v8::Value>::New(toIsolate(frame()), scriptR
esults[i]); | 839 v8Results[i] = v8::Local<v8::Value>::New(toIsolate(frame()), scriptR
esults[i]); |
| 840 results->swap(v8Results); | 840 results->swap(v8Results); |
| 841 } else { | 841 } else { |
| 842 v8::HandleScope handleScope(toIsolate(frame())); | 842 v8::HandleScope handleScope(toIsolate(frame())); |
| (...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2013 { | 2013 { |
| 2014 m_frameWidget = frameWidget; | 2014 m_frameWidget = frameWidget; |
| 2015 } | 2015 } |
| 2016 | 2016 |
| 2017 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const | 2017 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const |
| 2018 { | 2018 { |
| 2019 return m_frameWidget; | 2019 return m_frameWidget; |
| 2020 } | 2020 } |
| 2021 | 2021 |
| 2022 } // namespace blink | 2022 } // namespace blink |
| OLD | NEW |