Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(787)

Side by Side Diff: chrome_frame/urlmon_url_request.h

Issue 386008: ChromeFrame HTTP requests would randomly fail if we navigated to multiple HTT... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome_frame/chrome_frame_activex_base.h ('k') | chrome_frame/urlmon_url_request.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CHROME_FRAME_URLMON_URL_REQUEST_H_ 5 #ifndef CHROME_FRAME_URLMON_URL_REQUEST_H_
6 #define CHROME_FRAME_URLMON_URL_REQUEST_H_ 6 #define CHROME_FRAME_URLMON_URL_REQUEST_H_
7 7
8 #include <urlmon.h> 8 #include <urlmon.h>
9 #include <atlbase.h> 9 #include <atlbase.h>
10 #include <atlcom.h> 10 #include <atlcom.h>
11 #include <atlwin.h>
11 12
12 #include <algorithm> 13 #include <algorithm>
13 14
14 #include "base/lock.h" 15 #include "base/lock.h"
15 #include "base/platform_thread.h" 16 #include "base/platform_thread.h"
16 #include "base/thread.h" 17 #include "base/thread.h"
17 #include "base/scoped_comptr_win.h" 18 #include "base/scoped_comptr_win.h"
18 #include "chrome_frame/plugin_url_request.h" 19 #include "chrome_frame/plugin_url_request.h"
19 #include "chrome_frame/chrome_frame_delegate.h" 20 #include "chrome_frame/chrome_frame_delegate.h"
20 21
21 #include "net/base/net_errors.h" 22 #include "net/base/net_errors.h"
22 #include "net/base/upload_data.h" 23 #include "net/base/upload_data.h"
23 24
24 class UrlmonUrlRequest 25 class UrlmonUrlRequest
25 : public CComObjectRootEx<CComSingleThreadModel>, 26 : public CComObjectRootEx<CComSingleThreadModel>,
26 public PluginUrlRequest, 27 public PluginUrlRequest,
27 public IServiceProviderImpl<UrlmonUrlRequest>, 28 public IServiceProviderImpl<UrlmonUrlRequest>,
28 public IBindStatusCallback, 29 public IBindStatusCallback,
29 public IHttpNegotiate, 30 public IHttpNegotiate,
30 public IAuthenticate, 31 public IAuthenticate,
31 public IHttpSecurity { 32 public IHttpSecurity,
33 public CWindowImpl<UrlmonUrlRequest>,
34 public TaskMarshallerThroughWindowsMessages<UrlmonUrlRequest> {
32 public: 35 public:
36 typedef TaskMarshallerThroughWindowsMessages<UrlmonUrlRequest>
37 TaskMarshaller;
38
33 UrlmonUrlRequest(); 39 UrlmonUrlRequest();
34 ~UrlmonUrlRequest(); 40 ~UrlmonUrlRequest();
35 41
36 BEGIN_COM_MAP(UrlmonUrlRequest) 42 BEGIN_COM_MAP(UrlmonUrlRequest)
37 COM_INTERFACE_ENTRY(IHttpNegotiate) 43 COM_INTERFACE_ENTRY(IHttpNegotiate)
38 COM_INTERFACE_ENTRY(IServiceProvider) 44 COM_INTERFACE_ENTRY(IServiceProvider)
39 COM_INTERFACE_ENTRY(IBindStatusCallback) 45 COM_INTERFACE_ENTRY(IBindStatusCallback)
40 COM_INTERFACE_ENTRY(IWindowForBindingUI) 46 COM_INTERFACE_ENTRY(IWindowForBindingUI)
41 COM_INTERFACE_ENTRY(IAuthenticate) 47 COM_INTERFACE_ENTRY(IAuthenticate)
42 COM_INTERFACE_ENTRY(IHttpSecurity) 48 COM_INTERFACE_ENTRY(IHttpSecurity)
43 END_COM_MAP() 49 END_COM_MAP()
44 50
45 BEGIN_SERVICE_MAP(UrlmonUrlRequest) 51 BEGIN_SERVICE_MAP(UrlmonUrlRequest)
46 SERVICE_ENTRY(IID_IHttpNegotiate); 52 SERVICE_ENTRY(IID_IHttpNegotiate);
47 END_SERVICE_MAP() 53 END_SERVICE_MAP()
48 54
55 BEGIN_MSG_MAP(UrlmonUrlRequest)
56 CHAIN_MSG_MAP(TaskMarshaller)
57 END_MSG_MAP()
58
49 // PluginUrlRequest implementation 59 // PluginUrlRequest implementation
50 virtual bool Start(); 60 virtual bool Start();
51 virtual void Stop(); 61 virtual void Stop();
52 virtual bool Read(int bytes_to_read); 62 virtual bool Read(int bytes_to_read);
53 63
54 // IBindStatusCallback implementation 64 // IBindStatusCallback implementation
55 STDMETHOD(OnStartBinding)(DWORD reserved, IBinding* binding); 65 STDMETHOD(OnStartBinding)(DWORD reserved, IBinding* binding);
56 STDMETHOD(GetPriority)(LONG* priority); 66 STDMETHOD(GetPriority)(LONG* priority);
57 STDMETHOD(OnLowResource)(DWORD reserved); 67 STDMETHOD(OnLowResource)(DWORD reserved);
58 STDMETHOD(OnProgress)(ULONG progress, ULONG max_progress, 68 STDMETHOD(OnProgress)(ULONG progress, ULONG max_progress,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // Needed to support PostTask. 102 // Needed to support PostTask.
93 static bool ImplementsThreadSafeReferenceCounting() { 103 static bool ImplementsThreadSafeReferenceCounting() {
94 return true; 104 return true;
95 } 105 }
96 106
97 // URL requests are handled on this thread. 107 // URL requests are handled on this thread.
98 void set_worker_thread(base::Thread* worker_thread) { 108 void set_worker_thread(base::Thread* worker_thread) {
99 worker_thread_ = worker_thread; 109 worker_thread_ = worker_thread;
100 } 110 }
101 111
102 void set_task_marshaller(TaskMarshaller* task_marshaller) { 112 virtual void OnFinalMessage(HWND window);
103 task_marshaller_ = task_marshaller;
104 }
105 113
106 protected: 114 protected:
107 // The following functions issue and handle Urlmon requests on the dedicated 115 // The following functions issue and handle Urlmon requests on the dedicated
108 // Urlmon thread. 116 // Urlmon thread.
109 void StartAsync(); 117 void StartAsync();
110 void StopAsync(); 118 void StopAsync();
111 void ReadAsync(int bytes_to_read); 119 void ReadAsync(int bytes_to_read);
112 120
113 static const size_t kCopyChunkSize = 32 * 1024; 121 static const size_t kCopyChunkSize = 32 * 1024;
114 // URL requests are handled on this thread. 122 // URL requests are handled on this thread.
115 base::Thread* worker_thread_; 123 base::Thread* worker_thread_;
116 124
117 TaskMarshaller* task_marshaller_;
118
119 // A fake stream class to make it easier to copy received data using 125 // A fake stream class to make it easier to copy received data using
120 // IStream::CopyTo instead of allocating temporary buffers and keeping 126 // IStream::CopyTo instead of allocating temporary buffers and keeping
121 // track of data copied so far. 127 // track of data copied so far.
122 class SendStream 128 class SendStream
123 : public CComObjectRoot, 129 : public CComObjectRoot,
124 public IStream { 130 public IStream {
125 public: 131 public:
126 SendStream() { 132 SendStream() {
127 } 133 }
128 134
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 URLRequestStatus status_; 253 URLRequestStatus status_;
248 254
249 PlatformThreadId thread_; 255 PlatformThreadId thread_;
250 static int instance_count_; 256 static int instance_count_;
251 HWND parent_window_; 257 HWND parent_window_;
252 DISALLOW_COPY_AND_ASSIGN(UrlmonUrlRequest); 258 DISALLOW_COPY_AND_ASSIGN(UrlmonUrlRequest);
253 }; 259 };
254 260
255 #endif // CHROME_FRAME_URLMON_URL_REQUEST_H_ 261 #endif // CHROME_FRAME_URLMON_URL_REQUEST_H_
256 262
OLDNEW
« no previous file with comments | « chrome_frame/chrome_frame_activex_base.h ('k') | chrome_frame/urlmon_url_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698