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

Side by Side Diff: net/spdy/spdy_session_test_util.h

Issue 2832973003: Split net/spdy into core and chromium subdirectories. (Closed)
Patch Set: Fix some more build rules. Created 3 years, 8 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
« no previous file with comments | « net/spdy/spdy_session_pool_unittest.cc ('k') | net/spdy/spdy_session_test_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 #ifndef NET_SPDY_SPDY_SESSION_TEST_UTIL_H_
6 #define NET_SPDY_SPDY_SESSION_TEST_UTIL_H_
7
8 #include <stdint.h>
9
10 #include "base/message_loop/message_loop.h"
11 #include "base/pending_task.h"
12 #include "net/spdy/platform/api/spdy_string.h"
13
14 namespace net {
15
16 // SpdySessionTestTaskObserver is a MessageLoop::TaskObserver that monitors the
17 // completion of all tasks executed by the current MessageLoop, recording the
18 // number of tasks that refer to a specific function and filename.
19 class SpdySessionTestTaskObserver : public base::MessageLoop::TaskObserver {
20 public:
21 // Creates a SpdySessionTaskObserver that will record all tasks that are
22 // executed that were posted by the function named by |function_name|, located
23 // in the file |file_name|.
24 // Example:
25 // file_name = "foo.cc"
26 // function = "DoFoo"
27 SpdySessionTestTaskObserver(const SpdyString& file_name,
28 const SpdyString& function_name);
29 ~SpdySessionTestTaskObserver() override;
30
31 // Implements MessageLoop::TaskObserver.
32 void WillProcessTask(const base::PendingTask& pending_task) override;
33 void DidProcessTask(const base::PendingTask& pending_task) override;
34
35 // Returns the number of tasks posted by the given function and file.
36 uint16_t executed_count() const { return executed_count_; }
37
38 private:
39 uint16_t executed_count_;
40 SpdyString file_name_;
41 SpdyString function_name_;
42 };
43
44 } // namespace net
45
46 #endif // NET_SPDY_SPDY_SESSION_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/spdy/spdy_session_pool_unittest.cc ('k') | net/spdy/spdy_session_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698