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