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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 template <class T> class Local; | 52 template <class T> class Local; |
53 } | 53 } |
54 | 54 |
55 namespace WebKit { | 55 namespace WebKit { |
56 | 56 |
57 class WebData; | 57 class WebData; |
58 class WebDataSource; | 58 class WebDataSource; |
59 class WebDocument; | 59 class WebDocument; |
60 class WebElement; | 60 class WebElement; |
61 class WebFormElement; | 61 class WebFormElement; |
62 class WebFrameClient; | |
62 class WebHistoryItem; | 63 class WebHistoryItem; |
63 class WebInputElement; | 64 class WebInputElement; |
64 class WebPerformance; | 65 class WebPerformance; |
65 class WebRange; | 66 class WebRange; |
66 class WebSecurityOrigin; | 67 class WebSecurityOrigin; |
67 class WebString; | 68 class WebString; |
68 class WebURL; | 69 class WebURL; |
69 class WebURLLoader; | 70 class WebURLLoader; |
70 class WebURLRequest; | 71 class WebURLRequest; |
71 class WebView; | 72 class WebView; |
(...skipping 13 matching lines...) Expand all Loading... | |
85 class WebFrame { | 86 class WebFrame { |
86 public: | 87 public: |
87 // Control of renderTreeAsText output | 88 // Control of renderTreeAsText output |
88 enum RenderAsTextControl { | 89 enum RenderAsTextControl { |
89 RenderAsTextNormal = 0, | 90 RenderAsTextNormal = 0, |
90 RenderAsTextDebug = 1 << 0, | 91 RenderAsTextDebug = 1 << 0, |
91 RenderAsTextPrinting = 1 << 1 | 92 RenderAsTextPrinting = 1 << 1 |
92 }; | 93 }; |
93 typedef unsigned RenderAsTextControls; | 94 typedef unsigned RenderAsTextControls; |
94 | 95 |
96 // Creates a WebFrame with a self references. Call close() to release | |
darin (slow to review)
2013/09/19 22:36:19
nit: "a self references"
Come to think of it, I d
nasko
2013/09/19 22:54:12
nit: a reference or references
awong
2013/09/20 00:36:24
Remove discussion of refcounting.
awong
2013/09/20 00:36:24
Rewrote comment.
| |
97 // this reference. It is valid to pass null client pointers. | |
darin (slow to review)
2013/09/19 22:36:19
There is only one client pointer, so "null client
awong
2013/09/20 00:36:24
Fix here and also for WebView::create().
| |
98 WEBKIT_EXPORT static WebFrame* create(WebFrameClient*); | |
99 | |
100 // Same as create(WebFrameClient*) except the embedder may explicitly pass | |
101 // in the identifier for the WebFrame. This can be used with | |
102 // generateEmbedderIdentifier() if constructing the WebFrameClient for this | |
103 // frame requires the identifier. | |
104 // | |
105 // FIXME: Move the embedder_identifier concept fully to the embedder and | |
darin (slow to review)
2013/09/19 22:36:19
nit: embedder_identifier -> embedderIdentifier
Ho
nasko
2013/09/19 22:54:12
nit: Is FIXME the preferred way for Blink? Not sur
awong
2013/09/20 00:36:24
Is there a benefit to using a default arguments?
| |
106 // remove this factory method. | |
107 WEBKIT_EXPORT static WebFrame* create(WebFrameClient*, long long embedderIde ntifier); | |
108 | |
109 // Generates an identifier suitable for use with create() above. | |
110 // Never returns -1. | |
111 WEBKIT_EXPORT static long long generateEmbedderIdentifier(); | |
112 | |
95 // Returns the number of live WebFrame objects, used for leak checking. | 113 // Returns the number of live WebFrame objects, used for leak checking. |
96 WEBKIT_EXPORT static int instanceCount(); | 114 WEBKIT_EXPORT static int instanceCount(); |
97 | 115 |
98 // Returns the WebFrame associated with the current V8 context. This | 116 // Returns the WebFrame associated with the current V8 context. This |
99 // function can return 0 if the context is associated with a Document that | 117 // function can return 0 if the context is associated with a Document that |
100 // is not currently being displayed in a Frame. | 118 // is not currently being displayed in a Frame. |
101 WEBKIT_EXPORT static WebFrame* frameForCurrentContext(); | 119 WEBKIT_EXPORT static WebFrame* frameForCurrentContext(); |
102 | 120 |
103 // Returns the frame corresponding to the given context. This can return 0 | 121 // Returns the frame corresponding to the given context. This can return 0 |
104 // if the context is detached from the frame, or if the context doesn't | 122 // if the context is detached from the frame, or if the context doesn't |
105 // correspond to a frame (e.g., workers). | 123 // correspond to a frame (e.g., workers). |
106 WEBKIT_EXPORT static WebFrame* frameForContext(v8::Handle<v8::Context>); | 124 WEBKIT_EXPORT static WebFrame* frameForContext(v8::Handle<v8::Context>); |
107 | 125 |
108 // Returns the frame inside a given frame or iframe element. Returns 0 if | 126 // Returns the frame inside a given frame or iframe element. Returns 0 if |
109 // the given element is not a frame, iframe or if the frame is empty. | 127 // the given element is not a frame, iframe or if the frame is empty. |
110 WEBKIT_EXPORT static WebFrame* fromFrameOwnerElement(const WebElement&); | 128 WEBKIT_EXPORT static WebFrame* fromFrameOwnerElement(const WebElement&); |
111 | 129 |
112 | 130 |
darin (slow to review)
2013/09/19 22:36:19
nit: one new line above, two below
awong
2013/09/20 00:36:24
Done.
| |
131 // This method closes and deletes the WebFrame. | |
nasko
2013/09/19 22:54:12
In the comment for create() you say that close wil
awong
2013/09/20 00:36:24
Done.
awong
2013/09/20 00:36:24
Done.
| |
132 virtual void close() = 0; | |
133 | |
113 // Basic properties --------------------------------------------------- | 134 // Basic properties --------------------------------------------------- |
114 | 135 |
115 // The unique name of this frame. | 136 // The unique name of this frame. |
116 virtual WebString uniqueName() const = 0; | 137 virtual WebString uniqueName() const = 0; |
117 | 138 |
118 // The name of this frame. If no name is given, empty string is returned. | 139 // The name of this frame. If no name is given, empty string is returned. |
119 virtual WebString assignedName() const = 0; | 140 virtual WebString assignedName() const = 0; |
120 | 141 |
121 // Sets the name of this frame. For child frames (frames that are not a | 142 // Sets the name of this frame. For child frames (frames that are not a |
122 // top-most frame) the actual name may have a suffix appended to make the | 143 // top-most frame) the actual name may have a suffix appended to make the |
123 // frame name unique within the hierarchy. | 144 // frame name unique within the hierarchy. |
124 virtual void setName(const WebString&) = 0; | 145 virtual void setName(const WebString&) = 0; |
125 | 146 |
126 // A globally unique identifier for this frame. | 147 // A globally unique identifier for this frame. |
148 // FIXME: Convert users to embedderIdentifier() and remove identifier(). | |
127 virtual long long identifier() const = 0; | 149 virtual long long identifier() const = 0; |
150 virtual long long embedderIdentifier() const = 0; | |
darin (slow to review)
2013/09/19 22:36:19
is this renaming just to make it easier to grep th
awong
2013/09/20 00:36:24
Nope. The renaming is because this same class has
| |
128 | 151 |
129 // The urls of the given combination types of favicon (if any) specified by | 152 // The urls of the given combination types of favicon (if any) specified by |
130 // the document loaded in this frame. The iconTypesMask is a bit-mask of | 153 // the document loaded in this frame. The iconTypesMask is a bit-mask of |
131 // WebIconURL::Type values, used to select from the available set of icon | 154 // WebIconURL::Type values, used to select from the available set of icon |
132 // URLs | 155 // URLs |
133 virtual WebVector<WebIconURL> iconURLs(int iconTypesMask) const = 0; | 156 virtual WebVector<WebIconURL> iconURLs(int iconTypesMask) const = 0; |
134 | 157 |
135 | 158 |
136 // Geometry ----------------------------------------------------------- | 159 // Geometry ----------------------------------------------------------- |
137 | 160 |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
650 // text form. This is used only by layout tests. | 673 // text form. This is used only by layout tests. |
651 virtual WebString layerTreeAsText(bool showDebugInfo = false) const = 0; | 674 virtual WebString layerTreeAsText(bool showDebugInfo = false) const = 0; |
652 | 675 |
653 protected: | 676 protected: |
654 ~WebFrame() { } | 677 ~WebFrame() { } |
655 }; | 678 }; |
656 | 679 |
657 } // namespace WebKit | 680 } // namespace WebKit |
658 | 681 |
659 #endif | 682 #endif |
OLD | NEW |