15c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)/*
293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * Copyright (C) 2010 Google Inc. All rights reserved.
35c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
45c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Redistribution and use in source and binary forms, with or without
55c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * modification, are permitted provided that the following conditions are
65c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * met:
75c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
85c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *     * Redistributions of source code must retain the above copyright
95c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * notice, this list of conditions and the following disclaimer.
105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *     * Redistributions in binary form must reproduce the above
115c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * copyright notice, this list of conditions and the following disclaimer
125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * in the documentation and/or other materials provided with the
135c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * distribution.
145c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *     * Neither the name of Google Inc. nor the names of its
155c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * contributors may be used to endorse or promote products derived from
165c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * this software without specific prior written permission.
175c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
185c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
195c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
205c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
225c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
235c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
245c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
255c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
265c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
275c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
285c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
295c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) */
305c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
3193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#ifndef WebBlobRegistry_h
3293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#define WebBlobRegistry_h
335c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
3493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#include "WebCommon.h"
355c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
3651b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)namespace blink {
375c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
3893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class WebBlobData;
39591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdochclass WebString;
40521d96ec04ace82590870fb04353ec4f82bb150fTorne (Richard Coles)class WebThreadSafeData;
4193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class WebURL;
4293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
4393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class WebBlobRegistry {
445c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)public:
4593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    virtual ~WebBlobRegistry() { }
4693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
47e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)    virtual void registerBlobData(const WebString& uuid, const WebBlobData&) { }
48e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)    virtual void addBlobDataRef(const WebString& uuid) { }
49e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)    virtual void removeBlobDataRef(const WebString& uuid) { }
50e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)    virtual void registerPublicBlobURL(const WebURL&, const WebString& uuid) { }
51e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)    virtual void revokePublicBlobURL(const WebURL&) { }
52f5e4ad553afbc08dd2e729bb77e937a9a94d5827Torne (Richard Coles)
53591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch    // Registers a stream URL referring to a stream with the specified media
54591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch    // type.
551e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)    virtual void registerStreamURL(const WebURL&, const WebString&) { BLINK_ASSERT_NOT_REACHED(); }
56521d96ec04ace82590870fb04353ec4f82bb150fTorne (Richard Coles)
57f5e4ad553afbc08dd2e729bb77e937a9a94d5827Torne (Richard Coles)    // Registers a stream URL referring to the stream identified by the
58f5e4ad553afbc08dd2e729bb77e937a9a94d5827Torne (Richard Coles)    // specified srcURL.
591e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)    virtual void registerStreamURL(const WebURL&, const WebURL& srcURL) { BLINK_ASSERT_NOT_REACHED(); };
6093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
61521d96ec04ace82590870fb04353ec4f82bb150fTorne (Richard Coles)    // Add data to the stream referred by the URL.
621e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)    virtual void addDataToStream(const WebURL&, WebThreadSafeData&) { BLINK_ASSERT_NOT_REACHED(); }
63521d96ec04ace82590870fb04353ec4f82bb150fTorne (Richard Coles)
64c0e19a689c8ac22cdc96b291a8d33a5d3b0b34a4Torne (Richard Coles)    // Tell the registry that construction of this stream has completed
65c0e19a689c8ac22cdc96b291a8d33a5d3b0b34a4Torne (Richard Coles)    // successfully and so it won't receive any more data.
661e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)    virtual void finalizeStream(const WebURL&) { BLINK_ASSERT_NOT_REACHED(); }
67521d96ec04ace82590870fb04353ec4f82bb150fTorne (Richard Coles)
68c0e19a689c8ac22cdc96b291a8d33a5d3b0b34a4Torne (Richard Coles)    // Tell the registry that construction of this stream has been aborted and
69c0e19a689c8ac22cdc96b291a8d33a5d3b0b34a4Torne (Richard Coles)    // so it won't receive any more data.
701e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)    virtual void abortStream(const WebURL&) { BLINK_ASSERT_NOT_REACHED(); }
71c0e19a689c8ac22cdc96b291a8d33a5d3b0b34a4Torne (Richard Coles)
72f5e4ad553afbc08dd2e729bb77e937a9a94d5827Torne (Richard Coles)    // Unregisters a stream referred by the URL.
731e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)    virtual void unregisterStreamURL(const WebURL&) { BLINK_ASSERT_NOT_REACHED(); }
745c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)};
755c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
7651b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)} // namespace blink
775c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
7893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#endif // WebBlobRegistry_h
79