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

Side by Side Diff: chrome_frame/bho.cc

Issue 2824057: Chromeframe user-agent without need of HttpNegotiate patch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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 | chrome_frame/chrome_active_document.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 #include "chrome_frame/bho.h" 5 #include "chrome_frame/bho.h"
6 6
7 #include <shlguid.h> 7 #include <shlguid.h>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 bool ret = false; 335 bool ret = false;
336 336
337 _pAtlModule->m_csStaticDataInitAndTypeInfo.Lock(); 337 _pAtlModule->m_csStaticDataInitAndTypeInfo.Lock();
338 338
339 if (state_ == UNKNOWN) { 339 if (state_ == UNKNOWN) {
340 // If we're going to start patching things for reals, we'd better make sure 340 // If we're going to start patching things for reals, we'd better make sure
341 // that we stick around for ever more: 341 // that we stick around for ever more:
342 if (!IsUnpinnedMode()) 342 if (!IsUnpinnedMode())
343 PinModule(); 343 PinModule();
344 344
345 HttpNegotiatePatch::Initialize();
346
347 ProtocolPatchMethod patch_method = GetPatchMethod(); 345 ProtocolPatchMethod patch_method = GetPatchMethod();
348 if (patch_method == PATCH_METHOD_INET_PROTOCOL) { 346 if (patch_method == PATCH_METHOD_INET_PROTOCOL) {
349 g_trans_hooks.InstallHooks(); 347 g_trans_hooks.InstallHooks();
350 state_ = PATCH_PROTOCOL; 348 state_ = PATCH_PROTOCOL;
351 } else if (patch_method == PATCH_METHOD_IBROWSER) { 349 } else if (patch_method == PATCH_METHOD_IBROWSER) {
350 HttpNegotiatePatch::Initialize();
352 state_ = PATCH_IBROWSER; 351 state_ = PATCH_IBROWSER;
353 } else { 352 } else {
354 DCHECK(patch_method == PATCH_METHOD_MONIKER); 353 DCHECK(patch_method == PATCH_METHOD_MONIKER);
355 state_ = PATCH_MONIKER; 354 state_ = PATCH_MONIKER;
355 HttpNegotiatePatch::Initialize();
356 MonikerPatch::Initialize(); 356 MonikerPatch::Initialize();
357 } 357 }
358 358
359 ret = true; 359 ret = true;
360 } 360 }
361 361
362 _pAtlModule->m_csStaticDataInitAndTypeInfo.Unlock(); 362 _pAtlModule->m_csStaticDataInitAndTypeInfo.Unlock();
363 363
364 return ret; 364 return ret;
365 } 365 }
366 366
367 void PatchHelper::PatchBrowserService(IBrowserService* browser_service) { 367 void PatchHelper::PatchBrowserService(IBrowserService* browser_service) {
368 DCHECK(state_ == PATCH_IBROWSER); 368 DCHECK(state_ == PATCH_IBROWSER);
369 if (!IS_PATCHED(IBrowserService)) { 369 if (!IS_PATCHED(IBrowserService)) {
370 vtable_patch::PatchInterfaceMethods(browser_service, 370 vtable_patch::PatchInterfaceMethods(browser_service,
371 IBrowserService_PatchInfo); 371 IBrowserService_PatchInfo);
372 } 372 }
373 } 373 }
374 374
375 void PatchHelper::UnpatchIfNeeded() { 375 void PatchHelper::UnpatchIfNeeded() {
376 if (state_ == PATCH_PROTOCOL) { 376 if (state_ == PATCH_PROTOCOL) {
377 g_trans_hooks.RevertHooks(); 377 g_trans_hooks.RevertHooks();
378 } else if (state_ == PATCH_IBROWSER) { 378 } else if (state_ == PATCH_IBROWSER) {
379 vtable_patch::UnpatchInterfaceMethods(IBrowserService_PatchInfo); 379 vtable_patch::UnpatchInterfaceMethods(IBrowserService_PatchInfo);
380 MonikerPatch::Uninitialize(); 380 MonikerPatch::Uninitialize();
381 HttpNegotiatePatch::Uninitialize();
382 } else {
383 HttpNegotiatePatch::Uninitialize();
381 } 384 }
382 385
383 HttpNegotiatePatch::Uninitialize();
384
385 state_ = UNKNOWN; 386 state_ = UNKNOWN;
386 } 387 }
387 388
OLDNEW
« no previous file with comments | « no previous file | chrome_frame/chrome_active_document.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698