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

Side by Side Diff: chrome/test/chromedriver/devtools_events_logger.cc

Issue 2743013002: Add webdriver endpoint to send custom debugger commands (Closed)
Patch Set: New DevToolsEventsLogger Created 3 years, 9 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/test/chromedriver/devtools_events_logger.h"
6
7 #include "base/values.h"
8 #include "chrome/test/chromedriver/chrome/devtools_client.h"
9 #include "chrome/test/chromedriver/chrome/devtools_client_impl.h"
10
11 DevToolsEventsLogger::DevToolsEventsLogger(Log* log,
12 const base::ListValue* prefs)
13 : BaseLogger(log),
14 prefs_(prefs) {}
15
16 inline DevToolsEventsLogger::~DevToolsEventsLogger() {}
17
18 Status DevToolsEventsLogger::OnConnected(DevToolsClient* client) {
19 for (base::ListValue::const_iterator it = prefs_->begin();
20 it != prefs_->end();
21 ++it) {
22 std::string event;
23 (*it)->GetAsString(&event);
24 events_.insert(event);
25 }
26 return Status(kOk);
27 }
28
29 Status DevToolsEventsLogger::OnEvent(
30 DevToolsClient* client,
31 const std::string& method,
32 const base::DictionaryValue& params) {
33 std::unordered_set<std::string>::iterator it = events_.find(method);
34 if (it != events_.end()) {
35 AddLogEntry(client->GetId(), method, params);
36 }
37 return Status(kOk);
38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698