1 // 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.
5 // Implementation of ChromeProtocol
6 #include "chrome_frame/chrome_protocol.h"
8 #include "base/logging.h"
9 #include "chrome_frame/utils.h"
13 // Starts the class associated with the asynchronous pluggable protocol.
14 STDMETHODIMP
ChromeProtocol::Start(LPCWSTR url
,
15 IInternetProtocolSink
* prot_sink
,
16 IInternetBindInfo
* bind_info
,
19 DVLOG(1) << __FUNCTION__
<< ": URL = " << url
;
20 prot_sink
->ReportProgress(BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE
,
22 prot_sink
->ReportData(
23 BSCF_FIRSTDATANOTIFICATION
| BSCF_LASTDATANOTIFICATION
|
24 BSCF_DATAFULLYAVAILABLE
,
30 // Allows the pluggable protocol handler to continue processing data on the
31 // apartment (or user interface) thread. This method is called in response
32 // to a call to IInternetProtocolSink::Switch.
33 STDMETHODIMP
ChromeProtocol::Continue(PROTOCOLDATA
* protocol_data
) {
34 DVLOG(1) << __FUNCTION__
;
38 // Aborts an operation in progress.
39 STDMETHODIMP
ChromeProtocol::Abort(HRESULT reason
, DWORD options
) {
40 DVLOG(1) << __FUNCTION__
;
44 STDMETHODIMP
ChromeProtocol::Terminate(DWORD options
) {
45 DVLOG(1) << __FUNCTION__
;
49 STDMETHODIMP
ChromeProtocol::Suspend() {
52 STDMETHODIMP
ChromeProtocol::Resume() {
56 // Reads data retrieved by the pluggable protocol handler.
57 STDMETHODIMP
ChromeProtocol::Read(void* buffer
,
58 ULONG buffer_size_in_bytes
,
60 DVLOG(1) << __FUNCTION__
;
64 // Moves the current seek offset.
65 STDMETHODIMP
ChromeProtocol::Seek(LARGE_INTEGER move_by
,
67 ULARGE_INTEGER
* new_position
) {
68 DVLOG(1) << __FUNCTION__
;
72 // Locks the request so that IInternetProtocolRoot::Terminate ()
73 // can be called and the remaining data can be read.
74 STDMETHODIMP
ChromeProtocol::LockRequest(DWORD options
) {
75 DVLOG(1) << __FUNCTION__
;
79 // Frees any resources associated with a lock. Called only if
80 // IInternetProtocol::LockRequest () was called.
81 STDMETHODIMP
ChromeProtocol::UnlockRequest() {
82 DVLOG(1) << __FUNCTION__
;