Chromium Code Reviews| Index: content/public/browser/blob_context.h |
| diff --git a/content/public/browser/blob_context.h b/content/public/browser/blob_context.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bf20eb3f4bc540d1a6d958ef1913883bf5cd2c36 |
| --- /dev/null |
| +++ b/content/public/browser/blob_context.h |
| @@ -0,0 +1,39 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_PUBLIC_BROWSER_BLOB_CONTEXT_H_ |
| +#define CONTENT_PUBLIC_BROWSER_BLOB_CONTEXT_H_ |
| + |
| +#include "base/callback_forward.h" |
| +#include "content/common/content_export.h" |
| + |
| +namespace content { |
| + |
| +// A handle to Blobs that can be stored outside of content/. |
| +class BlobHandle { |
| + public: |
| + virtual ~BlobHandle() {} |
| + virtual std::string uuid() = 0; |
| + |
| + protected: |
| + BlobHandle() {} |
| + |
| + DISALLOW_COPY_AND_ASSIGN(BlobHandle); |
| +}; |
| + |
| +// Used to coin Blobs in the browser process. For use on the UI thread. |
| +class CONTENT_EXPORT BlobContext { |
|
michaeln
2014/05/08 23:03:18
i'm not sure when CONTENT_EXPORT is needed and whe
tommycli
2014/05/09 16:10:17
Done.
|
| + public: |
| + typedef base::Callback<void(scoped_ptr<BlobHandle>)> BlobCallback; |
| + |
| + virtual void CreateMemoryBackedBlob( |
| + const char* data, size_t length, const BlobCallback& callback) = 0; |
| + |
| + protected: |
| + virtual ~BlobContext() {} |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_BROWSER_BLOB_CONTEXT_H_ |