| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "web/WebRemoteFrameImpl.h" | 6 #include "web/WebRemoteFrameImpl.h" |
| 7 | 7 |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/frame/RemoteFrame.h" | 9 #include "core/frame/RemoteFrame.h" |
| 10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 #endif | 130 #endif |
| 131 | 131 |
| 132 bool WebRemoteFrameImpl::isWebLocalFrame() const | 132 bool WebRemoteFrameImpl::isWebLocalFrame() const |
| 133 { | 133 { |
| 134 return false; | 134 return false; |
| 135 } | 135 } |
| 136 | 136 |
| 137 WebLocalFrame* WebRemoteFrameImpl::toWebLocalFrame() | 137 WebLocalFrame* WebRemoteFrameImpl::toWebLocalFrame() |
| 138 { | 138 { |
| 139 ASSERT_NOT_REACHED(); | 139 ASSERT_NOT_REACHED(); |
| 140 return 0; | 140 return nullptr; |
| 141 } | 141 } |
| 142 | 142 |
| 143 bool WebRemoteFrameImpl::isWebRemoteFrame() const | 143 bool WebRemoteFrameImpl::isWebRemoteFrame() const |
| 144 { | 144 { |
| 145 return true; | 145 return true; |
| 146 } | 146 } |
| 147 | 147 |
| 148 WebRemoteFrame* WebRemoteFrameImpl::toWebRemoteFrame() | 148 WebRemoteFrame* WebRemoteFrameImpl::toWebRemoteFrame() |
| 149 { | 149 { |
| 150 return this; | 150 return this; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 254 |
| 255 bool WebRemoteFrameImpl::hasVerticalScrollbar() const | 255 bool WebRemoteFrameImpl::hasVerticalScrollbar() const |
| 256 { | 256 { |
| 257 ASSERT_NOT_REACHED(); | 257 ASSERT_NOT_REACHED(); |
| 258 return false; | 258 return false; |
| 259 } | 259 } |
| 260 | 260 |
| 261 WebView* WebRemoteFrameImpl::view() const | 261 WebView* WebRemoteFrameImpl::view() const |
| 262 { | 262 { |
| 263 if (!frame()) | 263 if (!frame()) |
| 264 return 0; | 264 return nullptr; |
| 265 return WebViewImpl::fromPage(frame()->page()); | 265 return WebViewImpl::fromPage(frame()->page()); |
| 266 } | 266 } |
| 267 | 267 |
| 268 void WebRemoteFrameImpl::removeChild(WebFrame* frame) | 268 void WebRemoteFrameImpl::removeChild(WebFrame* frame) |
| 269 { | 269 { |
| 270 WebFrame::removeChild(frame); | 270 WebFrame::removeChild(frame); |
| 271 m_ownersForChildren.remove(frame); | 271 m_ownersForChildren.remove(frame); |
| 272 } | 272 } |
| 273 | 273 |
| 274 WebDocument WebRemoteFrameImpl::document() const | 274 WebDocument WebRemoteFrameImpl::document() const |
| (...skipping 14 matching lines...) Expand all Loading... |
| 289 } | 289 } |
| 290 | 290 |
| 291 void WebRemoteFrameImpl::dispatchUnloadEvent() | 291 void WebRemoteFrameImpl::dispatchUnloadEvent() |
| 292 { | 292 { |
| 293 ASSERT_NOT_REACHED(); | 293 ASSERT_NOT_REACHED(); |
| 294 } | 294 } |
| 295 | 295 |
| 296 NPObject* WebRemoteFrameImpl::windowObject() const | 296 NPObject* WebRemoteFrameImpl::windowObject() const |
| 297 { | 297 { |
| 298 ASSERT_NOT_REACHED(); | 298 ASSERT_NOT_REACHED(); |
| 299 return 0; | 299 return nullptr; |
| 300 } | 300 } |
| 301 | 301 |
| 302 void WebRemoteFrameImpl::bindToWindowObject(const WebString& name, NPObject*) | 302 void WebRemoteFrameImpl::bindToWindowObject(const WebString& name, NPObject*) |
| 303 { | 303 { |
| 304 ASSERT_NOT_REACHED(); | 304 ASSERT_NOT_REACHED(); |
| 305 } | 305 } |
| 306 | 306 |
| 307 void WebRemoteFrameImpl::bindToWindowObject(const WebString& name, NPObject*, vo
id*) | 307 void WebRemoteFrameImpl::bindToWindowObject(const WebString& name, NPObject*, vo
id*) |
| 308 { | 308 { |
| 309 ASSERT_NOT_REACHED(); | 309 ASSERT_NOT_REACHED(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 349 |
| 350 v8::Handle<v8::Value> WebRemoteFrameImpl::executeScriptAndReturnValue( | 350 v8::Handle<v8::Value> WebRemoteFrameImpl::executeScriptAndReturnValue( |
| 351 const WebScriptSource&) | 351 const WebScriptSource&) |
| 352 { | 352 { |
| 353 ASSERT_NOT_REACHED(); | 353 ASSERT_NOT_REACHED(); |
| 354 return v8::Handle<v8::Value>(); | 354 return v8::Handle<v8::Value>(); |
| 355 } | 355 } |
| 356 | 356 |
| 357 void WebRemoteFrameImpl::executeScriptInIsolatedWorld( | 357 void WebRemoteFrameImpl::executeScriptInIsolatedWorld( |
| 358 int worldID, const WebScriptSource* sourcesIn, unsigned numSources, | 358 int worldID, const WebScriptSource* sourcesIn, unsigned numSources, |
| 359 int extensionGroup, WebVector<v8::Local<v8::Value> >* results) | 359 int extensionGroup, WebVector<v8::Local<v8::Value>>* results) |
| 360 { | 360 { |
| 361 ASSERT_NOT_REACHED(); | 361 ASSERT_NOT_REACHED(); |
| 362 } | 362 } |
| 363 | 363 |
| 364 v8::Handle<v8::Value> WebRemoteFrameImpl::callFunctionEvenIfScriptDisabled( | 364 v8::Handle<v8::Value> WebRemoteFrameImpl::callFunctionEvenIfScriptDisabled( |
| 365 v8::Handle<v8::Function>, | 365 v8::Handle<v8::Function>, |
| 366 v8::Handle<v8::Value>, | 366 v8::Handle<v8::Value>, |
| 367 int argc, | 367 int argc, |
| 368 v8::Handle<v8::Value> argv[]) | 368 v8::Handle<v8::Value> argv[]) |
| 369 { | 369 { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 } | 412 } |
| 413 | 413 |
| 414 void WebRemoteFrameImpl::stopLoading() | 414 void WebRemoteFrameImpl::stopLoading() |
| 415 { | 415 { |
| 416 ASSERT_NOT_REACHED(); | 416 ASSERT_NOT_REACHED(); |
| 417 } | 417 } |
| 418 | 418 |
| 419 WebDataSource* WebRemoteFrameImpl::provisionalDataSource() const | 419 WebDataSource* WebRemoteFrameImpl::provisionalDataSource() const |
| 420 { | 420 { |
| 421 ASSERT_NOT_REACHED(); | 421 ASSERT_NOT_REACHED(); |
| 422 return 0; | 422 return nullptr; |
| 423 } | 423 } |
| 424 | 424 |
| 425 WebDataSource* WebRemoteFrameImpl::dataSource() const | 425 WebDataSource* WebRemoteFrameImpl::dataSource() const |
| 426 { | 426 { |
| 427 ASSERT_NOT_REACHED(); | 427 ASSERT_NOT_REACHED(); |
| 428 return 0; | 428 return nullptr; |
| 429 } | 429 } |
| 430 | 430 |
| 431 void WebRemoteFrameImpl::enableViewSourceMode(bool enable) | 431 void WebRemoteFrameImpl::enableViewSourceMode(bool enable) |
| 432 { | 432 { |
| 433 ASSERT_NOT_REACHED(); | 433 ASSERT_NOT_REACHED(); |
| 434 } | 434 } |
| 435 | 435 |
| 436 bool WebRemoteFrameImpl::isViewSourceModeEnabled() const | 436 bool WebRemoteFrameImpl::isViewSourceModeEnabled() const |
| 437 { | 437 { |
| 438 ASSERT_NOT_REACHED(); | 438 ASSERT_NOT_REACHED(); |
| 439 return false; | 439 return false; |
| 440 } | 440 } |
| 441 | 441 |
| 442 void WebRemoteFrameImpl::setReferrerForRequest(WebURLRequest&, const WebURL& ref
errer) | 442 void WebRemoteFrameImpl::setReferrerForRequest(WebURLRequest&, const WebURL& ref
errer) |
| 443 { | 443 { |
| 444 ASSERT_NOT_REACHED(); | 444 ASSERT_NOT_REACHED(); |
| 445 } | 445 } |
| 446 | 446 |
| 447 void WebRemoteFrameImpl::dispatchWillSendRequest(WebURLRequest&) | 447 void WebRemoteFrameImpl::dispatchWillSendRequest(WebURLRequest&) |
| 448 { | 448 { |
| 449 ASSERT_NOT_REACHED(); | 449 ASSERT_NOT_REACHED(); |
| 450 } | 450 } |
| 451 | 451 |
| 452 WebURLLoader* WebRemoteFrameImpl::createAssociatedURLLoader(const WebURLLoaderOp
tions&) | 452 WebURLLoader* WebRemoteFrameImpl::createAssociatedURLLoader(const WebURLLoaderOp
tions&) |
| 453 { | 453 { |
| 454 ASSERT_NOT_REACHED(); | 454 ASSERT_NOT_REACHED(); |
| 455 return 0; | 455 return nullptr; |
| 456 } | 456 } |
| 457 | 457 |
| 458 unsigned WebRemoteFrameImpl::unloadListenerCount() const | 458 unsigned WebRemoteFrameImpl::unloadListenerCount() const |
| 459 { | 459 { |
| 460 ASSERT_NOT_REACHED(); | 460 ASSERT_NOT_REACHED(); |
| 461 return 0; | 461 return 0; |
| 462 } | 462 } |
| 463 | 463 |
| 464 void WebRemoteFrameImpl::replaceSelection(const WebString&) | 464 void WebRemoteFrameImpl::replaceSelection(const WebString&) |
| 465 { | 465 { |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 | 790 |
| 791 WebString WebRemoteFrameImpl::layerTreeAsText(bool showDebugInfo) const | 791 WebString WebRemoteFrameImpl::layerTreeAsText(bool showDebugInfo) const |
| 792 { | 792 { |
| 793 ASSERT_NOT_REACHED(); | 793 ASSERT_NOT_REACHED(); |
| 794 return WebString(); | 794 return WebString(); |
| 795 } | 795 } |
| 796 | 796 |
| 797 WebLocalFrame* WebRemoteFrameImpl::createLocalChild(const WebString& name, WebFr
ameClient* client) | 797 WebLocalFrame* WebRemoteFrameImpl::createLocalChild(const WebString& name, WebFr
ameClient* client) |
| 798 { | 798 { |
| 799 WebLocalFrameImpl* child = toWebLocalFrameImpl(WebLocalFrame::create(client)
); | 799 WebLocalFrameImpl* child = toWebLocalFrameImpl(WebLocalFrame::create(client)
); |
| 800 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner> >::AddResult res
ult = | 800 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu
lt = |
| 801 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(child)); | 801 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(child)); |
| 802 appendChild(child); | 802 appendChild(child); |
| 803 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame,
which may | 803 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame,
which may |
| 804 // result in the browser observing two navigations to about:blank (one from
the initial | 804 // result in the browser observing two navigations to about:blank (one from
the initial |
| 805 // frame creation, and one from swapping it into the remote process). FrameL
oader might | 805 // frame creation, and one from swapping it into the remote process). FrameL
oader might |
| 806 // need a special initialization function for this case to avoid that duplic
ate navigation. | 806 // need a special initialization function for this case to avoid that duplic
ate navigation. |
| 807 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name, nullAtom); | 807 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name, nullAtom); |
| 808 // Partially related with the above FIXME--the init() call may trigger JS di
spatch. However, | 808 // Partially related with the above FIXME--the init() call may trigger JS di
spatch. However, |
| 809 // if the parent is remote, it should never be detached synchronously... | 809 // if the parent is remote, it should never be detached synchronously... |
| 810 ASSERT(child->frame()); | 810 ASSERT(child->frame()); |
| 811 return child; | 811 return child; |
| 812 } | 812 } |
| 813 | 813 |
| 814 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name) | 814 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name) |
| 815 { | 815 { |
| 816 setCoreFrame(RemoteFrame::create(&m_frameClient, host, owner)); | 816 setCoreFrame(RemoteFrame::create(&m_frameClient, host, owner)); |
| 817 m_frame->tree().setName(name, nullAtom); | 817 m_frame->tree().setName(name, nullAtom); |
| 818 } | 818 } |
| 819 | 819 |
| 820 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(const WebString& name, Web
RemoteFrameClient* client) | 820 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(const WebString& name, Web
RemoteFrameClient* client) |
| 821 { | 821 { |
| 822 WebRemoteFrameImpl* child = toWebRemoteFrameImpl(WebRemoteFrame::create(clie
nt)); | 822 WebRemoteFrameImpl* child = toWebRemoteFrameImpl(WebRemoteFrame::create(clie
nt)); |
| 823 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner> >::AddResult res
ult = | 823 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu
lt = |
| 824 m_ownersForChildren.add(child, adoptPtrWillBeNoop(new PlaceholderFrameOw
ner)); | 824 m_ownersForChildren.add(child, adoptPtrWillBeNoop(new PlaceholderFrameOw
ner)); |
| 825 appendChild(child); | 825 appendChild(child); |
| 826 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name); | 826 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name); |
| 827 return child; | 827 return child; |
| 828 } | 828 } |
| 829 | 829 |
| 830 void WebRemoteFrameImpl::setCoreFrame(PassRefPtrWillBeRawPtr<RemoteFrame> frame) | 830 void WebRemoteFrameImpl::setCoreFrame(PassRefPtrWillBeRawPtr<RemoteFrame> frame) |
| 831 { | 831 { |
| 832 m_frame = frame; | 832 m_frame = frame; |
| 833 } | 833 } |
| 834 | 834 |
| 835 WebRemoteFrameImpl* WebRemoteFrameImpl::fromFrame(RemoteFrame& frame) | 835 WebRemoteFrameImpl* WebRemoteFrameImpl::fromFrame(RemoteFrame& frame) |
| 836 { | 836 { |
| 837 if (!frame.client()) | 837 if (!frame.client()) |
| 838 return 0; | 838 return nullptr; |
| 839 return static_cast<RemoteFrameClientImpl*>(frame.client())->webFrame(); | 839 return static_cast<RemoteFrameClientImpl*>(frame.client())->webFrame(); |
| 840 } | 840 } |
| 841 | 841 |
| 842 void WebRemoteFrameImpl::initializeFromFrame(WebLocalFrame* source) const | 842 void WebRemoteFrameImpl::initializeFromFrame(WebLocalFrame* source) const |
| 843 { | 843 { |
| 844 ASSERT(source); | 844 ASSERT(source); |
| 845 WebLocalFrameImpl* localFrameImpl = toWebLocalFrameImpl(source); | 845 WebLocalFrameImpl* localFrameImpl = toWebLocalFrameImpl(source); |
| 846 client()->initializeChildFrame( | 846 client()->initializeChildFrame( |
| 847 localFrameImpl->frame()->view()->frameRect(), | 847 localFrameImpl->frame()->view()->frameRect(), |
| 848 localFrameImpl->frame()->view()->visibleContentScaleFactor()); | 848 localFrameImpl->frame()->view()->visibleContentScaleFactor()); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 863 { | 863 { |
| 864 frame()->setIsLoading(false); | 864 frame()->setIsLoading(false); |
| 865 if (parent() && parent()->isWebLocalFrame()) { | 865 if (parent() && parent()->isWebLocalFrame()) { |
| 866 WebLocalFrameImpl* parentFrame = | 866 WebLocalFrameImpl* parentFrame = |
| 867 toWebLocalFrameImpl(parent()->toWebLocalFrame()); | 867 toWebLocalFrameImpl(parent()->toWebLocalFrame()); |
| 868 parentFrame->frame()->loader().checkCompleted(); | 868 parentFrame->frame()->loader().checkCompleted(); |
| 869 } | 869 } |
| 870 } | 870 } |
| 871 | 871 |
| 872 } // namespace blink | 872 } // namespace blink |
| OLD | NEW |