OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 // Implementation of ChromeProtocol |
| 6 #include "chrome_frame/chrome_protocol.h" |
| 7 |
| 8 #include "base/logging.h" |
| 9 |
| 10 static const wchar_t* kChromeMimeType = L"application/chromepage"; |
| 11 |
| 12 // ChromeProtocol |
| 13 |
| 14 // Starts the class associated with the asynchronous pluggable protocol. |
| 15 STDMETHODIMP ChromeProtocol::Start(LPCWSTR url, |
| 16 IInternetProtocolSink* prot_sink, |
| 17 IInternetBindInfo* bind_info, |
| 18 DWORD flags, |
| 19 DWORD reserved) { |
| 20 DLOG(INFO) << __FUNCTION__ << ": URL = " << url; |
| 21 prot_sink->ReportProgress(BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE, |
| 22 kChromeMimeType); |
| 23 prot_sink->ReportData( |
| 24 BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION | |
| 25 BSCF_DATAFULLYAVAILABLE, |
| 26 0, |
| 27 0); |
| 28 return S_OK; |
| 29 } |
| 30 |
| 31 // Allows the pluggable protocol handler to continue processing data on the |
| 32 // apartment (or user interface) thread. This method is called in response |
| 33 // to a call to IInternetProtocolSink::Switch. |
| 34 STDMETHODIMP ChromeProtocol::Continue(PROTOCOLDATA* protocol_data) { |
| 35 DLOG(INFO) << __FUNCTION__; |
| 36 return S_OK; |
| 37 } |
| 38 |
| 39 // Aborts an operation in progress. |
| 40 STDMETHODIMP ChromeProtocol::Abort(HRESULT reason, DWORD options) { |
| 41 DLOG(INFO) << __FUNCTION__; |
| 42 return S_OK; |
| 43 } |
| 44 |
| 45 STDMETHODIMP ChromeProtocol::Terminate(DWORD options) { |
| 46 DLOG(INFO) << __FUNCTION__; |
| 47 return S_OK; |
| 48 } |
| 49 |
| 50 STDMETHODIMP ChromeProtocol::Suspend() { |
| 51 return E_NOTIMPL; |
| 52 } |
| 53 STDMETHODIMP ChromeProtocol::Resume() { |
| 54 return E_NOTIMPL; |
| 55 } |
| 56 |
| 57 // Reads data retrieved by the pluggable protocol handler. |
| 58 STDMETHODIMP ChromeProtocol::Read(void* buffer, |
| 59 ULONG buffer_size_in_bytes, |
| 60 ULONG* bytes_read) { |
| 61 DLOG(INFO) << __FUNCTION__; |
| 62 return S_FALSE; |
| 63 } |
| 64 |
| 65 // Moves the current seek offset. |
| 66 STDMETHODIMP ChromeProtocol::Seek(LARGE_INTEGER move_by, |
| 67 DWORD origin, |
| 68 ULARGE_INTEGER* new_position) { |
| 69 DLOG(INFO) << __FUNCTION__; |
| 70 return E_NOTIMPL; |
| 71 } |
| 72 |
| 73 // Locks the request so that IInternetProtocolRoot::Terminate () |
| 74 // can be called and the remaining data can be read. |
| 75 STDMETHODIMP ChromeProtocol::LockRequest(DWORD options) { |
| 76 DLOG(INFO) << __FUNCTION__; |
| 77 return S_OK; |
| 78 } |
| 79 |
| 80 // Frees any resources associated with a lock. Called only if |
| 81 // IInternetProtocol::LockRequest () was called. |
| 82 STDMETHODIMP ChromeProtocol::UnlockRequest() { |
| 83 DLOG(INFO) << __FUNCTION__; |
| 84 return S_OK; |
| 85 } |
OLD | NEW |