startupcache/StartupCacheUtils.h
author Igor Gutorov <igootorov@gmail.com>
Tue, 09 Jan 2018 17:27:47 -0600
changeset 452758 ccb64910979ad80245221ad8baa2e6dd4b7a5b20
parent 442424 ab03b4c381d4e1768d4a2af7cec65003d89a4b12
child 507921 04f0bbf40bf36957dc1f72a8aae9916df0e3222f
permissions -rw-r--r--
servo: Merge #19732 - Update Gentoo Linux setup to include clang (from gootorov:master); r=jdm <!-- Please describe your changes on the following line: -->While other Linux distributions include clang package as required in the setup section of README, Gentoo does not. This patch fixes it. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because it is a documentation fix <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: d0300ffd67c2278f6c9ce8cac23923f13641abf3

/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsStartupCacheUtils_h_
#define nsStartupCacheUtils_h_

#include "nsString.h"
#include "nsIStorageStream.h"
#include "nsIObjectInputStream.h"
#include "nsIObjectOutputStream.h"
#include "mozilla/UniquePtr.h"

class nsIURI;

namespace mozilla {
namespace scache {

nsresult
NewObjectInputStreamFromBuffer(UniquePtr<char[]> buffer, uint32_t len,
                               nsIObjectInputStream** stream);

// We can't retrieve the wrapped stream from the objectOutputStream later,
// so we return it here. We give callers in debug builds the option
// to wrap the outputstream in a debug stream, which will detect if
// non-singleton objects are written out multiple times during a serialization.
// This could cause them to be deserialized incorrectly (as multiple copies
// instead of references).
nsresult
NewObjectOutputWrappedStorageStream(nsIObjectOutputStream **wrapperStream,
                                    nsIStorageStream** stream,
                                    bool wantDebugStream);

// Creates a buffer for storing the stream into the cache. The buffer is
// allocated with 'new []'.  After calling this function, the caller would
// typically call StartupCache::PutBuffer with the returned buffer.
nsresult
NewBufferFromStorageStream(nsIStorageStream *storageStream,
                           UniquePtr<char[]>* buffer, uint32_t* len);

nsresult
ResolveURI(nsIURI *in, nsIURI **out);

nsresult
PathifyURI(nsIURI *in, nsACString &out);
} // namespace scache
} // namespace mozilla

#endif //nsStartupCacheUtils_h_