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

Unified Diff: chrome/browser/automation/automation_provider.cc

Issue 2559001: Measure loading time of several tabs. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Revert michaeln's revert due to mac linker error Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/automation/automation_provider.cc
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 21a7614d7454326b57532deea9ef0323921d21f2..0e224f8b2df4afb6229c06c3672f40d32ecb0c90 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -2077,6 +2077,22 @@ void AutomationProvider::OmniboxAcceptInput(Browser* browser,
browser->window()->GetLocationBar()->AcceptInput();
}
+// Sample json input: { "command": "GetInitialLoadTimes" }
+// Refer to InitialLoadObserver::GetTimingInformation() for sample output.
+void AutomationProvider::GetInitialLoadTimes(
+ Browser*,
+ DictionaryValue*,
+ IPC::Message* reply_message) {
+ scoped_ptr<DictionaryValue> return_value(
+ initial_load_observer_->GetTimingInformation());
+
+ std::string json_return;
+ base::JSONWriter::Write(return_value.get(), false, &json_return);
+ AutomationMsg_SendJSONRequest::WriteReplyParams(
+ reply_message, json_return, true);
+ Send(reply_message);
+}
+
// Sample json input: { "command": "GetPluginsInfo" }
// Refer chrome/test/pyautolib/plugins_info.py for sample json output.
void AutomationProvider::GetPluginsInfo(Browser* browser,
@@ -2239,6 +2255,8 @@ void AutomationProvider::SendJSONRequest(int handle,
handler_map["WaitForAllDownloadsToComplete"] =
&AutomationProvider::WaitForDownloadsToComplete;
+ handler_map["GetInitialLoadTimes"] = &AutomationProvider::GetInitialLoadTimes;
+
if (error_string.empty()) {
if (handler_map.find(std::string(command)) != handler_map.end()) {
(this->*handler_map[command])(browser, dict_value, reply_message);
« no previous file with comments | « chrome/browser/automation/automation_provider.h ('k') | chrome/browser/automation/automation_provider_observers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698