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

Side by Side Diff: chrome_frame/bho.cc

Issue 822005: Fix a crash reported in ChromeFrame on the crash server, which occurs because... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months 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 | « no previous file | no next file » | 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 #include "chrome_frame/bho.h" 5 #include "chrome_frame/bho.h"
6 6
7 #include <shlguid.h> 7 #include <shlguid.h>
8 #include <shobjidl.h> 8 #include <shobjidl.h>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 bho_current_thread_instance_.Pointer()->Set(NULL); 87 bho_current_thread_instance_.Pointer()->Set(NULL);
88 Release(); 88 Release();
89 } 89 }
90 90
91 return IObjectWithSiteImpl<Bho>::SetSite(site); 91 return IObjectWithSiteImpl<Bho>::SetSite(site);
92 } 92 }
93 93
94 STDMETHODIMP Bho::BeforeNavigate2(IDispatch* dispatch, VARIANT* url, 94 STDMETHODIMP Bho::BeforeNavigate2(IDispatch* dispatch, VARIANT* url,
95 VARIANT* flags, VARIANT* target_frame_name, VARIANT* post_data, 95 VARIANT* flags, VARIANT* target_frame_name, VARIANT* post_data,
96 VARIANT* headers, VARIANT_BOOL* cancel) { 96 VARIANT* headers, VARIANT_BOOL* cancel) {
97 if (!url || url->vt != VT_BSTR || url->bstrVal == NULL) {
98 DLOG(WARNING) << "Invalid URL passed in";
99 return S_OK;
100 }
101
97 ScopedComPtr<IWebBrowser2> web_browser2; 102 ScopedComPtr<IWebBrowser2> web_browser2;
98 if (dispatch) 103 if (dispatch)
99 web_browser2.QueryFrom(dispatch); 104 web_browser2.QueryFrom(dispatch);
100 105
101 if (!web_browser2 || url->vt != VT_BSTR) { 106 if (!web_browser2) {
102 NOTREACHED() << "Can't find WebBrowser2 with given dispatch"; 107 NOTREACHED() << "Can't find WebBrowser2 with given dispatch";
103 } else { 108 return S_OK;
104 DLOG(INFO) << "BeforeNavigate2: " << url->bstrVal;
105 ScopedComPtr<IBrowserService> browser_service;
106 DoQueryService(SID_SShellBrowser, web_browser2, browser_service.Receive());
107 if (!browser_service || !CheckForCFNavigation(browser_service, false)) {
108 referrer_.clear();
109 }
110 url_ = url->bstrVal;
111 ProcessOptInUrls(web_browser2, url->bstrVal);
112 } 109 }
113 110
111 DLOG(INFO) << "BeforeNavigate2: " << url->bstrVal;
112 ScopedComPtr<IBrowserService> browser_service;
113 DoQueryService(SID_SShellBrowser, web_browser2, browser_service.Receive());
114 if (!browser_service || !CheckForCFNavigation(browser_service, false)) {
115 referrer_.clear();
116 }
117 url_ = url->bstrVal;
118 ProcessOptInUrls(web_browser2, url->bstrVal);
114 return S_OK; 119 return S_OK;
115 } 120 }
116 121
117 HRESULT Bho::NavigateToCurrentUrlInCF(IBrowserService* browser) { 122 HRESULT Bho::NavigateToCurrentUrlInCF(IBrowserService* browser) {
118 DCHECK(browser); 123 DCHECK(browser);
119 MarkBrowserOnThreadForCFNavigation(browser); 124 MarkBrowserOnThreadForCFNavigation(browser);
120 ScopedComPtr<IBindCtx> bind_context; 125 ScopedComPtr<IBindCtx> bind_context;
121 ScopedComPtr<IMoniker> moniker; 126 ScopedComPtr<IMoniker> moniker;
122 HRESULT hr = ::CreateBindCtx(0, bind_context.Receive()); 127 HRESULT hr = ::CreateBindCtx(0, bind_context.Receive());
123 DCHECK(bind_context); 128 DCHECK(bind_context);
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 ProtocolSinkWrap::UnpatchProtocolHandlers(); 390 ProtocolSinkWrap::UnpatchProtocolHandlers();
386 } else if (state_ == PATCH_IBROWSER) { 391 } else if (state_ == PATCH_IBROWSER) {
387 vtable_patch::UnpatchInterfaceMethods(IBrowserService_PatchInfo); 392 vtable_patch::UnpatchInterfaceMethods(IBrowserService_PatchInfo);
388 } 393 }
389 394
390 HttpNegotiatePatch::Uninitialize(); 395 HttpNegotiatePatch::Uninitialize();
391 396
392 state_ = UNKNOWN; 397 state_ = UNKNOWN;
393 } 398 }
394 399
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698