Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / navigatorcontentutils / NavigatorContentUtils.h
index b119587..b9c52fe 100644 (file)
 #define NavigatorContentUtils_h
 
 #include "modules/navigatorcontentutils/NavigatorContentUtilsClient.h"
-#include "platform/RefCountedSupplement.h"
-#include "wtf/PassRefPtr.h"
+#include "platform/Supplementable.h"
+#include "platform/heap/Handle.h"
+#include "wtf/OwnPtr.h"
 #include "wtf/text/WTFString.h"
 
-namespace WebCore {
+namespace blink {
 
 class ExceptionState;
 class Navigator;
 class Page;
 
-class NavigatorContentUtils FINAL : public RefCountedSupplement<Page, NavigatorContentUtils> {
+class NavigatorContentUtils final : public NoBaseWillBeGarbageCollectedFinalized<NavigatorContentUtils>, public WillBeHeapSupplement<Page> {
+    WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorContentUtils);
 public:
     virtual ~NavigatorContentUtils();
 
-    static const char* supplementName();
     static NavigatorContentUtils* from(Page&);
+    static const char* supplementName();
 
     static void registerProtocolHandler(Navigator&, const String& scheme, const String& url, const String& title, ExceptionState&);
-
     static String isProtocolHandlerRegistered(Navigator&, const String& scheme, const String& url, ExceptionState&);
     static void unregisterProtocolHandler(Navigator&, const String& scheme, const String& url, ExceptionState&);
 
-    static PassRefPtr<NavigatorContentUtils> create(NavigatorContentUtilsClient*);
+    static PassOwnPtrWillBeRawPtr<NavigatorContentUtils> create(PassOwnPtr<NavigatorContentUtilsClient>);
+
+    virtual void trace(Visitor* visitor) override { WillBeHeapSupplement<Page>::trace(visitor); }
+
+    void setClientForTest(PassOwnPtr<NavigatorContentUtilsClient> client) { m_client = client; }
 
 private:
-    explicit NavigatorContentUtils(NavigatorContentUtilsClient* client)
+    explicit NavigatorContentUtils(PassOwnPtr<NavigatorContentUtilsClient> client)
         : m_client(client)
     { }
 
-    NavigatorContentUtilsClient* client() { return m_client; }
+    NavigatorContentUtilsClient* client() { return m_client.get(); }
 
-    NavigatorContentUtilsClient* m_client;
+    OwnPtr<NavigatorContentUtilsClient> m_client;
 };
 
-} // namespace WebCore
+} // namespace blink
 
 #endif // NavigatorContentUtils_h