<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[209583] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/209583">209583</a></dd>
<dt>Author</dt> <dd>krollin@apple.com</dd>
<dt>Date</dt> <dd>2016-12-08 16:56:48 -0800 (Thu, 08 Dec 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move FileHandle to WebCore FileHandle.h
https://bugs.webkit.org/show_bug.cgi?id=165562

Reviewed by Alex Christensen.

Source/WebCore:

Add FileHandle, a small wrapper around FileSystem facilities to manage
the lifetime of an open file and give the facilities a C++ interface.

No new tests -- affected facility is currently only used in testing
code and is not user reachable.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/FileHandle.cpp: Added.
(WebCore::FileHandle::FileHandle):
(WebCore::FileHandle::~FileHandle):
(WebCore::FileHandle::operator=):
(WebCore::FileHandle::operator bool):
(WebCore::FileHandle::open):
(WebCore::FileHandle::read):
(WebCore::FileHandle::write):
(WebCore::FileHandle::printf):
(WebCore::FileHandle::close):
* platform/FileHandle.h: Added.

Source/WebKit2:

Move FileHandle from NetworkCaptureTypes.h (which can now be deleted)
to WebCore. Update client code to use the new version.

* NetworkProcess/capture/NetworkCaptureEvent.cpp:
* NetworkProcess/capture/NetworkCaptureEvent.h:
* NetworkProcess/capture/NetworkCaptureManager.cpp:
(WebKit::NetworkCapture::Manager::initialize):
(WebKit::NetworkCapture::Manager::terminate):
(WebKit::NetworkCapture::Manager::logRecordedResource):
(WebKit::NetworkCapture::Manager::logLoadedResource):
(WebKit::NetworkCapture::Manager::logPlayedBackResource):
(WebKit::NetworkCapture::Manager::openCacheFile):
(WebKit::NetworkCapture::Manager::ensureFileHandle): Deleted.
(WebKit::NetworkCapture::Manager::printToFile): Deleted.
* NetworkProcess/capture/NetworkCaptureManager.h:
* NetworkProcess/capture/NetworkCaptureRecorder.cpp:
(WebKit::NetworkCapture::Recorder::writeEvents):
* NetworkProcess/capture/NetworkCaptureTypes.h: Removed.
* WebKit2.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscaptureNetworkCaptureEventcpp">trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureEvent.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscaptureNetworkCaptureEventh">trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureEvent.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscaptureNetworkCaptureManagercpp">trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscaptureNetworkCaptureManagerh">trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureManager.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscaptureNetworkCaptureRecordercpp">trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureRecorder.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformFileHandlecpp">trunk/Source/WebCore/platform/FileHandle.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformFileHandleh">trunk/Source/WebCore/platform/FileHandle.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2NetworkProcesscaptureNetworkCaptureTypesh">trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureTypes.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (209582 => 209583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-12-09 00:53:32 UTC (rev 209582)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-12-09 00:56:48 UTC (rev 209583)
</span><span class="lines">@@ -2142,6 +2142,7 @@
</span><span class="cx">     platform/DragImage.cpp
</span><span class="cx">     platform/EventTrackingRegions.cpp
</span><span class="cx">     platform/FileChooser.cpp
</span><ins>+    platform/FileHandle.cpp
</ins><span class="cx">     platform/FileStream.cpp
</span><span class="cx">     platform/FileSystem.cpp
</span><span class="cx">     platform/GenericTaskQueue.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (209582 => 209583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-09 00:53:32 UTC (rev 209582)
+++ trunk/Source/WebCore/ChangeLog        2016-12-09 00:56:48 UTC (rev 209583)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2016-12-08  Keith Rollin  &lt;krollin@apple.com&gt;
+
+        Move FileHandle to WebCore FileHandle.h
+        https://bugs.webkit.org/show_bug.cgi?id=165562
+
+        Reviewed by Alex Christensen.
+
+        Add FileHandle, a small wrapper around FileSystem facilities to manage
+        the lifetime of an open file and give the facilities a C++ interface.
+
+        No new tests -- affected facility is currently only used in testing
+        code and is not user reachable.
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/FileHandle.cpp: Added.
+        (WebCore::FileHandle::FileHandle):
+        (WebCore::FileHandle::~FileHandle):
+        (WebCore::FileHandle::operator=):
+        (WebCore::FileHandle::operator bool):
+        (WebCore::FileHandle::open):
+        (WebCore::FileHandle::read):
+        (WebCore::FileHandle::write):
+        (WebCore::FileHandle::printf):
+        (WebCore::FileHandle::close):
+        * platform/FileHandle.h: Added.
+
</ins><span class="cx"> 2016-12-07  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         ASSERTION FAILED: m_items.isEmpty() in CustomElementReactionQueue destructor
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (209582 => 209583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-09 00:53:32 UTC (rev 209582)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-09 00:56:48 UTC (rev 209583)
</span><span class="lines">@@ -2320,6 +2320,8 @@
</span><span class="cx">                 52F52E1114A0134F00ACC397 /* NSScrollerImpDetails.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52F52E1014A0134F00ACC397 /* NSScrollerImpDetails.mm */; };
</span><span class="cx">                 5317612213C516690026E454 /* StyleFlexibleBoxData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5317612013C516690026E454 /* StyleFlexibleBoxData.cpp */; };
</span><span class="cx">                 5317612313C516690026E454 /* StyleFlexibleBoxData.h in Headers */ = {isa = PBXBuildFile; fileRef = 5317612113C516690026E454 /* StyleFlexibleBoxData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                5351D4B01DF916B4008010CD /* FileHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5351D4AE1DF916AC008010CD /* FileHandle.cpp */; };
+                5351D4B11DF916B4008010CD /* FileHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 5351D4AF1DF916AC008010CD /* FileHandle.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 536D5A20193E18E900CE4CAB /* HTMLSrcsetParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 536D5A1F193E18E900CE4CAB /* HTMLSrcsetParser.h */; };
</span><span class="cx">                 536D5A21193E18EE00CE4CAB /* HTMLSrcsetParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 536D5A1E193E18D000CE4CAB /* HTMLSrcsetParser.cpp */; };
</span><span class="cx">                 536D5A23193E8E0C00CE4CAB /* ParsingUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 536D5A22193E8E0C00CE4CAB /* ParsingUtilities.h */; };
</span><span class="lines">@@ -9565,6 +9567,8 @@
</span><span class="cx">                 52F52E1014A0134F00ACC397 /* NSScrollerImpDetails.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NSScrollerImpDetails.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5317612013C516690026E454 /* StyleFlexibleBoxData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleFlexibleBoxData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5317612113C516690026E454 /* StyleFlexibleBoxData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleFlexibleBoxData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                5351D4AE1DF916AC008010CD /* FileHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileHandle.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                5351D4AF1DF916AC008010CD /* FileHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileHandle.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 536D5A1E193E18D000CE4CAB /* HTMLSrcsetParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLSrcsetParser.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 536D5A1F193E18E900CE4CAB /* HTMLSrcsetParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLSrcsetParser.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 536D5A22193E8E0C00CE4CAB /* ParsingUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParsingUtilities.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -22515,6 +22519,8 @@
</span><span class="cx">                                 262EC4191D078F3D00BA78FC /* EventTrackingRegions.h */,
</span><span class="cx">                                 934FE9E40B5CA539003E4A73 /* FileChooser.cpp */,
</span><span class="cx">                                 066C772A0AB603B700238CC4 /* FileChooser.h */,
</span><ins>+                                5351D4AE1DF916AC008010CD /* FileHandle.cpp */,
+                                5351D4AF1DF916AC008010CD /* FileHandle.h */,
</ins><span class="cx">                                 4689F1AE1267BAE100E8D380 /* FileMetadata.h */,
</span><span class="cx">                                 2EF1BFE8121C9F4200C27627 /* FileStream.cpp */,
</span><span class="cx">                                 2EF1BFE9121C9F4200C27627 /* FileStream.h */,
</span><span class="lines">@@ -27379,6 +27385,7 @@
</span><span class="cx">                                 57E233631DC7DA2400F28D01 /* RsaOtherPrimesInfo.h in Headers */,
</span><span class="cx">                                 07AB996918DA3C010018771E /* RTCConfiguration.h in Headers */,
</span><span class="cx">                                 07AB996F18DA3C740018771E /* RTCConfigurationPrivate.h in Headers */,
</span><ins>+                                5351D4B11DF916B4008010CD /* FileHandle.h in Headers */,
</ins><span class="cx">                                 078E091E17D14D1C00420AA1 /* RTCDataChannel.h in Headers */,
</span><span class="cx">                                 078E091F17D14D1C00420AA1 /* RTCDataChannelEvent.h in Headers */,
</span><span class="cx">                                 078E093C17D16E1C00420AA1 /* RTCDataChannelHandler.h in Headers */,
</span><span class="lines">@@ -31730,6 +31737,7 @@
</span><span class="cx">                                 2D0621441DA639B600A7FB26 /* WebKitMediaKeyMessageEvent.cpp in Sources */,
</span><span class="cx">                                 2D0621521DA63AA200A7FB26 /* WebKitMediaKeyNeededEvent.cpp in Sources */,
</span><span class="cx">                                 2D06214D1DA63A8B00A7FB26 /* WebKitMediaKeys.cpp in Sources */,
</span><ins>+                                5351D4B01DF916B4008010CD /* FileHandle.cpp in Sources */,
</ins><span class="cx">                                 2D06214F1DA63A9100A7FB26 /* WebKitMediaKeySession.cpp in Sources */,
</span><span class="cx">                                 D7613A501474F13F00DB8606 /* WebKitNamedFlow.cpp in Sources */,
</span><span class="cx">                                 7C48A6D0191C9D6500026674 /* WebKitNamespace.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformFileHandlecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/FileHandle.cpp (0 => 209583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/FileHandle.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/FileHandle.cpp        2016-12-09 00:56:48 UTC (rev 209583)
</span><span class="lines">@@ -0,0 +1,122 @@
</span><ins>+/*
+ * Copyright (C) 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
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;FileHandle.h&quot;
+
+#include &lt;stdarg.h&gt;
+#include &lt;stdio.h&gt;
+
+namespace WebCore {
+
+FileHandle::FileHandle(const String&amp; path, FileOpenMode mode)
+    : m_path(path)
+    , m_mode(mode)
+{
+}
+
+FileHandle::FileHandle(FileHandle&amp;&amp; other)
+    : m_path(WTFMove(other.m_path))
+    , m_mode(WTFMove(other.m_mode))
+    , m_fileHandle(std::exchange(other.m_fileHandle, invalidPlatformFileHandle))
+{
+}
+
+FileHandle::~FileHandle()
+{
+    close();
+}
+
+FileHandle&amp; FileHandle::operator=(FileHandle&amp;&amp; other)
+{
+    close();
+    m_path = WTFMove(other.m_path);
+    m_mode = WTFMove(other.m_mode);
+    m_fileHandle = std::exchange(other.m_fileHandle, invalidPlatformFileHandle);
+    return *this;
+}
+
+FileHandle::operator bool() const
+{
+    return isHandleValid(m_fileHandle);
+}
+
+bool FileHandle::open(const String&amp; path, FileOpenMode mode)
+{
+    if (*this &amp;&amp; path == m_path &amp;&amp; mode == m_mode)
+        return true;
+
+    close();
+    m_path = path;
+    m_mode = mode;
+    return open();
+}
+
+bool FileHandle::open()
+{
+    if (!*this)
+        m_fileHandle = openFile(m_path, m_mode);
+    return static_cast&lt;bool&gt;(*this);
+}
+
+int FileHandle::read(void* data, int length)
+{
+    if (!open())
+        return -1;
+    return readFromFile(m_fileHandle, static_cast&lt;char*&gt;(data), length);
+}
+
+int FileHandle::write(const void* data, int length)
+{
+    if (!open())
+        return -1;
+    return writeToFile(m_fileHandle, static_cast&lt;const char*&gt;(data), length);
+}
+
+bool FileHandle::printf(const char* format, ...)
+{
+    va_list args;
+    va_start(args, format);
+
+    char* buffer = nullptr;
+    if (vasprintf(&amp;buffer, format, args) == -1)
+        return false;
+    auto writeResult = write(buffer, strlen(buffer));
+    free(buffer);
+
+    va_end(args);
+
+    return writeResult &gt;= 0;
+}
+
+void FileHandle::close()
+{
+    closeFile(m_fileHandle);
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformFileHandleh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/FileHandle.h (0 => 209583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/FileHandle.h                                (rev 0)
+++ trunk/Source/WebCore/platform/FileHandle.h        2016-12-09 00:56:48 UTC (rev 209583)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/*
+ * Copyright (C) 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
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include &quot;FileSystem.h&quot;
+
+#include &lt;wtf/Assertions.h&gt;
+
+namespace WebCore {
+
+class WEBCORE_EXPORT FileHandle final {
+public:
+    FileHandle() = default;
+    FileHandle(const String&amp; path, FileOpenMode);
+    FileHandle(const FileHandle&amp; other) = delete;
+    FileHandle(FileHandle&amp;&amp; other);
+
+    ~FileHandle();
+
+    FileHandle&amp; operator=(const FileHandle&amp; other) = delete;
+    FileHandle&amp; operator=(FileHandle&amp;&amp; other);
+
+    explicit operator bool() const;
+
+    bool open(const String&amp; path, FileOpenMode);
+    bool open();
+    int read(void* data, int length);
+    int write(const void* data, int length);
+    bool printf(const char* format, ...) WTF_ATTRIBUTE_PRINTF(2, 3);
+    void close();
+
+private:
+    String m_path;
+    FileOpenMode m_mode { OpenForRead };
+    PlatformFileHandle m_fileHandle { invalidPlatformFileHandle };
+};
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (209582 => 209583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-12-09 00:53:32 UTC (rev 209582)
+++ trunk/Source/WebKit2/ChangeLog        2016-12-09 00:56:48 UTC (rev 209583)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2016-12-08  Keith Rollin  &lt;krollin@apple.com&gt;
+
+        Move FileHandle to WebCore FileHandle.h
+        https://bugs.webkit.org/show_bug.cgi?id=165562
+
+        Reviewed by Alex Christensen.
+
+        Move FileHandle from NetworkCaptureTypes.h (which can now be deleted)
+        to WebCore. Update client code to use the new version.
+
+        * NetworkProcess/capture/NetworkCaptureEvent.cpp:
+        * NetworkProcess/capture/NetworkCaptureEvent.h:
+        * NetworkProcess/capture/NetworkCaptureManager.cpp:
+        (WebKit::NetworkCapture::Manager::initialize):
+        (WebKit::NetworkCapture::Manager::terminate):
+        (WebKit::NetworkCapture::Manager::logRecordedResource):
+        (WebKit::NetworkCapture::Manager::logLoadedResource):
+        (WebKit::NetworkCapture::Manager::logPlayedBackResource):
+        (WebKit::NetworkCapture::Manager::openCacheFile):
+        (WebKit::NetworkCapture::Manager::ensureFileHandle): Deleted.
+        (WebKit::NetworkCapture::Manager::printToFile): Deleted.
+        * NetworkProcess/capture/NetworkCaptureManager.h:
+        * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
+        (WebKit::NetworkCapture::Recorder::writeEvents):
+        * NetworkProcess/capture/NetworkCaptureTypes.h: Removed.
+        * WebKit2.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2016-12-08  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Attempt to fix the iOS build.
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscaptureNetworkCaptureEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureEvent.cpp (209582 => 209583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureEvent.cpp        2016-12-09 00:53:32 UTC (rev 209582)
+++ trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureEvent.cpp        2016-12-09 00:56:48 UTC (rev 209583)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETWORK_CAPTURE)
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> #include &quot;NetworkCaptureLogging.h&quot;
</span><span class="cx"> #include &quot;json.hpp&quot;
</span><span class="cx"> #include &lt;WebCore/ResourceError.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscaptureNetworkCaptureEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureEvent.h (209582 => 209583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureEvent.h        2016-12-09 00:53:32 UTC (rev 209582)
+++ trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureEvent.h        2016-12-09 00:56:48 UTC (rev 209583)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETWORK_CAPTURE)
</span><span class="cx"> 
</span><del>-#include &quot;NetworkCaptureTypes.h&quot;
</del><span class="cx"> #include &lt;WebCore/SharedBuffer.h&gt;
</span><span class="cx"> #include &lt;wtf/MonotonicTime.h&gt;
</span><span class="cx"> #include &lt;wtf/Optional.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscaptureNetworkCaptureManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureManager.cpp (209582 => 209583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureManager.cpp        2016-12-09 00:53:32 UTC (rev 209582)
+++ trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureManager.cpp        2016-12-09 00:56:48 UTC (rev 209583)
</span><span class="lines">@@ -39,7 +39,6 @@
</span><span class="cx"> #include &lt;algorithm&gt;
</span><span class="cx"> #include &lt;iterator&gt;
</span><span class="cx"> #include &lt;limits&gt;
</span><del>-#include &lt;stdarg.h&gt;
</del><span class="cx"> 
</span><span class="cx"> #define DEBUG_CLASS Manager
</span><span class="cx"> 
</span><span class="lines">@@ -73,6 +72,9 @@
</span><span class="cx">         m_recordReplayMode = Disabled;
</span><span class="cx"> 
</span><span class="cx">     m_recordReplayCacheLocation = WebCore::pathByAppendingComponent(recordReplayCacheLocation, kDirNameRecordReplay);
</span><ins>+    m_loadFileHandle = WebCore::FileHandle(reportLoadPath(), WebCore::OpenForWrite);
+    m_recordFileHandle = WebCore::FileHandle(reportRecordPath(), WebCore::OpenForWrite);
+    m_replayFileHandle = WebCore::FileHandle(reportReplayPath(), WebCore::OpenForWrite);
</ins><span class="cx"> 
</span><span class="cx">     DEBUG_LOG(&quot;Cache location = %{public}s&quot;, DEBUG_STR(m_recordReplayCacheLocation));
</span><span class="cx"> 
</span><span class="lines">@@ -82,9 +84,9 @@
</span><span class="cx"> 
</span><span class="cx"> void Manager::terminate()
</span><span class="cx"> {
</span><del>-    m_loadFileHandle.closeFile();
-    m_replayFileHandle.closeFile();
-    m_recordFileHandle.closeFile();
</del><ins>+    m_loadFileHandle.close();
+    m_recordFileHandle.close();
+    m_replayFileHandle.close();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Resource* Manager::findMatch(const WebCore::ResourceRequest&amp; request)
</span><span class="lines">@@ -416,10 +418,8 @@
</span><span class="cx"> {
</span><span class="cx">     // Log network resources as they are cached to disk.
</span><span class="cx"> 
</span><del>-    if (ensureFileHandle(reportRecordPath(), m_recordFileHandle)) {
-        const auto&amp; url = request.url();
-        printToFile(m_recordFileHandle, &quot;%s %s\n&quot;, DEBUG_STR(stringToHash(url.string())), DEBUG_STR(url.string()));
-    }
</del><ins>+    const auto&amp; url = request.url();
+    m_recordFileHandle.printf(&quot;%s %s\n&quot;, DEBUG_STR(stringToHash(url.string())), DEBUG_STR(url.string()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Manager::logLoadedResource(Resource&amp; resource)
</span><span class="lines">@@ -426,8 +426,7 @@
</span><span class="cx"> {
</span><span class="cx">     // Log cached resources as they are loaded from disk.
</span><span class="cx"> 
</span><del>-    if (ensureFileHandle(reportLoadPath(), m_loadFileHandle))
-        printToFile(m_loadFileHandle, &quot;%s\n&quot;, DEBUG_STR(resource.url().string()));
</del><ins>+    m_loadFileHandle.printf(&quot;%s\n&quot;, DEBUG_STR(resource.url().string()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Manager::logPlayedBackResource(const WebCore::ResourceRequest&amp; request, bool wasCacheMiss)
</span><span class="lines">@@ -441,24 +440,16 @@
</span><span class="cx">     else
</span><span class="cx">         DEBUG_LOG(&quot;Cache hit:  URL = %{public}s&quot;, DEBUG_STR(url.string()));
</span><span class="cx"> 
</span><del>-    if (ensureFileHandle(reportReplayPath(), m_replayFileHandle))
-        printToFile(m_replayFileHandle, &quot;%s %s\n&quot;, wasCacheMiss ? &quot;miss&quot; : &quot;hit &quot;, DEBUG_STR(url.string()));
</del><ins>+    m_replayFileHandle.printf(&quot;%s %s\n&quot;, wasCacheMiss ? &quot;miss&quot; : &quot;hit &quot;, DEBUG_STR(url.string()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool Manager::ensureFileHandle(const String&amp; filePath, FileHandle&amp; fileHandle)
</del><ins>+WebCore::FileHandle Manager::openCacheFile(const String&amp; filePath, WebCore::FileOpenMode mode)
</ins><span class="cx"> {
</span><del>-    if (!fileHandle)
-        fileHandle = openCacheFile(filePath, WebCore::OpenForWrite);
-    return fileHandle;
-}
-
-FileHandle Manager::openCacheFile(const String&amp; filePath, WebCore::FileOpenMode mode)
-{
</del><span class="cx">     // If we can trivially open the file, then do that and return the new file
</span><span class="cx">     // handle.
</span><span class="cx"> 
</span><del>-    auto fileHandle = FileHandle::openFile(filePath, mode);
-    if (fileHandle)
</del><ins>+    auto fileHandle = WebCore::FileHandle(filePath, mode);
+    if (fileHandle.open())
</ins><span class="cx">         return fileHandle;
</span><span class="cx"> 
</span><span class="cx">     // If we're opening the file for writing (including appending), then try
</span><span class="lines">@@ -471,8 +462,8 @@
</span><span class="cx">             return fileHandle;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        fileHandle = FileHandle::openFile(filePath, mode);
-        if (fileHandle)
</del><ins>+        fileHandle = WebCore::FileHandle(filePath, mode);
+        if (fileHandle.open())
</ins><span class="cx">             return fileHandle;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -578,21 +569,6 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool Manager::printToFile(const FileHandle&amp; fileHandle, const char* format, ...)
-{
-    va_list args;
-    va_start(args, format);
-
-    char* buffer = nullptr;
-    vasprintf(&amp;buffer, format, args);
-    auto writeResult = fileHandle.writeToFile(buffer, strlen(buffer));
-    free(buffer);
-
-    va_end(args);
-
-    return writeResult &gt;= 0;
-}
-
</del><span class="cx"> } // namespace NetworkCapture
</span><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscaptureNetworkCaptureManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureManager.h (209582 => 209583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureManager.h        2016-12-09 00:53:32 UTC (rev 209582)
+++ trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureManager.h        2016-12-09 00:56:48 UTC (rev 209583)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETWORK_CAPTURE)
</span><span class="cx"> 
</span><del>-#include &quot;NetworkCaptureTypes.h&quot;
</del><ins>+#include &lt;WebCore/FileHandle.h&gt;
</ins><span class="cx"> #include &lt;WebCore/FileSystem.h&gt;
</span><span class="cx"> #include &lt;WebCore/URLParser.h&gt;
</span><span class="cx"> #include &lt;wtf/Function.h&gt;
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx">     void logLoadedResource(Resource&amp;);
</span><span class="cx">     void logPlayedBackResource(const WebCore::ResourceRequest&amp;, bool wasCacheMiss);
</span><span class="cx"> 
</span><del>-    FileHandle openCacheFile(const String&amp;, WebCore::FileOpenMode);
</del><ins>+    WebCore::FileHandle openCacheFile(const String&amp;, WebCore::FileOpenMode);
</ins><span class="cx"> 
</span><span class="cx">     String requestToPath(const WebCore::ResourceRequest&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -101,19 +101,16 @@
</span><span class="cx">     String stringToHash(const String&amp;);
</span><span class="cx">     String hashToPath(const String&amp; hash);
</span><span class="cx"> 
</span><del>-    bool ensureFileHandle(const String&amp; filePath, FileHandle&amp;);
-
</del><span class="cx">     std::optional&lt;Vector&lt;Vector&lt;String&gt;&gt;&gt; readFile(const String&amp; filePath);
</span><span class="cx">     bool getLine(uint8_t const *&amp; p, uint8_t const * const end, Vector&lt;String&gt;&amp; line);
</span><span class="cx">     bool getWord(uint8_t const *&amp; p, uint8_t const * const end, String&amp; word);
</span><del>-    bool printToFile(const FileHandle&amp;, const char* format, ...);
</del><span class="cx"> 
</span><span class="cx">     RecordReplayMode m_recordReplayMode { Disabled };
</span><span class="cx">     String m_recordReplayCacheLocation;
</span><span class="cx"> 
</span><del>-    FileHandle m_loadFileHandle;
-    FileHandle m_replayFileHandle;
-    FileHandle m_recordFileHandle;
</del><ins>+    WebCore::FileHandle m_loadFileHandle;
+    WebCore::FileHandle m_recordFileHandle;
+    WebCore::FileHandle m_replayFileHandle;
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;Resource&gt; m_cachedResources;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscaptureNetworkCaptureRecordercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureRecorder.cpp (209582 => 209583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureRecorder.cpp        2016-12-09 00:53:32 UTC (rev 209582)
+++ trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureRecorder.cpp        2016-12-09 00:56:48 UTC (rev 209583)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> #include &lt;WebCore/ResourceResponse.h&gt;
</span><span class="cx"> #include &lt;WebCore/SharedBuffer.h&gt;
</span><span class="cx"> 
</span><del>-#define DEBUG_CLASS Manager
</del><ins>+#define DEBUG_CLASS Recorder
</ins><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> namespace NetworkCapture {
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx">         // to better find the separate JSON objects that we write to a single
</span><span class="cx">         // file. It also works better with JSON parsers that expect to find a
</span><span class="cx">         // NUL at the end of their input.
</span><del>-        if (handle.writeToFile(asString.c_str(), asString.size() + 1) == -1) {
</del><ins>+        if (handle.write(asString.c_str(), asString.size() + 1) == -1) {
</ins><span class="cx">             DEBUG_LOG_ERROR(&quot;Error trying to write to file for URL = %{public}s&quot;, DEBUG_STR(m_initialRequest.url().string()));
</span><span class="cx">             return;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscaptureNetworkCaptureTypesh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureTypes.h (209582 => 209583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureTypes.h        2016-12-09 00:53:32 UTC (rev 209582)
+++ trunk/Source/WebKit2/NetworkProcess/capture/NetworkCaptureTypes.h        2016-12-09 00:56:48 UTC (rev 209583)
</span><span class="lines">@@ -1,97 +0,0 @@
</span><del>-/*
- * Copyright (C) 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
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(NETWORK_CAPTURE)
-
-#include &lt;WebCore/FileSystem.h&gt;
-
-namespace WebKit {
-namespace NetworkCapture {
-
-class FileHandle final {
-public:
-    FileHandle() = default;
-
-    FileHandle(WebCore::PlatformFileHandle fileHandle)
-        : m_fileHandle(fileHandle) { }
-
-    FileHandle(FileHandle&amp;&amp; other)
-        : m_fileHandle(std::exchange(other.m_fileHandle, WebCore::invalidPlatformFileHandle)) { }
-
-    ~FileHandle()
-    {
-        closeFile();
-    }
-
-    FileHandle&amp; operator=(WebCore::PlatformFileHandle fileHandle)
-    {
-        closeFile();
-        m_fileHandle = fileHandle;
-        return *this;
-    }
-
-    FileHandle&amp; operator=(FileHandle&amp;&amp; other)
-    {
-        closeFile();
-        m_fileHandle = std::exchange(other.m_fileHandle, WebCore::invalidPlatformFileHandle);
-        return *this;
-    }
-
-    FileHandle(const FileHandle&amp;) = delete;
-    FileHandle&amp; operator=(const FileHandle&amp;) = delete;
-
-    operator WebCore::PlatformFileHandle() const { return m_fileHandle; }
-    explicit operator bool() const { return WebCore::isHandleValid(m_fileHandle); }
-
-    static FileHandle openFile(const String&amp; path, WebCore::FileOpenMode mode)
-    {
-        return FileHandle(WebCore::openFile(path, mode));
-    }
-
-    int readFromFile(void* data, int length) const
-    {
-        return WebCore::readFromFile(m_fileHandle, static_cast&lt;char*&gt;(data), length);
-    }
-
-    int writeToFile(const void* data, int length) const
-    {
-        return WebCore::writeToFile(m_fileHandle, static_cast&lt;const char*&gt;(data), length);
-    }
-
-    void closeFile()
-    {
-        WebCore::closeFile(m_fileHandle);
-    }
-
-private:
-    WebCore::PlatformFileHandle m_fileHandle { WebCore::invalidPlatformFileHandle };
-};
-
-} // namespace NetworkCapture
-} // namespace WebKit
-
-#endif // ENABLE(NETWORK_CAPTURE)
</del></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (209582 => 209583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-12-09 00:53:32 UTC (rev 209582)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-12-09 00:56:48 UTC (rev 209583)
</span><span class="lines">@@ -1076,7 +1076,6 @@
</span><span class="cx">                 53BA47D01DC2EF5E004DF4AD /* NetworkDataTaskBlob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 539EB5461DC2EE40009D48CF /* NetworkDataTaskBlob.cpp */; };
</span><span class="cx">                 53BA47D11DC2EF5E004DF4AD /* NetworkDataTaskBlob.h in Headers */ = {isa = PBXBuildFile; fileRef = 539EB5471DC2EE40009D48CF /* NetworkDataTaskBlob.h */; };
</span><span class="cx">                 53DEA3661DDE423100E82648 /* json.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 53DEA3651DDE422E00E82648 /* json.hpp */; };
</span><del>-                53E260651DDA948E00590818 /* NetworkCaptureTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 53E260641DDA948100590818 /* NetworkCaptureTypes.h */; };
</del><span class="cx">                 5C052F261C6D3BD30076E919 /* AuthenticationManagerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C052F241C6D3AB60076E919 /* AuthenticationManagerCocoa.mm */; };
</span><span class="cx">                 5C1426EC1C23F80900D41183 /* NetworkProcessCreationParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C1426E21C23F80500D41183 /* NetworkProcessCreationParameters.cpp */; };
</span><span class="cx">                 5C1426ED1C23F80900D41183 /* NetworkProcessCreationParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C1426E31C23F80500D41183 /* NetworkProcessCreationParameters.h */; };
</span><span class="lines">@@ -3191,7 +3190,7 @@
</span><span class="cx">                 52D5A1B31C5749F200DE34A3 /* WebVideoFullscreenManager.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebVideoFullscreenManager.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52D5A1B41C5749F200DE34A3 /* WebVideoFullscreenManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenManager.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5302582E1DCBBD1D00DA89C2 /* NetworkCaptureResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkCaptureResource.cpp; path = NetworkProcess/capture/NetworkCaptureResource.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                5302582F1DCBBD1D00DA89C2 /* NetworkCaptureResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkCaptureResource.h; path = NetworkProcess/capture/NetworkeCachedResource.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                5302582F1DCBBD1D00DA89C2 /* NetworkCaptureResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkCaptureResource.h; path = NetworkProcess/capture/NetworkCaptureResource.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 530258301DCBBD1D00DA89C2 /* NetworkCaptureEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkCaptureEvent.cpp; path = NetworkProcess/capture/NetworkCaptureEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 530258311DCBBD1D00DA89C2 /* NetworkCaptureEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkCaptureEvent.h; path = NetworkProcess/capture/NetworkCaptureEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 530258321DCBBD1D00DA89C2 /* NetworkCaptureLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkCaptureLogging.h; path = NetworkProcess/capture/NetworkCaptureLogging.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3210,7 +3209,6 @@
</span><span class="cx">                 539EB5461DC2EE40009D48CF /* NetworkDataTaskBlob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkDataTaskBlob.cpp; path = NetworkProcess/NetworkDataTaskBlob.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 539EB5471DC2EE40009D48CF /* NetworkDataTaskBlob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkDataTaskBlob.h; path = NetworkProcess/NetworkDataTaskBlob.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 53DEA3651DDE422E00E82648 /* json.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = json.hpp; path = NetworkProcess/capture/json.hpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                53E260641DDA948100590818 /* NetworkCaptureTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkCaptureTypes.h; path = NetworkProcess/capture/NetworkCaptureTypes.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 579D18B71CCFE34B00B1974C /* PhotosSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PhotosSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5C052F241C6D3AB60076E919 /* AuthenticationManagerCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AuthenticationManagerCocoa.mm; path = Authentication/cocoa/AuthenticationManagerCocoa.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5C1426E21C23F80500D41183 /* NetworkProcessCreationParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkProcessCreationParameters.cpp; path = NetworkProcess/NetworkProcessCreationParameters.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5887,7 +5885,6 @@
</span><span class="cx">                                 530258361DCBBD1D00DA89C2 /* NetworkCaptureRecorder.h */,
</span><span class="cx">                                 530258371DCBBD1D00DA89C2 /* NetworkCaptureReplayer.cpp */,
</span><span class="cx">                                 530258381DCBBD1D00DA89C2 /* NetworkCaptureReplayer.h */,
</span><del>-                                53E260641DDA948100590818 /* NetworkCaptureTypes.h */,
</del><span class="cx">                                 530258391DCBBD1D00DA89C2 /* NetworkDataTaskReplay.cpp */,
</span><span class="cx">                                 5302583A1DCBBD1D00DA89C2 /* NetworkDataTaskReplay.h */,
</span><span class="cx">                         );
</span><span class="lines">@@ -7916,7 +7913,6 @@
</span><span class="cx">                                 530258411DCBBD2200DA89C2 /* NetworkCaptureManager.h in Headers */,
</span><span class="cx">                                 530258431DCBBD2200DA89C2 /* NetworkCaptureRecorder.h in Headers */,
</span><span class="cx">                                 530258451DCBBD2200DA89C2 /* NetworkCaptureReplayer.h in Headers */,
</span><del>-                                53E260651DDA948E00590818 /* NetworkCaptureTypes.h in Headers */,
</del><span class="cx">                                 513A164D1630A9BF005D7D22 /* NetworkConnectionToWebProcess.h in Headers */,
</span><span class="cx">                                 51DD9F2916367DA2001578E9 /* NetworkConnectionToWebProcessMessages.h in Headers */,
</span><span class="cx">                                 5CBC9B8E1C652CA000A8FDCF /* NetworkDataTask.h in Headers */,
</span></span></pre>
</div>
</div>

</body>
</html>