OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/automation/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 5867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5878 base::Closure reply = | 5878 base::Closure reply = |
5879 base::Bind(SendSuccessReply, AsWeakPtr(), reply_message); | 5879 base::Bind(SendSuccessReply, AsWeakPtr(), reply_message); |
5880 g_browser_process->policy_service()->RefreshPolicies( | 5880 g_browser_process->policy_service()->RefreshPolicies( |
5881 base::Bind(PostTask, BrowserThread::IO, | 5881 base::Bind(PostTask, BrowserThread::IO, |
5882 base::Bind(PostTask, BrowserThread::FILE, | 5882 base::Bind(PostTask, BrowserThread::FILE, |
5883 base::Bind(PostTask, BrowserThread::IO, | 5883 base::Bind(PostTask, BrowserThread::IO, |
5884 base::Bind(PostTask, BrowserThread::UI, reply))))); | 5884 base::Bind(PostTask, BrowserThread::UI, reply))))); |
5885 #endif | 5885 #endif |
5886 } | 5886 } |
5887 | 5887 |
5888 static int AccessArray(const int arr[], int index) { | 5888 static int AccessArray(const volatile int arr[], int index) { |
5889 return arr[index]; | 5889 return arr[index]; |
5890 } | 5890 } |
5891 | 5891 |
5892 void TestingAutomationProvider::SimulateAsanMemoryBug( | 5892 void TestingAutomationProvider::SimulateAsanMemoryBug( |
5893 base::DictionaryValue* args, IPC::Message* reply_message) { | 5893 base::DictionaryValue* args, IPC::Message* reply_message) { |
5894 int testarray[41]; | 5894 // This array is volatile not to let compiler optimize us out. |
| 5895 volatile int testarray[41]; |
| 5896 |
| 5897 // Send the reply while we can. |
| 5898 AutomationJSONReply(this, reply_message).SendSuccess(NULL); |
| 5899 |
| 5900 // Cause Address Sanitizer to abort this process. |
5895 AccessArray(testarray, 42); | 5901 AccessArray(testarray, 42); |
5896 AutomationJSONReply(this, reply_message).SendSuccess(NULL); | |
5897 } | 5902 } |
5898 | 5903 |
5899 void TestingAutomationProvider::GetIndicesFromTab( | 5904 void TestingAutomationProvider::GetIndicesFromTab( |
5900 DictionaryValue* args, | 5905 DictionaryValue* args, |
5901 IPC::Message* reply_message) { | 5906 IPC::Message* reply_message) { |
5902 AutomationJSONReply reply(this, reply_message); | 5907 AutomationJSONReply reply(this, reply_message); |
5903 int id_or_handle = 0; | 5908 int id_or_handle = 0; |
5904 bool has_id = args->HasKey("tab_id"); | 5909 bool has_id = args->HasKey("tab_id"); |
5905 bool has_handle = args->HasKey("tab_handle"); | 5910 bool has_handle = args->HasKey("tab_handle"); |
5906 if (has_id && has_handle) { | 5911 if (has_id && has_handle) { |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6564 | 6569 |
6565 void TestingAutomationProvider::WaitForProcessLauncherThreadToGoIdle( | 6570 void TestingAutomationProvider::WaitForProcessLauncherThreadToGoIdle( |
6566 IPC::Message* reply_message) { | 6571 IPC::Message* reply_message) { |
6567 new WaitForProcessLauncherThreadToGoIdleObserver(this, reply_message); | 6572 new WaitForProcessLauncherThreadToGoIdleObserver(this, reply_message); |
6568 } | 6573 } |
6569 | 6574 |
6570 void TestingAutomationProvider::OnRemoveProvider() { | 6575 void TestingAutomationProvider::OnRemoveProvider() { |
6571 if (g_browser_process) | 6576 if (g_browser_process) |
6572 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6577 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
6573 } | 6578 } |
OLD | NEW |