Title: [127244] trunk/Source/WebKit/efl
Revision
127244
Author
[email protected]
Date
2012-08-31 04:35:27 -0700 (Fri, 31 Aug 2012)

Log Message

[EFL] Simplify FrameLoaderClinetEfl by adding a private method.
https://bugs.webkit.org/show_bug.cgi?id=95444

Patch by Jinwoo Song <[email protected]> on 2012-08-31
Reviewed by Gyuyoung Kim.

In the FrameLoaderClientEfl, the codes which checks that
if current frame is main frame are frequently used.
This patch adds a private method and replaces those codes
with the method to simplify.

* WebCoreSupport/FrameLoaderClientEfl.cpp:
(WebCore::FrameLoaderClientEfl::dispatchDidChangeLocationWithinPage):
(WebCore::FrameLoaderClientEfl::dispatchDidReceiveIcon):
(WebCore::FrameLoaderClientEfl::dispatchDidStartProvisionalLoad):
(WebCore::FrameLoaderClientEfl::dispatchDidReceiveTitle):
(WebCore::FrameLoaderClientEfl::dispatchDidCommitLoad):
(WebCore::FrameLoaderClientEfl::dispatchDidFailProvisionalLoad):
(WebCore::FrameLoaderClientEfl::transitionToCommittedForNewPage):
* WebCoreSupport/FrameLoaderClientEfl.h:
(WebCore::FrameLoaderClientEfl::isLoadingMainFrame):

Modified Paths

Diff

Modified: trunk/Source/WebKit/efl/ChangeLog (127243 => 127244)


--- trunk/Source/WebKit/efl/ChangeLog	2012-08-31 09:56:10 UTC (rev 127243)
+++ trunk/Source/WebKit/efl/ChangeLog	2012-08-31 11:35:27 UTC (rev 127244)
@@ -1,3 +1,26 @@
+2012-08-31  Jinwoo Song  <[email protected]>
+
+        [EFL] Simplify FrameLoaderClinetEfl by adding a private method.
+        https://bugs.webkit.org/show_bug.cgi?id=95444
+
+        Reviewed by Gyuyoung Kim.
+
+        In the FrameLoaderClientEfl, the codes which checks that 
+        if current frame is main frame are frequently used.
+        This patch adds a private method and replaces those codes 
+        with the method to simplify.
+
+        * WebCoreSupport/FrameLoaderClientEfl.cpp:
+        (WebCore::FrameLoaderClientEfl::dispatchDidChangeLocationWithinPage):
+        (WebCore::FrameLoaderClientEfl::dispatchDidReceiveIcon):
+        (WebCore::FrameLoaderClientEfl::dispatchDidStartProvisionalLoad):
+        (WebCore::FrameLoaderClientEfl::dispatchDidReceiveTitle):
+        (WebCore::FrameLoaderClientEfl::dispatchDidCommitLoad):
+        (WebCore::FrameLoaderClientEfl::dispatchDidFailProvisionalLoad):
+        (WebCore::FrameLoaderClientEfl::transitionToCommittedForNewPage):
+        * WebCoreSupport/FrameLoaderClientEfl.h:
+        (WebCore::FrameLoaderClientEfl::isLoadingMainFrame):
+
 2012-08-30  Benjamin Poulain  <[email protected]>
 
         Replace JSC::UString by WTF::String

Modified: trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp (127243 => 127244)


--- trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp	2012-08-31 09:56:10 UTC (rev 127243)
+++ trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp	2012-08-31 11:35:27 UTC (rev 127244)
@@ -618,7 +618,7 @@
 {
     ewk_frame_uri_changed(m_frame);
 
-    if (ewk_view_frame_main_get(m_view) != m_frame)
+    if (!isLoadingMainFrame())
         return;
     ewk_view_uri_changed(m_view);
 }
@@ -631,7 +631,7 @@
 void FrameLoaderClientEfl::dispatchDidReceiveIcon()
 {
     // IconController loads icons only for the main frame.
-    ASSERT(ewk_view_frame_main_get(m_view) == m_frame);
+    ASSERT(isLoadingMainFrame());
 
     ewk_view_frame_main_icon_received(m_view);
 }
@@ -639,7 +639,7 @@
 void FrameLoaderClientEfl::dispatchDidStartProvisionalLoad()
 {
     ewk_frame_load_provisional(m_frame);
-    if (ewk_view_frame_main_get(m_view) == m_frame)
+    if (isLoadingMainFrame())
         ewk_view_load_provisional(m_view);
 }
 
@@ -651,7 +651,7 @@
     ewkTitle.direction = (title.direction() == LTR) ? EWK_TEXT_DIRECTION_LEFT_TO_RIGHT : EWK_TEXT_DIRECTION_RIGHT_TO_LEFT;
     ewk_frame_title_set(m_frame, &ewkTitle);
 
-    if (ewk_view_frame_main_get(m_view) != m_frame)
+    if (!isLoadingMainFrame())
         return;
     ewk_view_title_set(m_view, &ewkTitle);
 }
@@ -667,7 +667,7 @@
 {
     ewk_frame_uri_changed(m_frame);
     ewk_frame_load_committed(m_frame);
-    if (ewk_view_frame_main_get(m_view) != m_frame)
+    if (!isLoadingMainFrame())
         return;
     ewk_view_title_set(m_view, 0);
     ewk_view_uri_changed(m_view);
@@ -841,7 +841,7 @@
     error.frame = m_frame;
 
     ewk_frame_load_provisional_failed(m_frame, &error);
-    if (ewk_view_frame_main_get(m_view) == m_frame)
+    if (isLoadingMainFrame())
         ewk_view_load_provisional_failed(m_view, &error);
 
     dispatchDidFailLoad(err);
@@ -1007,7 +1007,7 @@
 
     ewk_frame_view_create_for_view(m_frame, m_view);
 
-    if (m_frame == ewk_view_frame_main_get(m_view)) {
+    if (isLoadingMainFrame()) {
         ewk_view_frame_view_creation_notify(m_view);
         ewk_view_frame_main_cleared(m_view);
     }

Modified: trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h (127243 => 127244)


--- trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h	2012-08-31 09:56:10 UTC (rev 127243)
+++ trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h	2012-08-31 11:35:27 UTC (rev 127244)
@@ -211,6 +211,8 @@
 
     virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext();
  private:
+    bool isLoadingMainFrame() const { return m_frame == ewk_view_frame_main_get(m_view); }
+
     Evas_Object *m_view;
     Evas_Object *m_frame;
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to