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

Side by Side Diff: chrome_frame/protocol_sink_wrap.cc

Issue 12395021: Fix a crash seen in ChromeFrame when opening a non CF top level tab from a CF page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <htiframe.h> 5 #include <htiframe.h>
6 #include <mshtml.h> 6 #include <mshtml.h>
7 7
8 #include "chrome_frame/protocol_sink_wrap.h" 8 #include "chrome_frame/protocol_sink_wrap.h"
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 // We are just pass through at this point, avoid false positive crash 864 // We are just pass through at this point, avoid false positive crash
865 // reports. 865 // reports.
866 ExceptionBarrierReportOnlyModule barrier; 866 ExceptionBarrierReportOnlyModule barrier;
867 return orig_req(protocol, hr, options); 867 return orig_req(protocol, hr, options);
868 } 868 }
869 869
870 STDMETHODIMP Hook_Terminate(InternetProtocol_Terminate_Fn orig_req, 870 STDMETHODIMP Hook_Terminate(InternetProtocol_Terminate_Fn orig_req,
871 IInternetProtocol* protocol, 871 IInternetProtocol* protocol,
872 DWORD options) { 872 DWORD options) {
873 scoped_refptr<ProtData> prot_data = ProtData::DataFromProtocol(protocol); 873 scoped_refptr<ProtData> prot_data = ProtData::DataFromProtocol(protocol);
874 // TODO(ananta/robertshield) 874 // We should not be invalidating the cached protocol data in the following
875 // Write a test for this bug http://crbug.com/178421 875 // cases:-
876 if (prot_data && !IsChrome(prot_data->renderer_type())) 876 // 1. Pages which are switching into ChromeFrame.
877 // When IE switches into ChromeFrame, we report the Chrome mime type as
878 // the handler for the page. This results in urlmon terminating the
879 // protocol. When Chrome attempts to read the data we need to report the
880 // cached data back to Chrome.
881 // 2. For the attach external tab requests which are temporary navigations
882 // to ensure that a top level URL is opened in IE from ChromeFrame.
883 // We rely on the mapping to identify these requests as attach tab
884 // requests. This mapping is referred to in the
885 // IInternetProtocol::LockRequest/IInternetProtocol::UnlockRequest
886 // intercepts. Invalidating the mapping after LockRequest is called and
887 // before UnlockRequest causes IE to crash.
robertshield 2013/03/04 19:56:13 Awesome comment, thanks!
888 if (prot_data && !IsChrome(prot_data->renderer_type()) &&
889 !prot_data->is_attach_external_tab_request())
877 prot_data->Invalidate(); 890 prot_data->Invalidate();
878 891
879 // We are just pass through at this point, avoid false positive crash 892 // We are just pass through at this point, avoid false positive crash
880 // reports. 893 // reports.
881 ExceptionBarrierReportOnlyModule barrier; 894 ExceptionBarrierReportOnlyModule barrier;
882 return orig_req(protocol, options); 895 return orig_req(protocol, options);
883 } 896 }
884 897
885 // Patching / Hooking code. 898 // Patching / Hooking code.
886 class FakeProtocol : public CComObjectRootEx<CComSingleThreadModel>, 899 class FakeProtocol : public CComObjectRootEx<CComSingleThreadModel>,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 // Explicit release, otherwise ~CComObjectStackEx will complain about 997 // Explicit release, otherwise ~CComObjectStackEx will complain about
985 // outstanding reference to us, because it runs before ~FakeProtocol 998 // outstanding reference to us, because it runs before ~FakeProtocol
986 prot.transaction_.Release(); 999 prot.transaction_.Release();
987 } 1000 }
988 } 1001 }
989 1002
990 void TransactionHooks::RevertHooks() { 1003 void TransactionHooks::RevertHooks() {
991 vtable_patch::UnpatchInterfaceMethods(CTransaction_PatchInfo); 1004 vtable_patch::UnpatchInterfaceMethods(CTransaction_PatchInfo);
992 vtable_patch::UnpatchInterfaceMethods(CTransaction2_PatchInfo); 1005 vtable_patch::UnpatchInterfaceMethods(CTransaction2_PatchInfo);
993 } 1006 }
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