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

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

Issue 353063005: [ChromeDriver] Subscribe PerformanceLogger to CommandListener interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unintentional debug output Created 6 years, 5 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
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/test/chromedriver/session.h" 5 #include "chrome/test/chromedriver/session.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/threading/thread_local.h" 10 #include "base/threading/thread_local.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 75 }
76 76
77 void Session::SwitchToSubFrame(const std::string& frame_id, 77 void Session::SwitchToSubFrame(const std::string& frame_id,
78 const std::string& chromedriver_frame_id) { 78 const std::string& chromedriver_frame_id) {
79 std::string parent_frame_id; 79 std::string parent_frame_id;
80 if (!frames.empty()) 80 if (!frames.empty())
81 parent_frame_id = frames.back().frame_id; 81 parent_frame_id = frames.back().frame_id;
82 frames.push_back(FrameInfo(parent_frame_id, frame_id, chromedriver_frame_id)); 82 frames.push_back(FrameInfo(parent_frame_id, frame_id, chromedriver_frame_id));
83 } 83 }
84 84
85 void Session::AddListener(CommandListener* listener) {
86 CHECK(listener);
87 command_listeners.push_back(listener);
88 }
89
85 std::string Session::GetCurrentFrameId() const { 90 std::string Session::GetCurrentFrameId() const {
86 if (frames.empty()) 91 if (frames.empty())
87 return std::string(); 92 return std::string();
88 return frames.back().frame_id; 93 return frames.back().frame_id;
89 } 94 }
90 95
91 std::vector<WebDriverLog*> Session::GetAllLogs() const { 96 std::vector<WebDriverLog*> Session::GetAllLogs() const {
92 std::vector<WebDriverLog*> logs; 97 std::vector<WebDriverLog*> logs;
93 for (ScopedVector<WebDriverLog>::const_iterator log = devtools_logs.begin(); 98 for (ScopedVector<WebDriverLog>::const_iterator log = devtools_logs.begin();
94 log != devtools_logs.end(); 99 log != devtools_logs.end();
(...skipping 18 matching lines...) Expand all
113 return std::string(); 118 return std::string();
114 } 119 }
115 120
116 Session* GetThreadLocalSession() { 121 Session* GetThreadLocalSession() {
117 return lazy_tls_session.Pointer()->Get(); 122 return lazy_tls_session.Pointer()->Get();
118 } 123 }
119 124
120 void SetThreadLocalSession(scoped_ptr<Session> session) { 125 void SetThreadLocalSession(scoped_ptr<Session> session) {
121 lazy_tls_session.Pointer()->Set(session.release()); 126 lazy_tls_session.Pointer()->Set(session.release());
122 } 127 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698