blob: 03316b79b197fbf912abc8a5a8a5f4a02eb1686f [file] [log] [blame]
[email protected]f7817822009-09-24 05:11:581// Copyright (c) 2009 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_FRAME_URLMON_UPLOAD_DATA_STREAM_H_
6#define CHROME_FRAME_URLMON_UPLOAD_DATA_STREAM_H_
7
8#include <urlmon.h>
9#include <atlbase.h>
10#include <atlcom.h>
11
12#include "base/logging.h"
13#include "base/ref_counted.h"
[email protected]97965e12010-04-09 00:51:1014#include "chrome_frame/stream_impl.h"
[email protected]f7817822009-09-24 05:11:5815#include "net/base/upload_data.h"
16#include "net/base/upload_data_stream.h"
17
18// Provides an IStream interface to the very different UploadDataStream
19// implementation.
[email protected]c5a83282009-10-29 03:57:2320class UrlmonUploadDataStream : public CComObjectRootEx<CComMultiThreadModel>,
[email protected]97965e12010-04-09 00:51:1021 public StreamImpl {
[email protected]f7817822009-09-24 05:11:5822 public:
23 UrlmonUploadDataStream() {}
24
25 BEGIN_COM_MAP(UrlmonUploadDataStream)
26 COM_INTERFACE_ENTRY(ISequentialStream)
27 COM_INTERFACE_ENTRY(IStream)
28 END_COM_MAP()
29
30 void Initialize(net::UploadData* upload_data);
31
32 // Partial implementation of IStream.
33 STDMETHOD(Read)(void* pv, ULONG cb, ULONG* read);
[email protected]f7817822009-09-24 05:11:5834 STDMETHOD(Seek)(LARGE_INTEGER move, DWORD origin, ULARGE_INTEGER* new_pos);
[email protected]f7817822009-09-24 05:11:5835 STDMETHOD(Stat)(STATSTG *pstatstg, DWORD grfStatFlag);
36
[email protected]f7817822009-09-24 05:11:5837 private:
38 scoped_refptr<net::UploadData> upload_data_;
39 scoped_ptr<net::UploadDataStream> request_body_stream_;
40};
41
42#endif // CHROME_FRAME_URLMON_UPLOAD_DATA_STREAM_H_