Reduce QuickLook.h include overhead
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Dec 2016 04:41:52 +0000 (04:41 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Dec 2016 04:41:52 +0000 (04:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=166454

Reviewed by Andreas Kling.

Source/WebCore:

* dom/Document.cpp: Included QuickLook.h for QLPreviewProtocol().
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::setQuickLookHandle): Moved from DocumentLoader.h to here.
* loader/DocumentLoader.h: Stopped including QuickLook.h and forward-declared
QuickLookHandle.
(WebCore::DocumentLoader::setQuickLookHandle): Moved definition out-of-line since it
requires QuickLookHandle to be a complete type.
* loader/ios/QuickLook.h: Updated to use #pragma once. Cleaned up includes and forward
declarations.
* platform/network/ResourceHandle.cpp: Included QuickLook.h so that QuickLookHandle is a
complete type in the ResourceHandle constructor.
* platform/network/ResourceHandle.h: Stopped including QuickLook.h and forward-declared
QuickLookHandle.
(WebCore::ResourceHandle::setQuickLookHandle): Moved definition out-of-line since it
requires QuickLookHandle to be a complete type.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::setQuickLookHandle): Moved from ResourceHandle.h to here.
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Included QuickLook.h for
QuickLookHandle.

Source/WebKit:

* WebCoreSupport/WebResourceLoadScheduler.cpp: Stopped including QuickLook.h.

Source/WebKit2:

* WebProcess/Network/WebLoaderStrategy.cpp: Included QuickLook.h for QLPreviewProtocol().
* WebProcess/Network/WebResourceLoader.cpp: Included QuickLook.h for QuickLookHandle.
* WebProcess/Network/WebResourceLoader.h: Stopped including QuickLook.h.

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

15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/DocumentLoader.h
Source/WebCore/loader/ios/QuickLook.h
Source/WebCore/platform/network/ResourceHandle.cpp
Source/WebCore/platform/network/ResourceHandle.h
Source/WebCore/platform/network/mac/ResourceHandleMac.mm
Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm
Source/WebKit/ChangeLog
Source/WebKit/WebCoreSupport/WebResourceLoadScheduler.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp
Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp
Source/WebKit2/WebProcess/Network/WebResourceLoader.h

index 46898b8..bd11736 100644 (file)
@@ -1,5 +1,32 @@
 2016-12-22  Andy Estes  <aestes@apple.com>
 
+        Reduce QuickLook.h include overhead
+        https://bugs.webkit.org/show_bug.cgi?id=166454
+
+        Reviewed by Andreas Kling.
+
+        * dom/Document.cpp: Included QuickLook.h for QLPreviewProtocol().
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::setQuickLookHandle): Moved from DocumentLoader.h to here.
+        * loader/DocumentLoader.h: Stopped including QuickLook.h and forward-declared
+        QuickLookHandle.
+        (WebCore::DocumentLoader::setQuickLookHandle): Moved definition out-of-line since it
+        requires QuickLookHandle to be a complete type.
+        * loader/ios/QuickLook.h: Updated to use #pragma once. Cleaned up includes and forward
+        declarations.
+        * platform/network/ResourceHandle.cpp: Included QuickLook.h so that QuickLookHandle is a
+        complete type in the ResourceHandle constructor.
+        * platform/network/ResourceHandle.h: Stopped including QuickLook.h and forward-declared
+        QuickLookHandle.
+        (WebCore::ResourceHandle::setQuickLookHandle): Moved definition out-of-line since it
+        requires QuickLookHandle to be a complete type.
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::ResourceHandle::setQuickLookHandle): Moved from ResourceHandle.h to here.
+        * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Included QuickLook.h for
+        QuickLookHandle.
+
+2016-12-22  Andy Estes  <aestes@apple.com>
+
         [iOS] Move QuickLook from WebCore/platform to WebCore/loader
         https://bugs.webkit.org/show_bug.cgi?id=166449
 
index fadf914..7f14cad 100644 (file)
 #include "MediaSession.h"
 #endif
 
+#if USE(QUICK_LOOK)
+#include "QuickLook.h"
+#endif
+
 #if ENABLE(REQUEST_ANIMATION_FRAME)
 #include "RequestAnimationFrameCallback.h"
 #include "ScriptedAnimationController.h"
index 6b2533e..9b38c3b 100644 (file)
@@ -1801,4 +1801,11 @@ bool DocumentLoader::isAlwaysOnLoggingAllowed() const
     return m_frame ? m_frame->isAlwaysOnLoggingAllowed() : true;
 }
 
+#if USE(QUICK_LOOK)
+void DocumentLoader::setQuickLookHandle(std::unique_ptr<QuickLookHandle> quickLookHandle)
+{
+    m_quickLookHandle = WTFMove(quickLookHandle);
+}
+#endif
+
 } // namespace WebCore
index 4d73f48..d70b39b 100644 (file)
 #include <wtf/RunLoopTimer.h>
 #endif
 
-#if USE(QUICK_LOOK)
-#include "QuickLook.h"
-#endif
-
 #if PLATFORM(COCOA) && !USE(CFURLCONNECTION)
 #include <wtf/SchedulePair.h>
 #endif
@@ -74,6 +70,7 @@ class Frame;
 class FrameLoader;
 class IconLoader;
 class Page;
+class QuickLookHandle;
 class ResourceLoader;
 class SharedBuffer;
 class SubresourceLoader;
@@ -273,7 +270,7 @@ public:
     URL documentURL() const;
 
 #if USE(QUICK_LOOK)
-    void setQuickLookHandle(std::unique_ptr<QuickLookHandle> quickLookHandle) { m_quickLookHandle = WTFMove(quickLookHandle); }
+    WEBCORE_EXPORT void setQuickLookHandle(std::unique_ptr<QuickLookHandle>);
     QuickLookHandle* quickLookHandle() const { return m_quickLookHandle.get(); }
 #endif
 
index 6d70903..4da045b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef QuickLook_h
-#define QuickLook_h
+#pragma once
 
 #if USE(QUICK_LOOK)
 
-#import "QuickLookHandleClient.h"
-#import "ResourceRequest.h"
-#import <objc/objc-runtime.h>
-#import <wtf/RefPtr.h>
-
-#if USE(CFURLCONNECTION)
-#include "CFNetworkSPI.h"
-#endif
+#include "QuickLookHandleClient.h"
+#include <objc/objc.h>
+#include <wtf/Forward.h>
+#include <wtf/RefPtr.h>
+#include <wtf/RetainPtr.h>
 
 OBJC_CLASS NSData;
 OBJC_CLASS NSDictionary;
@@ -50,11 +46,11 @@ OBJC_CLASS QLPreviewConverter;
 
 namespace WebCore {
 
-class QuickLookHandleClient;
 class ResourceHandle;
 class ResourceLoader;
 class ResourceResponse;
 class SynchronousResourceHandleCFURLConnectionDelegate;
+class URL;
 
 WEBCORE_EXPORT NSSet *QLPreviewGetSupportedMIMETypesSet();
 
@@ -122,5 +118,3 @@ private:
 } // namespace WebCore
 
 #endif // USE(QUICK_LOOK)
-
-#endif // QuickLook_h
index 0e5696a..21b3295 100644 (file)
 #include <wtf/text/AtomicStringHash.h>
 #include <wtf/text/CString.h>
 
+#if USE(QUICK_LOOK)
+#include "QuickLook.h"
+#endif
+
 namespace WebCore {
 
 static bool shouldForceContentSniffing;
index 0dfbe6d..7bfaa33 100644 (file)
 #include <wtf/RetainPtr.h>
 #endif
 
-#if USE(QUICK_LOOK)
-#include "QuickLook.h"
-#endif
-
 #if USE(SOUP)
 typedef struct _GTlsCertificate GTlsCertificate;
 typedef struct _SoupSession SoupSession;
@@ -83,6 +79,7 @@ class Frame;
 class URL;
 class NetworkingContext;
 class ProtectionSpace;
+class QuickLookHandle;
 class ResourceError;
 class ResourceHandleClient;
 class ResourceHandleInternal;
@@ -152,7 +149,7 @@ public:
 
 #if USE(QUICK_LOOK)
     QuickLookHandle* quickLookHandle() { return m_quickLook.get(); }
-    void setQuickLookHandle(std::unique_ptr<QuickLookHandle> handle) { m_quickLook = WTFMove(handle); }
+    void setQuickLookHandle(std::unique_ptr<QuickLookHandle>);
 #endif
 
 #if PLATFORM(WIN) && USE(CURL)
index 30290aa..1737c78 100644 (file)
@@ -752,5 +752,12 @@ void ResourceHandle::getConnectionTimingData(NSURLConnection *connection, Networ
     
 #endif // ENABLE(WEB_TIMING)
 
+#if USE(QUICK_LOOK)
+void ResourceHandle::setQuickLookHandle(std::unique_ptr<QuickLookHandle> handle)
+{
+    m_quickLook = WTFMove(handle);
+}
+#endif
+
 } // namespace WebCore
 
index 1ca310f..be3f0ee 100644 (file)
@@ -32,6 +32,7 @@
 #import "AuthenticationMac.h"
 #import "Logging.h"
 #import "NSURLRequestSPI.h"
+#import "QuickLook.h"
 #import "ResourceHandle.h"
 #import "ResourceHandleClient.h"
 #import "ResourceRequest.h"
index 945e009..81e69c1 100644 (file)
@@ -1,3 +1,12 @@
+2016-12-22  Andy Estes  <aestes@apple.com>
+
+        Reduce QuickLook.h include overhead
+        https://bugs.webkit.org/show_bug.cgi?id=166454
+
+        Reviewed by Andreas Kling.
+
+        * WebCoreSupport/WebResourceLoadScheduler.cpp: Stopped including QuickLook.h.
+
 2016-12-15  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Sort Xcode project files
index 11bce3b..fdaf578 100644 (file)
 #include <WebCore/RuntimeApplicationChecks.h>
 #endif
 
-#if USE(QUICK_LOOK)
-#include <WebCore/QuickLook.h>
-#endif
-
 // Match the parallel connection count used by the networking layer.
 static unsigned maxRequestsInFlightPerHost;
 #if !PLATFORM(IOS)
index c8b24f5..52ef670 100644 (file)
@@ -1,3 +1,14 @@
+2016-12-22  Andy Estes  <aestes@apple.com>
+
+        Reduce QuickLook.h include overhead
+        https://bugs.webkit.org/show_bug.cgi?id=166454
+
+        Reviewed by Andreas Kling.
+
+        * WebProcess/Network/WebLoaderStrategy.cpp: Included QuickLook.h for QLPreviewProtocol().
+        * WebProcess/Network/WebResourceLoader.cpp: Included QuickLook.h for QuickLookHandle.
+        * WebProcess/Network/WebResourceLoader.h: Stopped including QuickLook.h.
+
 2016-12-22  Tim Horton  <timothy_horton@apple.com>
 
         Null deref under WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground
index e891cd0..1210251 100644 (file)
 #include <WebCore/SubresourceLoader.h>
 #include <wtf/text/CString.h>
 
+#if USE(QUICK_LOOK)
+#include <WebCore/QuickLook.h>
+#endif
+
 using namespace WebCore;
 
 #define RELEASE_LOG_IF_ALLOWED(permissionChecker, fmt, ...) RELEASE_LOG_IF(permissionChecker.isAlwaysOnLoggingAllowed(), Network, "%p - WebLoaderStrategy::" fmt, this, ##__VA_ARGS__)
index 120d56c..6b80266 100644 (file)
 #include <WebCore/ResourceLoader.h>
 #include <WebCore/SubresourceLoader.h>
 
+#if USE(QUICK_LOOK)
+#include <WebCore/QuickLook.h>
+#endif
+
 using namespace WebCore;
 
 #define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), Network, "%p - WebResourceLoader::" fmt, this, ##__VA_ARGS__)
index ec2c8d5..0b8bdf2 100644 (file)
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 
-#if USE(QUICK_LOOK)
-#include <WebCore/QuickLook.h>
-#endif
-
 namespace IPC {
 class DataReference;
 }