summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_protocol.cc
blob: 42683bcf0bcf55ed092c023cab79b1b5282b28e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Copyright (c) 2009 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.

// Implementation of ChromeProtocol
#include "chrome_frame/chrome_protocol.h"

#include "base/logging.h"
#include "chrome_frame/utils.h"

// ChromeProtocol

// Starts the class associated with the asynchronous pluggable protocol.
STDMETHODIMP ChromeProtocol::Start(LPCWSTR url,
                                   IInternetProtocolSink* prot_sink,
                                   IInternetBindInfo* bind_info,
                                   DWORD flags,
                                   DWORD reserved) {
  DVLOG(1) << __FUNCTION__ << ": URL = " << url;
  prot_sink->ReportProgress(BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE,
                            kChromeMimeType);
  prot_sink->ReportData(
      BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION |
      BSCF_DATAFULLYAVAILABLE,
      0,
      0);
  return S_OK;
}

// Allows the pluggable protocol handler to continue processing data on the
// apartment (or user interface) thread. This method is called in response
// to a call to IInternetProtocolSink::Switch.
STDMETHODIMP ChromeProtocol::Continue(PROTOCOLDATA* protocol_data) {
  DVLOG(1) << __FUNCTION__;
  return S_OK;
}

// Aborts an operation in progress.
STDMETHODIMP ChromeProtocol::Abort(HRESULT reason, DWORD options) {
  DVLOG(1) << __FUNCTION__;
  return S_OK;
}

STDMETHODIMP ChromeProtocol::Terminate(DWORD options) {
  DVLOG(1) << __FUNCTION__;
  return S_OK;
}

STDMETHODIMP ChromeProtocol::Suspend() {
  return E_NOTIMPL;
}
STDMETHODIMP ChromeProtocol::Resume() {
  return E_NOTIMPL;
}

// Reads data retrieved by the pluggable protocol handler.
STDMETHODIMP ChromeProtocol::Read(void* buffer,
                                  ULONG buffer_size_in_bytes,
                                  ULONG* bytes_read) {
  DVLOG(1) << __FUNCTION__;
  return S_FALSE;
}

// Moves the current seek offset.
STDMETHODIMP ChromeProtocol::Seek(LARGE_INTEGER move_by,
                              DWORD origin,
                              ULARGE_INTEGER* new_position) {
  DVLOG(1) << __FUNCTION__;
  return E_NOTIMPL;
}

// Locks the request so that IInternetProtocolRoot::Terminate ()
// can be called and the remaining data can be read.
STDMETHODIMP ChromeProtocol::LockRequest(DWORD options) {
  DVLOG(1) << __FUNCTION__;
  return S_OK;
}

// Frees any resources associated with a lock. Called only if
// IInternetProtocol::LockRequest () was called.
STDMETHODIMP ChromeProtocol::UnlockRequest() {
  DVLOG(1) << __FUNCTION__;
  return S_OK;
}