OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_FRAME_BIND_CONTEXT_INFO_H_ | 5 #ifndef CHROME_FRAME_BIND_CONTEXT_INFO_H_ |
6 #define CHROME_FRAME_BIND_CONTEXT_INFO_H_ | 6 #define CHROME_FRAME_BIND_CONTEXT_INFO_H_ |
7 | 7 |
8 #include <atlbase.h> | 8 #include <atlbase.h> |
9 #include <atlcom.h> | 9 #include <atlcom.h> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 bool is_switching() const { | 58 bool is_switching() const { |
59 return is_switching_; | 59 return is_switching_; |
60 } | 60 } |
61 | 61 |
62 void SetToSwitch(IStream* cache); | 62 void SetToSwitch(IStream* cache); |
63 | 63 |
64 IStream* cache() { | 64 IStream* cache() { |
65 return cache_; | 65 return cache_; |
66 } | 66 } |
67 | 67 |
68 // Accept a const wchar_t* to ensure that we don't have a reference | |
69 // to someone else's buffer. | |
70 void set_url(const wchar_t* url) { | |
71 DCHECK(url); | |
72 if (url) { | |
73 url_ = url; | |
74 } else { | |
75 url_.clear(); | |
76 } | |
77 } | |
78 | |
79 const std::wstring& url() const { | |
80 return url_; | |
81 } | |
82 | |
83 void set_prot_data(ProtData* data) { | 68 void set_prot_data(ProtData* data) { |
84 prot_data_ = data; | 69 prot_data_ = data; |
85 } | 70 } |
86 | 71 |
87 scoped_refptr<ProtData> get_prot_data() { | 72 scoped_refptr<ProtData> get_prot_data() { |
88 return prot_data_; | 73 return prot_data_; |
89 } | 74 } |
90 | 75 |
91 bool has_prot_data() const { | 76 bool has_prot_data() const { |
92 return prot_data_.get() != NULL; | 77 return prot_data_.get() != NULL; |
93 } | 78 } |
94 | 79 |
95 void set_protocol(IInternetProtocol* protocol) { | 80 void set_protocol(IInternetProtocol* protocol) { |
96 protocol_ = protocol; | 81 protocol_ = protocol; |
97 } | 82 } |
98 | 83 |
99 IInternetProtocol* protocol() { | 84 IInternetProtocol* protocol() { |
100 return protocol_.get(); | 85 return protocol_.get(); |
101 } | 86 } |
102 | 87 |
88 // Returns the url being navigated to. We retrieve the url from the ProtData | |
89 // instance which wraps the underlying protocol sink. | |
90 std::wstring GetUrl(); | |
91 | |
103 protected: | 92 protected: |
104 STDMETHOD(GetCppObject)(void** me) { | 93 STDMETHOD(GetCppObject)(void** me) { |
105 DCHECK(me); | 94 DCHECK(me); |
106 AddRef(); | 95 AddRef(); |
107 *me = static_cast<BindContextInfo*>(this); | 96 *me = static_cast<BindContextInfo*>(this); |
108 return S_OK; | 97 return S_OK; |
109 } | 98 } |
110 | 99 |
111 HRESULT Initialize(IBindCtx* bind_ctx); | 100 HRESULT Initialize(IBindCtx* bind_ctx); |
112 | 101 |
113 private: | 102 private: |
114 base::win::ScopedComPtr<IStream> cache_; | 103 base::win::ScopedComPtr<IStream> cache_; |
115 bool no_cache_; | 104 bool no_cache_; |
116 bool chrome_request_; | 105 bool chrome_request_; |
117 bool is_switching_; | 106 bool is_switching_; |
118 std::wstring url_; | 107 std::wstring url_; |
amit
2011/02/22 23:12:05
OK to remove this now?
ananta
2011/02/22 23:15:49
Done.
| |
119 base::win::ScopedComPtr<IUnknown> ftm_; | 108 base::win::ScopedComPtr<IUnknown> ftm_; |
120 scoped_refptr<ProtData> prot_data_; | 109 scoped_refptr<ProtData> prot_data_; |
121 ScopedComPtr<IInternetProtocol> protocol_; | 110 ScopedComPtr<IInternetProtocol> protocol_; |
122 | 111 |
123 DISALLOW_COPY_AND_ASSIGN(BindContextInfo); | 112 DISALLOW_COPY_AND_ASSIGN(BindContextInfo); |
124 }; | 113 }; |
125 | 114 |
126 #endif // CHROME_FRAME_BIND_CONTEXT_INFO_H_ | 115 #endif // CHROME_FRAME_BIND_CONTEXT_INFO_H_ |
OLD | NEW |