| Index: content/browser/streams/stream_handle_impl.h
|
| diff --git a/content/browser/streams/stream_handle_impl.h b/content/browser/streams/stream_handle_impl.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..edfe52a16341a373449dfa46e62459a13721accc
|
| --- /dev/null
|
| +++ b/content/browser/streams/stream_handle_impl.h
|
| @@ -0,0 +1,47 @@
|
| +// Copyright (c) 2013 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_BROWSER_STREAMS_STREAM_HANDLE_IMPL_H_
|
| +#define CONTENT_BROWSER_STREAMS_STREAM_HANDLE_IMPL_H_
|
| +
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "base/message_loop_proxy.h"
|
| +#include "base/synchronization/lock.h"
|
| +#include "content/public/browser/stream_handle.h"
|
| +
|
| +namespace content {
|
| +
|
| +class Stream;
|
| +
|
| +class StreamHandleImpl : public StreamHandle {
|
| + public:
|
| + StreamHandleImpl(const base::WeakPtr<Stream>& stream,
|
| + const GURL& original_url,
|
| + const std::string& mime_type);
|
| + virtual ~StreamHandleImpl();
|
| +
|
| + void OnStreamConsumed();
|
| +
|
| + private:
|
| + // StreamHandle overrides
|
| + virtual const GURL& GetURL() OVERRIDE;
|
| + virtual const GURL& GetOriginalURL() OVERRIDE;
|
| + virtual const std::string& GetMimeType() OVERRIDE;
|
| + virtual void NotifyWhenConsumed(const base::Closure& callback) OVERRIDE;
|
| +
|
| + base::WeakPtr<Stream> stream_;
|
| + GURL url_;
|
| + GURL original_url_;
|
| + std::string mime_type_;
|
| + base::MessageLoopProxy* stream_message_loop_;
|
| + base::MessageLoopProxy* callback_message_loop_;
|
| + base::Closure callback_;
|
| + // callback_lock_ protects callback_message_loop_ and callback_.
|
| + base::Lock callback_lock_;
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_BROWSER_STREAMS_STREAM_HANDLE_IMPL_H_
|
| +
|
|
|