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

Side by Side Diff: chrome/browser/sessions/session_service_test_helper.h

Issue 500143002: Fixes possible use after free in SessionService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove friend Created 6 years, 3 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 | 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 #ifndef CHROME_BROWSER_SESSIONS_SESSION_SERVICE_TEST_HELPER_H_ 5 #ifndef CHROME_BROWSER_SESSIONS_SESSION_SERVICE_TEST_HELPER_H_
6 #define CHROME_BROWSER_SESSIONS_SESSION_SERVICE_TEST_HELPER_H_ 6 #define CHROME_BROWSER_SESSIONS_SESSION_SERVICE_TEST_HELPER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/message_loop/message_loop.h"
13 #include "components/sessions/session_id.h" 14 #include "components/sessions/session_id.h"
14 15
15 class SessionBackend; 16 class SessionBackend;
16 class SessionCommand; 17 class SessionCommand;
17 class SessionService; 18 class SessionService;
18 struct SessionTab; 19 struct SessionTab;
19 struct SessionWindow; 20 struct SessionWindow;
20 21
22 namespace base {
23 class RunLoop;
24 }
25
21 namespace sessions { 26 namespace sessions {
22 class SerializedNavigationEntry; 27 class SerializedNavigationEntry;
23 } 28 }
24 29
25 // A simple class that makes writing SessionService related tests easier. 30 // A simple class that makes writing SessionService related tests easier.
26 31
27 class SessionServiceTestHelper { 32 class SessionServiceTestHelper {
28 public: 33 public:
29 SessionServiceTestHelper(); 34 SessionServiceTestHelper();
30 explicit SessionServiceTestHelper(SessionService* service); 35 explicit SessionServiceTestHelper(SessionService* service);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 void AssertSingleWindowWithSingleTab( 74 void AssertSingleWindowWithSingleTab(
70 const std::vector<SessionWindow*>& windows, 75 const std::vector<SessionWindow*>& windows,
71 size_t nav_count); 76 size_t nav_count);
72 77
73 void SetService(SessionService* service); 78 void SetService(SessionService* service);
74 SessionService* ReleaseService() { return service_.release(); } 79 SessionService* ReleaseService() { return service_.release(); }
75 SessionService* service() { return service_.get(); } 80 SessionService* service() { return service_.get(); }
76 81
77 SessionBackend* backend(); 82 SessionBackend* backend();
78 83
84 void RunTaskOnBackendThread(const tracked_objects::Location& from_here,
85 const base::Closure& task);
86
79 private: 87 private:
80 scoped_ptr<SessionService> service_; 88 scoped_ptr<SessionService> service_;
81 89
82 DISALLOW_COPY_AND_ASSIGN(SessionServiceTestHelper); 90 DISALLOW_COPY_AND_ASSIGN(SessionServiceTestHelper);
83 }; 91 };
84 92
85 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_TEST_HELPER_H_ 93 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_TEST_HELPER_H_
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_service.cc ('k') | chrome/browser/sessions/session_service_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698