| 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 #ifndef WebLocalFrame_h | 5 #ifndef WebLocalFrame_h |
| 6 #define WebLocalFrame_h | 6 #define WebLocalFrame_h |
| 7 | 7 |
| 8 #include "WebCompositionUnderline.h" | 8 #include "WebCompositionUnderline.h" |
| 9 #include "WebFrame.h" | 9 #include "WebFrame.h" |
| 10 #include "WebFrameLoadType.h" | 10 #include "WebFrameLoadType.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // require interacting with a frame's document. | 41 // require interacting with a frame's document. |
| 42 // FIXME: Move lots of methods from WebFrame in here. | 42 // FIXME: Move lots of methods from WebFrame in here. |
| 43 class WebLocalFrame : public WebFrame { | 43 class WebLocalFrame : public WebFrame { |
| 44 public: | 44 public: |
| 45 // Creates a WebFrame. Delete this WebFrame by calling WebFrame::close(). | 45 // Creates a WebFrame. Delete this WebFrame by calling WebFrame::close(). |
| 46 // WebFrameClient may not be null. | 46 // WebFrameClient may not be null. |
| 47 BLINK_EXPORT static WebLocalFrame* create(WebTreeScopeType, | 47 BLINK_EXPORT static WebLocalFrame* create(WebTreeScopeType, |
| 48 WebFrameClient*, | 48 WebFrameClient*, |
| 49 WebFrame* opener = nullptr); | 49 WebFrame* opener = nullptr); |
| 50 | 50 |
| 51 // Used to create a provisional local frame in prepration for replacing a | 51 // Used to create a provisional local frame. Currently, it's possible for a |
| 52 // remote frame if the load commits. The returned frame is only partially | 52 // provisional navigation not to commit (i.e. it might turn into a download), |
| 53 // attached to the frame tree: it has the same parent as its potential | 53 // but this can only be determined by actually trying to load it. The loading |
| 54 // replacee but is invisible to the rest of the frames in the frame tree. | 54 // process depends on having a corresponding LocalFrame in Blink to hold all |
| 55 // If the load commits, call swap() to fully attach this frame. | 55 // the pending state. |
| 56 // |
| 57 // When a provisional frame is first created, it is only partially attached to |
| 58 // the frame tree. This means that though a provisional frame might have a |
| 59 // frame owner, the frame owner's content frame does not point back at the |
| 60 // provisional frame. Similarly, though a provisional frame may have a parent |
| 61 // frame pointer, the parent frame's children list will not contain the |
| 62 // provisional frame. Thus, a provisional frame is invisible to the rest of |
| 63 // Blink unless the navigation commits and the provisional frame is fully |
| 64 // attached to the frame tree by calling swap(). |
| 65 // |
| 66 // Otherwise, if the load should not commit, call detach() to discard the |
| 67 // frame. |
| 56 BLINK_EXPORT static WebLocalFrame* createProvisional(WebFrameClient*, | 68 BLINK_EXPORT static WebLocalFrame* createProvisional(WebFrameClient*, |
| 57 WebRemoteFrame*, | 69 WebRemoteFrame*, |
| 58 WebSandboxFlags); | 70 WebSandboxFlags); |
| 59 | 71 |
| 60 // Returns the WebFrame associated with the current V8 context. This | 72 // Returns the WebFrame associated with the current V8 context. This |
| 61 // function can return 0 if the context is associated with a Document that | 73 // function can return 0 if the context is associated with a Document that |
| 62 // is not currently being displayed in a Frame. | 74 // is not currently being displayed in a Frame. |
| 63 BLINK_EXPORT static WebLocalFrame* frameForCurrentContext(); | 75 BLINK_EXPORT static WebLocalFrame* frameForCurrentContext(); |
| 64 | 76 |
| 65 // Returns the frame corresponding to the given context. This can return 0 | 77 // Returns the frame corresponding to the given context. This can return 0 |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 // to call these on a WebLocalFrame. | 481 // to call these on a WebLocalFrame. |
| 470 bool isWebLocalFrame() const override = 0; | 482 bool isWebLocalFrame() const override = 0; |
| 471 WebLocalFrame* toWebLocalFrame() override = 0; | 483 WebLocalFrame* toWebLocalFrame() override = 0; |
| 472 bool isWebRemoteFrame() const override = 0; | 484 bool isWebRemoteFrame() const override = 0; |
| 473 WebRemoteFrame* toWebRemoteFrame() override = 0; | 485 WebRemoteFrame* toWebRemoteFrame() override = 0; |
| 474 }; | 486 }; |
| 475 | 487 |
| 476 } // namespace blink | 488 } // namespace blink |
| 477 | 489 |
| 478 #endif // WebLocalFrame_h | 490 #endif // WebLocalFrame_h |
| OLD | NEW |