Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(682)

Unified Diff: public/web/WebFrame.h

Issue 23506013: Make the embedder responsible for creating the WebFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix lifetime on frame detach Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/tests/WebViewTest.cpp ('k') | public/web/WebFrameClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/web/WebFrame.h
diff --git a/public/web/WebFrame.h b/public/web/WebFrame.h
index 3a7ce1f0f1a8a8ada2b3b27242e2b2ef6b04a57b..e4877988df352ba7a1de401d3b34fb3af96b96db 100644
--- a/public/web/WebFrame.h
+++ b/public/web/WebFrame.h
@@ -59,6 +59,7 @@ class WebDataSource;
class WebDocument;
class WebElement;
class WebFormElement;
+class WebFrameClient;
class WebHistoryItem;
class WebInputElement;
class WebPerformance;
@@ -92,6 +93,23 @@ public:
};
typedef unsigned RenderAsTextControls;
+ // Creates a WebFrame. Delete this WebFrame by calling WebFrame::close().
+ // It is valid to pass a null client pointer.
+ BLINK_EXPORT static WebFrame* create(WebFrameClient*);
+
+ // Same as create(WebFrameClient*) except the embedder may explicitly pass
+ // in the identifier for the WebFrame. This can be used with
+ // generateEmbedderIdentifier() if constructing the WebFrameClient for this
+ // frame requires the identifier.
+ //
+ // FIXME: Move the embedderIdentifier concept fully to the embedder and
+ // remove this factory method.
+ BLINK_EXPORT static WebFrame* create(WebFrameClient*, long long embedderIdentifier);
+
+ // Generates an identifier suitable for use with create() above.
+ // Never returns -1.
+ BLINK_EXPORT static long long generateEmbedderIdentifier();
+
// Returns the number of live WebFrame objects, used for leak checking.
BLINK_EXPORT static int instanceCount();
@@ -109,6 +127,9 @@ public:
// the given element is not a frame, iframe or if the frame is empty.
BLINK_EXPORT static WebFrame* fromFrameOwnerElement(const WebElement&);
+ // This method closes and deletes the WebFrame.
+ virtual void close() = 0;
+
// Basic properties ---------------------------------------------------
@@ -124,7 +145,9 @@ public:
virtual void setName(const WebString&) = 0;
// A globally unique identifier for this frame.
- virtual long long identifier() const = 0;
+ // FIXME: Convert users to embedderIdentifier() and remove identifier().
+ long long identifier() const { return embedderIdentifier(); }
+ virtual long long embedderIdentifier() const = 0;
// The urls of the given combination types of favicon (if any) specified by
// the document loaded in this frame. The iconTypesMask is a bit-mask of
« no previous file with comments | « Source/web/tests/WebViewTest.cpp ('k') | public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698