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

Side by Side Diff: trunk/src/chrome/browser/automation/automation_provider.h

Issue 89753004: Revert 237280 "Remove TraceController" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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
OLDNEW
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 // This implements a browser-side endpoint for UI automation activity. 5 // This implements a browser-side endpoint for UI automation activity.
6 // The client-side endpoint is implemented by AutomationProxy. 6 // The client-side endpoint is implemented by AutomationProxy.
7 // The entire lifetime of this object should be contained within that of 7 // The entire lifetime of this object should be contained within that of
8 // the BrowserProcess, and in particular the NotificationService that's 8 // the BrowserProcess, and in particular the NotificationService that's
9 // hung off of it. 9 // hung off of it.
10 10
(...skipping 11 matching lines...) Expand all
22 #include "base/memory/weak_ptr.h" 22 #include "base/memory/weak_ptr.h"
23 #include "base/observer_list.h" 23 #include "base/observer_list.h"
24 #include "base/sequenced_task_runner_helpers.h" 24 #include "base/sequenced_task_runner_helpers.h"
25 #include "base/strings/string16.h" 25 #include "base/strings/string16.h"
26 #include "chrome/browser/common/cancelable_request.h" 26 #include "chrome/browser/common/cancelable_request.h"
27 #include "chrome/common/automation_constants.h" 27 #include "chrome/common/automation_constants.h"
28 #include "chrome/common/content_settings.h" 28 #include "chrome/common/content_settings.h"
29 #include "components/autofill/core/browser/field_types.h" 29 #include "components/autofill/core/browser/field_types.h"
30 #include "content/public/browser/browser_thread.h" 30 #include "content/public/browser/browser_thread.h"
31 #include "content/public/browser/notification_observer.h" 31 #include "content/public/browser/notification_observer.h"
32 #include "content/public/browser/trace_subscriber.h"
32 #include "ipc/ipc_channel.h" 33 #include "ipc/ipc_channel.h"
33 #include "ipc/ipc_listener.h" 34 #include "ipc/ipc_listener.h"
34 #include "ipc/ipc_sender.h" 35 #include "ipc/ipc_sender.h"
35 36
36 #if defined(OS_WIN) && !defined(USE_AURA) 37 #if defined(OS_WIN) && !defined(USE_AURA)
37 #include "ui/gfx/native_widget_types.h" 38 #include "ui/gfx/native_widget_types.h"
38 #endif // defined(OS_WIN) && !defined(USE_AURA) 39 #endif // defined(OS_WIN) && !defined(USE_AURA)
39 40
40 class AutomationBrowserTracker; 41 class AutomationBrowserTracker;
41 class AutomationResourceMessageFilter; 42 class AutomationResourceMessageFilter;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 75
75 namespace gfx { 76 namespace gfx {
76 class Point; 77 class Point;
77 } 78 }
78 79
79 class AutomationProvider 80 class AutomationProvider
80 : public IPC::Listener, 81 : public IPC::Listener,
81 public IPC::Sender, 82 public IPC::Sender,
82 public base::SupportsWeakPtr<AutomationProvider>, 83 public base::SupportsWeakPtr<AutomationProvider>,
83 public base::RefCountedThreadSafe< 84 public base::RefCountedThreadSafe<
84 AutomationProvider, content::BrowserThread::DeleteOnUIThread> { 85 AutomationProvider, content::BrowserThread::DeleteOnUIThread>,
86 public content::TraceSubscriber {
85 public: 87 public:
86 explicit AutomationProvider(Profile* profile); 88 explicit AutomationProvider(Profile* profile);
87 89
88 Profile* profile() const { return profile_; } 90 Profile* profile() const { return profile_; }
89 91
90 void set_profile(Profile* profile); 92 void set_profile(Profile* profile);
91 93
92 // Initializes a channel for a connection to an AutomationProxy. 94 // Initializes a channel for a connection to an AutomationProxy.
93 // If channel_id starts with kNamedInterfacePrefix, it will act 95 // If channel_id starts with kNamedInterfacePrefix, it will act
94 // as a server, create a named IPC socket with channel_id as its 96 // as a server, create a named IPC socket with channel_id as its
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 bool find_next, 208 bool find_next,
207 IPC::Message* reply_message); 209 IPC::Message* reply_message);
208 210
209 scoped_refptr<AutomationResourceMessageFilter> 211 scoped_refptr<AutomationResourceMessageFilter>
210 automation_resource_message_filter_; 212 automation_resource_message_filter_;
211 213
212 // True iff we should open a new automation IPC channel if it closes. 214 // True iff we should open a new automation IPC channel if it closes.
213 bool reinitialize_on_channel_error_; 215 bool reinitialize_on_channel_error_;
214 216
215 private: 217 private:
218 // Storage for EndTracing() to resume operations after a callback.
219 struct TracingData {
220 std::list<std::string> trace_output;
221 scoped_ptr<IPC::Message> reply_message;
222 };
223
224 // TraceSubscriber:
225 virtual void OnEndTracingComplete() OVERRIDE;
226 virtual void OnTraceDataCollected(
227 const scoped_refptr<base::RefCountedString>& trace_fragment) OVERRIDE;
228
216 void OnUnhandledMessage(const IPC::Message& message); 229 void OnUnhandledMessage(const IPC::Message& message);
217 230
218 // Clear and reinitialize the automation IPC channel. 231 // Clear and reinitialize the automation IPC channel.
219 bool ReinitializeChannel(); 232 bool ReinitializeChannel();
220 233
221 void HandleUnused(const IPC::Message& message, int handle); 234 void HandleUnused(const IPC::Message& message, int handle);
222 void GetFilteredInetHitCount(int* hit_count); 235 void GetFilteredInetHitCount(int* hit_count);
223 void SetProxyConfig(const std::string& new_proxy_config); 236 void SetProxyConfig(const std::string& new_proxy_config);
224 237
225 // Responds to the FindInPage request, retrieves the search query parameters, 238 // Responds to the FindInPage request, retrieves the search query parameters,
226 // launches an observer to listen for results and issues a StartFind request. 239 // launches an observer to listen for results and issues a StartFind request.
227 void HandleFindRequest(int handle, 240 void HandleFindRequest(int handle,
228 const AutomationMsg_Find_Params& params, 241 const AutomationMsg_Find_Params& params,
229 IPC::Message* reply_message); 242 IPC::Message* reply_message);
230 243
231 void OnSetPageFontSize(int tab_handle, int font_size); 244 void OnSetPageFontSize(int tab_handle, int font_size);
232 245
233 // See browsing_data_remover.h for explanation of bitmap fields. 246 // See browsing_data_remover.h for explanation of bitmap fields.
234 void RemoveBrowsingData(int remove_mask); 247 void RemoveBrowsingData(int remove_mask);
235 248
236 // Notify the JavaScript engine in the render to change its parameters 249 // Notify the JavaScript engine in the render to change its parameters
237 // while performing stress testing. See 250 // while performing stress testing. See
238 // |ViewHostMsg_JavaScriptStressTestControl_Commands| in render_messages.h 251 // |ViewHostMsg_JavaScriptStressTestControl_Commands| in render_messages.h
239 // for information on the arguments. 252 // for information on the arguments.
240 void JavaScriptStressTestControl(int handle, int cmd, int param); 253 void JavaScriptStressTestControl(int handle, int cmd, int param);
241 254
242 void BeginTracing(const std::string& category_patterns, bool* success); 255 void BeginTracing(const std::string& category_patterns, bool* success);
243 void EndTracing(IPC::Message* reply_message); 256 void EndTracing(IPC::Message* reply_message);
244 void OnTraceDataCollected(IPC::Message* reply_message, 257 void GetTracingOutput(std::string* chunk, bool* success);
245 const base::FilePath& path);
246 258
247 // Asynchronous request for printing the current tab. 259 // Asynchronous request for printing the current tab.
248 void PrintAsync(int tab_handle); 260 void PrintAsync(int tab_handle);
249 261
250 // Uses the specified encoding to override the encoding of the page in the 262 // Uses the specified encoding to override the encoding of the page in the
251 // specified tab. 263 // specified tab.
252 void OverrideEncoding(int tab_handle, 264 void OverrideEncoding(int tab_handle,
253 const std::string& encoding_name, 265 const std::string& encoding_name,
254 bool* success); 266 bool* success);
255 267
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 344
333 // True iff browser finished loading initial set of tabs. 345 // True iff browser finished loading initial set of tabs.
334 bool initial_tab_loads_complete_; 346 bool initial_tab_loads_complete_;
335 347
336 // True iff ChromeOS webui login ui is ready. 348 // True iff ChromeOS webui login ui is ready.
337 bool login_webui_ready_; 349 bool login_webui_ready_;
338 350
339 // ID of automation channel. 351 // ID of automation channel.
340 std::string channel_id_; 352 std::string channel_id_;
341 353
354 // Trace data that has been collected but not flushed to the automation
355 // client.
356 TracingData tracing_data_;
357
342 DISALLOW_COPY_AND_ASSIGN(AutomationProvider); 358 DISALLOW_COPY_AND_ASSIGN(AutomationProvider);
343 }; 359 };
344 360
345 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_H_ 361 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_H_
OLDNEW
« no previous file with comments | « trunk/src/base/debug/trace_event_unittest.cc ('k') | trunk/src/chrome/browser/automation/automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698