WebKit2: Add an option for a PageGroup to be invisible to the History Client.
authorjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Apr 2011 17:10:06 +0000 (17:10 +0000)
committerjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Apr 2011 17:10:06 +0000 (17:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=58547

Reviewed by Timothy Hatcher.

* Shared/WebPageGroupData.cpp:
(WebKit::WebPageGroupData::encode):
(WebKit::WebPageGroupData::decode):
* Shared/WebPageGroupData.h:

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::inspectorPageGroup):
The Web Inspector should not be visible to the History Client, because its HTML-based nature
should not be exposed through the API.

* UIProcess/WebPageGroup.cpp:
(WebKit::WebPageGroup::create):
(WebKit::WebPageGroup::WebPageGroup):
* UIProcess/WebPageGroup.h:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::updateGlobalHistory):
Do not send the message to the WebContent for the history client.
(WebKit::WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
Ditto.
(WebKit::WebFrameLoaderClient::setTitle):
Ditto.

* WebProcess/WebPage/WebPageGroupProxy.h:
(WebKit::WebPageGroupProxy::isVisibleToHistoryClient):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83867 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPageGroupData.cpp
Source/WebKit2/Shared/WebPageGroupData.h
Source/WebKit2/UIProcess/WebInspectorProxy.cpp
Source/WebKit2/UIProcess/WebPageGroup.cpp
Source/WebKit2/UIProcess/WebPageGroup.h
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h

index a65eceb..134a594 100644 (file)
@@ -1,3 +1,36 @@
+2011-04-14  Jessie Berlin  <jberlin@apple.com>
+
+        Reviewed by Timothy Hatcher.
+
+        WebKit2: Add an option for a PageGroup to be invisible to the History Client.
+        https://bugs.webkit.org/show_bug.cgi?id=58547
+
+        * Shared/WebPageGroupData.cpp:
+        (WebKit::WebPageGroupData::encode):
+        (WebKit::WebPageGroupData::decode):
+        * Shared/WebPageGroupData.h:
+
+        * UIProcess/WebInspectorProxy.cpp:
+        (WebKit::WebInspectorProxy::inspectorPageGroup):
+        The Web Inspector should not be visible to the History Client, because its HTML-based nature
+        should not be exposed through the API.
+
+        * UIProcess/WebPageGroup.cpp:
+        (WebKit::WebPageGroup::create):
+        (WebKit::WebPageGroup::WebPageGroup):
+        * UIProcess/WebPageGroup.h:
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::updateGlobalHistory):
+        Do not send the message to the WebContent for the history client.
+        (WebKit::WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
+        Ditto.
+        (WebKit::WebFrameLoaderClient::setTitle):
+        Ditto.
+
+        * WebProcess/WebPage/WebPageGroupProxy.h:
+        (WebKit::WebPageGroupProxy::isVisibleToHistoryClient):
+
 2011-04-14  Balazs Kelemen  <kbalazs@webkit.org>
 
         Reviewed by Andreas Kling.
index e8df62f..107df1d 100644 (file)
@@ -33,12 +33,12 @@ namespace WebKit {
 
 void WebPageGroupData::encode(CoreIPC::ArgumentEncoder* encoder) const
 {
-    return encoder->encode(CoreIPC::In(identifer, pageGroupID, visibleToInjectedBundle));
+    return encoder->encode(CoreIPC::In(identifer, pageGroupID, visibleToInjectedBundle, visibleToHistoryClient));
 }
 
 bool WebPageGroupData::decode(CoreIPC::ArgumentDecoder* decoder, WebPageGroupData& data)
 {
-    return decoder->decode(CoreIPC::Out(data.identifer, data.pageGroupID, data.visibleToInjectedBundle));
+    return decoder->decode(CoreIPC::Out(data.identifer, data.pageGroupID, data.visibleToInjectedBundle, data.visibleToHistoryClient));
 }
 
 } // namespace WebKit
index fedb5de..36f6fe1 100644 (file)
@@ -42,6 +42,7 @@ struct WebPageGroupData {
     String identifer;
     uint64_t pageGroupID;
     bool visibleToInjectedBundle;
+    bool visibleToHistoryClient;
 };
 
 } // namespace WebKit
index b971315..694e76a 100644 (file)
@@ -46,7 +46,7 @@ namespace WebKit {
 
 WebPageGroup* WebInspectorProxy::inspectorPageGroup()
 {
-    static WebPageGroup* pageGroup = WebPageGroup::create("__WebInspectorPageGroup__", false).leakRef();
+    static WebPageGroup* pageGroup = WebPageGroup::create("__WebInspectorPageGroup__", false, false).leakRef();
     return pageGroup;
 }
 
index f64dd2c..e84f32e 100644 (file)
@@ -47,9 +47,9 @@ static WebPageGroupMap& webPageGroupMap()
     return map;
 }
 
-PassRefPtr<WebPageGroup> WebPageGroup::create(const String& identifier, bool visibleToInjectedBundle)
+PassRefPtr<WebPageGroup> WebPageGroup::create(const String& identifier, bool visibleToInjectedBundle, bool visibleToHistoryClient)
 {
-    RefPtr<WebPageGroup> pageGroup = adoptRef(new WebPageGroup(identifier, visibleToInjectedBundle));
+    RefPtr<WebPageGroup> pageGroup = adoptRef(new WebPageGroup(identifier, visibleToInjectedBundle, visibleToHistoryClient));
 
     webPageGroupMap().set(pageGroup->pageGroupID(), pageGroup.get());
 
@@ -61,7 +61,7 @@ WebPageGroup* WebPageGroup::get(uint64_t pageGroupID)
     return webPageGroupMap().get(pageGroupID);
 }
 
-WebPageGroup::WebPageGroup(const String& identifier, bool visibleToInjectedBundle)
+WebPageGroup::WebPageGroup(const String& identifier, bool visibleToInjectedBundle, bool visibleToHistoryClient)
 {
     m_data.pageGroupID = generatePageGroupID();
 
@@ -74,7 +74,8 @@ WebPageGroup::WebPageGroup(const String& identifier, bool visibleToInjectedBundl
     }
     m_preferences->addPageGroup(this);
 
-    m_data.visibleToInjectedBundle = visibleToInjectedBundle;    
+    m_data.visibleToInjectedBundle = visibleToInjectedBundle;
+    m_data.visibleToHistoryClient = visibleToHistoryClient;
 }
 
 WebPageGroup::~WebPageGroup()
index 7859dfc..38509a8 100644 (file)
@@ -40,7 +40,7 @@ class WebPageGroup : public APIObject {
 public:
     static const Type APIType = TypePageGroup;
 
-    static PassRefPtr<WebPageGroup> create(const String& identifier = String(), bool visibleToInjectedBundle = true);
+    static PassRefPtr<WebPageGroup> create(const String& identifier = String(), bool visibleToInjectedBundle = true, bool visibleToHistoryClient = true);
     static WebPageGroup* get(uint64_t pageGroupID);
 
     virtual ~WebPageGroup();
@@ -58,7 +58,7 @@ public:
     void preferencesDidChange();
 
 private:
-    WebPageGroup(const String& identifier, bool visibleToInjectedBundle);
+    WebPageGroup(const String& identifier, bool visibleToInjectedBundle, bool visibleToHistoryClient);
 
     virtual Type type() const { return APIType; }
 
index 1487a35..729303e 100644 (file)
@@ -840,7 +840,7 @@ void WebFrameLoaderClient::finishedLoading(DocumentLoader* loader)
 void WebFrameLoaderClient::updateGlobalHistory()
 {
     WebPage* webPage = m_frame->page();
-    if (!webPage)
+    if (!webPage || !webPage->pageGroup()->isVisibleToHistoryClient())
         return;
 
     DocumentLoader* loader = m_frame->coreFrame()->loader()->documentLoader();
@@ -856,7 +856,7 @@ void WebFrameLoaderClient::updateGlobalHistory()
 void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
 {
     WebPage* webPage = m_frame->page();
-    if (!webPage)
+    if (!webPage || !webPage->pageGroup()->isVisibleToHistoryClient())
         return;
 
     DocumentLoader* loader = m_frame->coreFrame()->loader()->documentLoader();
@@ -1066,7 +1066,7 @@ PassRefPtr<DocumentLoader> WebFrameLoaderClient::createDocumentLoader(const Reso
 void WebFrameLoaderClient::setTitle(const StringWithDirection& title, const KURL& url)
 {
     WebPage* webPage = m_frame->page();
-    if (!webPage)
+    if (!webPage || !webPage->pageGroup()->isVisibleToHistoryClient())
         return;
 
     // FIXME: use direction of title.
index 55cf629..91e6c5c 100644 (file)
@@ -42,6 +42,7 @@ public:
     const String& identifier() const { return m_data.identifer; }
     uint64_t pageGroupID() const { return m_data.pageGroupID; }
     bool isVisibleToInjectedBundle() const { return m_data.visibleToInjectedBundle; }
+    bool isVisibleToHistoryClient() const { return m_data.visibleToHistoryClient; }
 
 private:
     WebPageGroupProxy(const WebPageGroupData& data)