| OLD | NEW |
| 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_automation.h" | 5 #include "chrome_frame/chrome_frame_automation.h" |
| 6 | 6 |
| 7 #include "app/app_switches.h" | 7 #include "app/app_switches.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/file_version_info.h" | 13 #include "base/file_version_info.h" |
| 14 #include "base/lazy_instance.h" |
| 14 #include "base/lock.h" | 15 #include "base/lock.h" |
| 15 #include "base/logging.h" | 16 #include "base/logging.h" |
| 16 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| 17 #include "base/process_util.h" | 18 #include "base/process_util.h" |
| 18 #include "base/singleton.h" | |
| 19 #include "base/string_util.h" | 19 #include "base/string_util.h" |
| 20 #include "base/sys_info.h" | 20 #include "base/sys_info.h" |
| 21 #include "base/utf_string_conversions.h" | 21 #include "base/utf_string_conversions.h" |
| 22 #include "base/waitable_event.h" | 22 #include "base/waitable_event.h" |
| 23 #include "chrome/app/client_util.h" | 23 #include "chrome/app/client_util.h" |
| 24 #include "chrome/common/chrome_constants.h" | 24 #include "chrome/common/chrome_constants.h" |
| 25 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
| 26 #include "chrome/test/automation/tab_proxy.h" | 26 #include "chrome/test/automation/tab_proxy.h" |
| 27 #include "chrome_frame/chrome_launcher_utils.h" | 27 #include "chrome_frame/chrome_launcher_utils.h" |
| 28 #include "chrome_frame/crash_reporting/crash_metrics.h" | 28 #include "chrome_frame/crash_reporting/crash_metrics.h" |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 entry); | 557 entry); |
| 558 proxies_.container().erase(it); | 558 proxies_.container().erase(it); |
| 559 lock_.Release(); | 559 lock_.Release(); |
| 560 } | 560 } |
| 561 | 561 |
| 562 entry->Release(); | 562 entry->Release(); |
| 563 | 563 |
| 564 return true; | 564 return true; |
| 565 } | 565 } |
| 566 | 566 |
| 567 Singleton<ProxyFactory, LeakySingletonTraits<ProxyFactory> > g_proxy_factory; | 567 static base::LazyInstance<ProxyFactory, |
| 568 base::LeakyLazyInstanceTraits<ProxyFactory> > |
| 569 g_proxy_factory(base::LINKER_INITIALIZED); |
| 568 | 570 |
| 569 template <> struct RunnableMethodTraits<ChromeFrameAutomationClient> { | 571 template <> struct RunnableMethodTraits<ChromeFrameAutomationClient> { |
| 570 static void RetainCallee(ChromeFrameAutomationClient* obj) {} | 572 static void RetainCallee(ChromeFrameAutomationClient* obj) {} |
| 571 static void ReleaseCallee(ChromeFrameAutomationClient* obj) {} | 573 static void ReleaseCallee(ChromeFrameAutomationClient* obj) {} |
| 572 }; | 574 }; |
| 573 | 575 |
| 574 ChromeFrameAutomationClient::ChromeFrameAutomationClient() | 576 ChromeFrameAutomationClient::ChromeFrameAutomationClient() |
| 575 : chrome_frame_delegate_(NULL), | 577 : chrome_frame_delegate_(NULL), |
| 576 chrome_window_(NULL), | 578 chrome_window_(NULL), |
| 577 tab_window_(NULL), | 579 tab_window_(NULL), |
| 578 parent_window_(NULL), | 580 parent_window_(NULL), |
| 579 automation_server_(NULL), | 581 automation_server_(NULL), |
| 580 automation_server_id_(NULL), | 582 automation_server_id_(NULL), |
| 581 ui_thread_id_(NULL), | 583 ui_thread_id_(NULL), |
| 582 init_state_(UNINITIALIZED), | 584 init_state_(UNINITIALIZED), |
| 583 use_chrome_network_(false), | 585 use_chrome_network_(false), |
| 584 proxy_factory_(g_proxy_factory.get()), | 586 proxy_factory_(g_proxy_factory.Pointer()), |
| 585 handle_top_level_requests_(false), | 587 handle_top_level_requests_(false), |
| 586 tab_handle_(-1), | 588 tab_handle_(-1), |
| 587 session_id_(-1), | 589 session_id_(-1), |
| 588 external_tab_cookie_(0), | 590 external_tab_cookie_(0), |
| 589 url_fetcher_(NULL), | 591 url_fetcher_(NULL), |
| 590 url_fetcher_flags_(PluginUrlRequestManager::NOT_THREADSAFE), | 592 url_fetcher_flags_(PluginUrlRequestManager::NOT_THREADSAFE), |
| 591 navigate_after_initialization_(false), | 593 navigate_after_initialization_(false), |
| 592 route_all_top_level_navigations_(false) { | 594 route_all_top_level_navigations_(false) { |
| 593 } | 595 } |
| 594 | 596 |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1469 const URLRequestStatus& status) { | 1471 const URLRequestStatus& status) { |
| 1470 automation_server_->Send(new AutomationMsg_RequestEnd(0, tab_->handle(), | 1472 automation_server_->Send(new AutomationMsg_RequestEnd(0, tab_->handle(), |
| 1471 request_id, status)); | 1473 request_id, status)); |
| 1472 } | 1474 } |
| 1473 | 1475 |
| 1474 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, | 1476 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, |
| 1475 const GURL& url, const std::string& cookie_string, int cookie_id) { | 1477 const GURL& url, const std::string& cookie_string, int cookie_id) { |
| 1476 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse(0, | 1478 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse(0, |
| 1477 tab_->handle(), success, url, cookie_string, cookie_id)); | 1479 tab_->handle(), success, url, cookie_string, cookie_id)); |
| 1478 } | 1480 } |
| OLD | NEW |