<html>
    <head>
      <base href="https://bugs.webkit.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Unify SharedMemory factory functions"
   href="https://bugs.webkit.org/show_bug.cgi?id=192714">192714</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Unify SharedMemory factory functions
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>WebKit Misc.
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned@lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>aperez@igalia.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Currently, the following factory functions are available:

- SharedMemory::create(uint8_t*, size_t, Protection), used directly
  in NetworkCache::Data::tryCreateSharedMemory(), and in the content
  extensions code to obtain a SharedMemory object to pass to other
  processes from a mapped file. The latter is only used in the Cocoa
  port.

- SharedMemory::wrapMap(uint8_t*, size_t, int), used only in the libsoup
  implementation of NetworkCache::Data::tryCreateSharedMemory(). This
  takes a mmap address+size and its file descriptor, and the intention
  is the same as Cocoa's ::create, but here being called ::wrapMap
  (which is incoherent).

- SharedMemory::adopt(HANDLE, size_t, Protection) for the Windows
  implementation is used internally in SharedMemoryWin.cpp but
  nowhere else, and the intention seems to be different from the
  two previous ones: in this case it takes a file handle, and
  memory-maps it (instead of taking an *existing* map). This
  should be private.

I would like to propose picking the same name for the first two
cases, and IMHO the name ::wrapMap() better indicates the intention.
Also, I want to make the functions private: the only use is inside
NetworkCache::Data::tryCreateSharedMemory(), so that could be marked
as “friend”; and the usage of ::create() in the content extensions
converted to a call to ::tryCreateSharedMemory().</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>