| 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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 } | 536 } |
| 537 | 537 |
| 538 WebRemoteFrame* WebLocalFrameImpl::toWebRemoteFrame() | 538 WebRemoteFrame* WebLocalFrameImpl::toWebRemoteFrame() |
| 539 { | 539 { |
| 540 ASSERT_NOT_REACHED(); | 540 ASSERT_NOT_REACHED(); |
| 541 return 0; | 541 return 0; |
| 542 } | 542 } |
| 543 | 543 |
| 544 void WebLocalFrameImpl::close() | 544 void WebLocalFrameImpl::close() |
| 545 { | 545 { |
| 546 m_client = 0; | 546 m_client = nullptr; |
| 547 | 547 |
| 548 #if ENABLE(OILPAN) | 548 #if ENABLE(OILPAN) |
| 549 m_selfKeepAlive.clear(); | 549 m_selfKeepAlive.clear(); |
| 550 #else | 550 #else |
| 551 deref(); // Balances ref() acquired in WebFrame::create | 551 deref(); // Balances ref() acquired in WebFrame::create |
| 552 #endif | 552 #endif |
| 553 } | 553 } |
| 554 | 554 |
| 555 WebString WebLocalFrameImpl::uniqueName() const | 555 WebString WebLocalFrameImpl::uniqueName() const |
| 556 { | 556 { |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 return frame()->script().executeScriptInMainWorldAndReturnValue(ScriptSource
Code(source.code, source.url, position)); | 816 return frame()->script().executeScriptInMainWorldAndReturnValue(ScriptSource
Code(source.code, source.url, position)); |
| 817 } | 817 } |
| 818 | 818 |
| 819 void WebLocalFrameImpl::requestExecuteScriptAndReturnValue(const WebScriptSource
& source, bool userGesture, WebScriptExecutionCallback* callback) | 819 void WebLocalFrameImpl::requestExecuteScriptAndReturnValue(const WebScriptSource
& source, bool userGesture, WebScriptExecutionCallback* callback) |
| 820 { | 820 { |
| 821 ASSERT(frame()); | 821 ASSERT(frame()); |
| 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 Vector<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())); |
| 843 frame()->script().executeScriptInIsolatedWorld(worldID, sources, extensi
onGroup, 0); | 843 frame()->script().executeScriptInIsolatedWorld(worldID, sources, extensi
onGroup, 0); |
| 844 } | 844 } |
| 845 } | 845 } |
| 846 | 846 |
| 847 void WebLocalFrameImpl::requestExecuteScriptInIsolatedWorld(int worldID, const W
ebScriptSource* sourcesIn, unsigned numSources, int extensionGroup, bool userGes
ture, WebScriptExecutionCallback* callback) | 847 void WebLocalFrameImpl::requestExecuteScriptInIsolatedWorld(int worldID, const W
ebScriptSource* sourcesIn, unsigned numSources, int extensionGroup, bool userGes
ture, WebScriptExecutionCallback* callback) |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1188 return frame()->selection().selectWordAroundPosition(selection.selection().v
isibleStart()); | 1188 return frame()->selection().selectWordAroundPosition(selection.selection().v
isibleStart()); |
| 1189 } | 1189 } |
| 1190 | 1190 |
| 1191 void WebLocalFrameImpl::selectRange(const WebPoint& base, const WebPoint& extent
) | 1191 void WebLocalFrameImpl::selectRange(const WebPoint& base, const WebPoint& extent
) |
| 1192 { | 1192 { |
| 1193 moveRangeSelection(base, extent); | 1193 moveRangeSelection(base, extent); |
| 1194 } | 1194 } |
| 1195 | 1195 |
| 1196 void WebLocalFrameImpl::selectRange(const WebRange& webRange) | 1196 void WebLocalFrameImpl::selectRange(const WebRange& webRange) |
| 1197 { | 1197 { |
| 1198 if (RefPtrWillBeRawPtr<Range> range = static_cast<PassRefPtrWillBeRawPtr<Ran
ge> >(webRange)) | 1198 if (RefPtrWillBeRawPtr<Range> range = static_cast<PassRefPtrWillBeRawPtr<Ran
ge>>(webRange)) |
| 1199 frame()->selection().setSelectedRange(range.get(), VP_DEFAULT_AFFINITY,
FrameSelection::NonDirectional, NotUserTriggered); | 1199 frame()->selection().setSelectedRange(range.get(), VP_DEFAULT_AFFINITY,
FrameSelection::NonDirectional, NotUserTriggered); |
| 1200 } | 1200 } |
| 1201 | 1201 |
| 1202 void WebLocalFrameImpl::moveRangeSelectionExtent(const WebPoint& point) | 1202 void WebLocalFrameImpl::moveRangeSelectionExtent(const WebPoint& point) |
| 1203 { | 1203 { |
| 1204 VisibleSelection currentSelection = frame()->selection().selection(); | 1204 VisibleSelection currentSelection = frame()->selection().selection(); |
| 1205 | 1205 |
| 1206 VisiblePosition basePosition = currentSelection.isBaseFirst() ? | 1206 VisiblePosition basePosition = currentSelection.isBaseFirst() ? |
| 1207 currentSelection.visibleStart() : currentSelection.visibleEnd(); | 1207 currentSelection.visibleStart() : currentSelection.visibleEnd(); |
| 1208 VisiblePosition extentPosition = visiblePositionForWindowPoint(point); | 1208 VisiblePosition extentPosition = visiblePositionForWindowPoint(point); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 { | 1290 { |
| 1291 WebPluginContainerImpl* container = WebLocalFrameImpl::pluginContainerFromNo
de(frame(), WebNode(frame()->document()->focusedElement())); | 1291 WebPluginContainerImpl* container = WebLocalFrameImpl::pluginContainerFromNo
de(frame(), WebNode(frame()->document()->focusedElement())); |
| 1292 if (container && container->supportsInputMethod()) | 1292 if (container && container->supportsInputMethod()) |
| 1293 return container->plugin(); | 1293 return container->plugin(); |
| 1294 return 0; | 1294 return 0; |
| 1295 } | 1295 } |
| 1296 | 1296 |
| 1297 int WebLocalFrameImpl::printBegin(const WebPrintParams& printParams, const WebNo
de& constrainToNode) | 1297 int WebLocalFrameImpl::printBegin(const WebPrintParams& printParams, const WebNo
de& constrainToNode) |
| 1298 { | 1298 { |
| 1299 ASSERT(!frame()->document()->isFrameSet()); | 1299 ASSERT(!frame()->document()->isFrameSet()); |
| 1300 WebPluginContainerImpl* pluginContainer = 0; | 1300 WebPluginContainerImpl* pluginContainer = nullptr; |
| 1301 if (constrainToNode.isNull()) { | 1301 if (constrainToNode.isNull()) { |
| 1302 // If this is a plugin document, check if the plugin supports its own | 1302 // If this is a plugin document, check if the plugin supports its own |
| 1303 // printing. If it does, we will delegate all printing to that. | 1303 // printing. If it does, we will delegate all printing to that. |
| 1304 pluginContainer = pluginContainerFromFrame(frame()); | 1304 pluginContainer = pluginContainerFromFrame(frame()); |
| 1305 } else { | 1305 } else { |
| 1306 // We only support printing plugin nodes for now. | 1306 // We only support printing plugin nodes for now. |
| 1307 pluginContainer = toWebPluginContainerImpl(constrainToNode.pluginContain
er()); | 1307 pluginContainer = toWebPluginContainerImpl(constrainToNode.pluginContain
er()); |
| 1308 } | 1308 } |
| 1309 | 1309 |
| 1310 if (pluginContainer && pluginContainer->supportsPaginatedPrint()) | 1310 if (pluginContainer && pluginContainer->supportsPaginatedPrint()) |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2012 { | 2012 { |
| 2013 m_frameWidget = frameWidget; | 2013 m_frameWidget = frameWidget; |
| 2014 } | 2014 } |
| 2015 | 2015 |
| 2016 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const | 2016 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const |
| 2017 { | 2017 { |
| 2018 return m_frameWidget; | 2018 return m_frameWidget; |
| 2019 } | 2019 } |
| 2020 | 2020 |
| 2021 } // namespace blink | 2021 } // namespace blink |
| OLD | NEW |