Index: third_party/WebKit/Source/core/frame/WebLocalFrameBase.h |
diff --git a/third_party/WebKit/Source/core/frame/WebLocalFrameBase.h b/third_party/WebKit/Source/core/frame/WebLocalFrameBase.h |
index 4c412122fca9dcd2ada1ddef45cb69df985a39c3..436d7b6ff06c29661812bdccd760c9b83971792c 100644 |
--- a/third_party/WebKit/Source/core/frame/WebLocalFrameBase.h |
+++ b/third_party/WebKit/Source/core/frame/WebLocalFrameBase.h |
@@ -1,14 +1,18 @@ |
// Copyright 2017 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
-// found in the LICENSE file.#ifndef WebViewBase_h |
+// found in the LICENSE file. |
#ifndef WebLocalFrameBase_h |
#define WebLocalFrameBase_h |
+#include "core/CoreExport.h" |
+#include "public/platform/WebCommon.h" |
#include "public/web/WebLocalFrame.h" |
namespace blink { |
+class LocalFrame; |
+ |
// WebLocalFrameBase is a temporary class the provides a layer of abstraction |
// for WebLocalFrameImpl. Mehtods that are declared public in WebLocalFrameImpl |
// that are not overrides from WebLocalFrame will be declared pure virtual in |
@@ -18,9 +22,29 @@ namespace blink { |
// modules. |
// TODO(slangley): Remove this class once WebLocalFrameImpl is in core/. |
class WebLocalFrameBase : public WebLocalFrame { |
+ public: |
+ // Creation Methods. |
+ CORE_EXPORT static WebLocalFrameBase* FromFrame(LocalFrame*); |
+ CORE_EXPORT static WebLocalFrameBase* FromFrame(LocalFrame&); |
+ |
+ // WebLocalFrame creation callbacks. These callbacks provide the means to |
+ // keep WebLocalFrameBase separate from WebLocalFrameImpl. On process |
+ // initialization it is expected that the correct callbacks are registered |
+ // so that WebLocalFrameBase can instantiate the concrete class. |
dcheng
2017/05/05 06:29:58
I'm really tempted to say that we should just #inc
slangley
2017/05/05 09:25:08
There are scenarios that don't link in libblink_we
haraken
2017/05/05 13:48:51
Yeah, I want to avoid using the callback pattern.
slangley
2017/05/07 00:12:10
We don't have a way to get a reference to a Chrome
haraken
2017/05/08 00:01:58
When you call WebLocalFrameImpl::FromFrame(Frame*)
slangley
2017/05/08 01:47:49
Seems true - i wasn't able to grok that many indir
|
+ using CreateFromLocalFramePtrCallback = WebLocalFrameBase* (*)(LocalFrame*); |
+ |
+ CORE_EXPORT static void RegisterCreateFromLocalFramePtrCallback( |
+ CreateFromLocalFramePtrCallback); |
+ |
+ virtual WebFrameClient* Client() const = 0; |
+ |
protected: |
explicit WebLocalFrameBase(WebTreeScopeType scope) : WebLocalFrame(scope) {} |
+ |
+ private: |
+ static CreateFromLocalFramePtrCallback create_local_frame_ptr_callback_; |
}; |
-} |
+ |
+} // namespace blink |
#endif // WebLocalFrameBase_h |