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

Side by Side Diff: chrome_frame/chrome_frame_activex.cc

Issue 3061036: Handle automation server crashes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 | « chrome_frame/chrome_frame_activex.h ('k') | chrome_frame/chrome_frame_activex_base.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/chrome_frame_activex.h" 5 #include "chrome_frame/chrome_frame_activex.h"
6 6
7 #include <wininet.h> 7 #include <wininet.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 m_spClientSite, 413 m_spClientSite,
414 service.Receive()); 414 service.Receive());
415 if (SUCCEEDED(service_hr) && service) { 415 if (SUCCEEDED(service_hr) && service) {
416 // Does the host want privileged mode? 416 // Does the host want privileged mode?
417 boolean wants_privileged = false; 417 boolean wants_privileged = false;
418 service_hr = service->GetWantsPrivileged(&wants_privileged); 418 service_hr = service->GetWantsPrivileged(&wants_privileged);
419 419
420 if (SUCCEEDED(service_hr) && wants_privileged) 420 if (SUCCEEDED(service_hr) && wants_privileged)
421 is_privileged_ = true; 421 is_privileged_ = true;
422 422
423 url_fetcher_.set_privileged_mode(is_privileged_); 423 url_fetcher_->set_privileged_mode(is_privileged_);
424 } 424 }
425 425
426 std::wstring chrome_extra_arguments; 426 std::wstring chrome_extra_arguments;
427 std::wstring profile_name(GetHostProcessName(false)); 427 std::wstring profile_name(GetHostProcessName(false));
428 if (is_privileged_) { 428 if (is_privileged_) {
429 // Does the host want to provide extra arguments? 429 // Does the host want to provide extra arguments?
430 ScopedBstr extra_arguments_arg; 430 ScopedBstr extra_arguments_arg;
431 service_hr = service->GetChromeExtraArguments( 431 service_hr = service->GetChromeExtraArguments(
432 extra_arguments_arg.Receive()); 432 extra_arguments_arg.Receive());
433 if (S_OK == service_hr && extra_arguments_arg) 433 if (S_OK == service_hr && extra_arguments_arg)
(...skipping 17 matching lines...) Expand all
451 service_hr = service->GetChromeProfileName(profile_name_arg.Receive()); 451 service_hr = service->GetChromeProfileName(profile_name_arg.Receive());
452 if (S_OK == service_hr && profile_name_arg) 452 if (S_OK == service_hr && profile_name_arg)
453 profile_name.assign(profile_name_arg, profile_name_arg.Length()); 453 profile_name.assign(profile_name_arg, profile_name_arg.Length());
454 } 454 }
455 455
456 std::string utf8_url; 456 std::string utf8_url;
457 if (url_.Length()) { 457 if (url_.Length()) {
458 WideToUTF8(url_, url_.Length(), &utf8_url); 458 WideToUTF8(url_, url_.Length(), &utf8_url);
459 } 459 }
460 460
461 url_fetcher_.set_frame_busting(!is_privileged_); 461 url_fetcher_->set_frame_busting(!is_privileged_);
462 automation_client_->SetUrlFetcher(&url_fetcher_); 462 automation_client_->SetUrlFetcher(url_fetcher_.get());
463 if (!InitializeAutomation(profile_name, chrome_extra_arguments, 463 if (!InitializeAutomation(profile_name, chrome_extra_arguments,
464 IsIEInPrivate(), true, GURL(utf8_url), 464 IsIEInPrivate(), true, GURL(utf8_url),
465 GURL())) { 465 GURL())) {
466 DLOG(ERROR) << "Failed to navigate to url:" << utf8_url; 466 DLOG(ERROR) << "Failed to navigate to url:" << utf8_url;
467 return E_FAIL; 467 return E_FAIL;
468 } 468 }
469 } 469 }
470 470
471 return hr; 471 return hr;
472 } 472 }
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 if (FAILED(hr)) { 649 if (FAILED(hr)) {
650 NOTREACHED() << "ChromeFrame BHO SetSite failed. Error:" 650 NOTREACHED() << "ChromeFrame BHO SetSite failed. Error:"
651 << StringPrintf(" 0x%08X", hr); 651 << StringPrintf(" 0x%08X", hr);
652 return hr; 652 return hr;
653 } 653 }
654 654
655 web_browser2->PutProperty(ScopedBstr(bho_class_id_as_string), 655 web_browser2->PutProperty(ScopedBstr(bho_class_id_as_string),
656 ScopedVariant(bho)); 656 ScopedVariant(bho));
657 return S_OK; 657 return S_OK;
658 } 658 }
OLDNEW
« no previous file with comments | « chrome_frame/chrome_frame_activex.h ('k') | chrome_frame/chrome_frame_activex_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698