Notify to UI process that the content has been suspended by inspector
authorbunam.jeon <bunam.jeon@samsung.com>
Thu, 30 May 2013 06:23:15 +0000 (15:23 +0900)
committerbunam.jeon <bunam.jeon@samsung.com>
Thu, 30 May 2013 06:55:18 +0000 (15:55 +0900)
[Title] Notify to UI process that the content has been suspended by inspector
[Issue#]
[Problem] UI process do not know that the content has been suspend.
[Cause] Not Implement
[Solution] Notice the suspend state WebPageProxy

Change-Id: I7b09a1ddebd0ff0c1c0d32fbe814ae3081f3a431

Source/WTF/wtf/Platform.h
Source/WebCore/dom/Document.cpp
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/Chrome.h
Source/WebCore/page/ChromeClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h

index 937134b..556cc65 100755 (executable)
@@ -634,6 +634,7 @@ com) : Patch to do not adjust cover rect as fixed pixel size*/
 #define ENABLE_TIZEN_CACHE_MEMORY_OPTIMIZATION 1 /* Keunyong Lee(ky07.lee@samsung.com) : The Patches that can reduce memory usage */
 #endif
 #define ENABLE_TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT 1 /* Seonae Kim(sunaeluv.kim@samsung.com) : add number types for switching WK number types */
+#define ENABLE_TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR 1 /* Bunam Jeon(bunam.jeon@samsung.com) : Notify to UI process that the content has been suspended by inspector */
 #define ENABLE_TIZEN_WEBKIT2_VISITED_LINKS 1 /* Jaehun Lim(ljaehun.lim@samsung.com) : workaround patch for coloring visited links.
                                               * this patch should be removed after WK2 HistoryClient is implemented.
                                               */
index 3d0ba78..c358d59 100755 (executable)
@@ -2225,6 +2225,11 @@ void Document::suspendActiveDOMObjects(ActiveDOMObject::ReasonForSuspension why)
         controller->suspendEventsForAllListeners(domWindow());
 
 #endif
+
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
+    if (why == ActiveDOMObject::JavaScriptDebuggerPaused)
+        page()->chrome()->setContentSuspendedByInspector(true);
+#endif
 }
 
 void Document::resumeActiveDOMObjects()
@@ -2240,6 +2245,10 @@ void Document::resumeActiveDOMObjects()
     if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
         controller->resumeEventsForAllListeners(domWindow());
 #endif
+
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
+    page()->chrome()->setContentSuspendedByInspector(false);
+#endif
 }
 
 RenderView* Document::renderView() const
index 450d7b3..b18f505 100644 (file)
@@ -505,6 +505,13 @@ void Chrome::setCursor(const Cursor& cursor)
     m_client->setCursor(cursor);
 }
 
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
+void Chrome::setContentSuspendedByInspector(bool b) const
+{
+    m_client->setContentSuspendedByInspector(b);
+}
+#endif
+
 void Chrome::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
 {
     m_client->setCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves);
index 9adc59e..970191e 100644 (file)
@@ -171,6 +171,10 @@ namespace WebCore {
 
         bool requiresFullscreenForVideoPlayback();
 
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
+        void setContentSuspendedByInspector(bool) const;
+#endif
+
 #if PLATFORM(MAC)
         void focusNSView(NSView*);
 #endif
index b40de3f..9b01a21 100755 (executable)
@@ -410,6 +410,10 @@ namespace WebCore {
         virtual bool exceededLocalFileSystemQuota(Frame*, int64_t currentUsage) = 0;
 #endif
 
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
+        virtual void setContentSuspendedByInspector(bool) { }
+#endif
+
     protected:
         virtual ~ChromeClient() { }
     };
index 2a78b55..0251600 100755 (executable)
@@ -253,6 +253,9 @@ WebPageProxy::WebPageProxy(PageClient* pageClient, PassRefPtr<WebProcessProxy> p
 #if ENABLE(TIZEN_ISF_PORT)
     , m_didCancelCompositionFromWebProcess(false)
 #endif
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
+    , m_contentSuspendedByInspector(false)
+#endif
 {
 #ifndef NDEBUG
     webPageProxyCounter.increment();
index 1a85048..f27ad6d 100755 (executable)
@@ -312,6 +312,10 @@ public:
 
     WebBackForwardList* backForwardList() const { return m_backForwardList.get(); }
 
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
+    bool isContentSuspendedByInspector() { return m_contentSuspendedByInspector; }
+#endif
+
 #if ENABLE(INSPECTOR)
     WebInspectorProxy* inspector();
 #endif
@@ -1419,6 +1423,10 @@ private:
     void exceededLocalFileSystemQuota(uint64_t frameID, const String& originIdentifier, int64_t currentUsage, PassRefPtr<Messages::WebPageProxy::ExceededLocalFileSystemQuota::DelayedReply> reply);
 #endif
 
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
+    void setContentSuspendedByInspector(bool);
+#endif
+
     PageClient* m_pageClient;
     WebLoaderClient m_loaderClient;
     WebPolicyClient m_policyClient;
@@ -1610,6 +1618,10 @@ private:
     WebCore::DragSession m_currentDragSession;
 #endif
 
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
+    bool m_contentSuspendedByInspector;
+#endif
+
     String m_pendingAPIRequestURL;
 
     bool m_mainFrameHasHorizontalScrollbar;
index ab713ec..8a9066f 100755 (executable)
@@ -480,4 +480,8 @@ messages -> WebPageProxy {
 #if ENABLE(TIZEN_ISF_PORT)
     RemoveInputMethodContext(uintptr_t id)
 #endif
+
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
+    setContentSuspendedByInspector(bool isSuspended)
+#endif
 }
index 306525d..abc0c31 100755 (executable)
@@ -1194,4 +1194,11 @@ void WebPageProxy::useSettingsFont()
 }
 #endif
 
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
+void WebPageProxy::setContentSuspendedByInspector(bool isSuspended)
+{
+    m_contentSuspendedByInspector = isSuspended;
+}
+#endif
+
 } // namespace WebKit
index a0ee02f..2ef0edf 100755 (executable)
@@ -1054,4 +1054,10 @@ bool WebChromeClient::exceededLocalFileSystemQuota(Frame* frame, int64_t current
 }
 #endif
 
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
+void WebChromeClient::setContentSuspendedByInspector(bool isSuspended)
+{
+    m_page->send(Messages::WebPageProxy::setContentSuspendedByInspector(isSuspended));
+}
+#endif
 } // namespace WebKit
index 7a1b99f..01e2136 100755 (executable)
@@ -272,6 +272,10 @@ private:
     virtual bool exceededLocalFileSystemQuota(Frame*, int64_t currentQuota) OVERRIDE;
 #endif
 
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
+    virtual void setContentSuspendedByInspector(bool) OVERRIDE;
+#endif
+
     String m_cachedToolTip;
     mutable RefPtr<WebFrame> m_cachedFrameSetLargestFrame;
     mutable bool m_cachedMainFrameHasHorizontalScrollbar;