OLD | NEW |
---|---|
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 Loading... | |
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 if (prot_data && !IsChrome(prot_data->renderer_type()) && |
robertshield
2013/03/04 19:40:39
Please could you add a fairly detailed comment exp
ananta
2013/03/04 19:52:50
Done.
| |
875 // Write a test for this bug http://crbug.com/178421 | 875 !prot_data->is_attach_external_tab_request()) |
876 if (prot_data && !IsChrome(prot_data->renderer_type())) | |
877 prot_data->Invalidate(); | 876 prot_data->Invalidate(); |
878 | 877 |
879 // We are just pass through at this point, avoid false positive crash | 878 // We are just pass through at this point, avoid false positive crash |
880 // reports. | 879 // reports. |
881 ExceptionBarrierReportOnlyModule barrier; | 880 ExceptionBarrierReportOnlyModule barrier; |
882 return orig_req(protocol, options); | 881 return orig_req(protocol, options); |
883 } | 882 } |
884 | 883 |
885 // Patching / Hooking code. | 884 // Patching / Hooking code. |
886 class FakeProtocol : public CComObjectRootEx<CComSingleThreadModel>, | 885 class FakeProtocol : public CComObjectRootEx<CComSingleThreadModel>, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
984 // Explicit release, otherwise ~CComObjectStackEx will complain about | 983 // Explicit release, otherwise ~CComObjectStackEx will complain about |
985 // outstanding reference to us, because it runs before ~FakeProtocol | 984 // outstanding reference to us, because it runs before ~FakeProtocol |
986 prot.transaction_.Release(); | 985 prot.transaction_.Release(); |
987 } | 986 } |
988 } | 987 } |
989 | 988 |
990 void TransactionHooks::RevertHooks() { | 989 void TransactionHooks::RevertHooks() { |
991 vtable_patch::UnpatchInterfaceMethods(CTransaction_PatchInfo); | 990 vtable_patch::UnpatchInterfaceMethods(CTransaction_PatchInfo); |
992 vtable_patch::UnpatchInterfaceMethods(CTransaction2_PatchInfo); | 991 vtable_patch::UnpatchInterfaceMethods(CTransaction2_PatchInfo); |
993 } | 992 } |
OLD | NEW |