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

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

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 #include "chrome/browser/sessions/session_service_test_helper.h" 5 #include "chrome/browser/sessions/session_service_test_helper.h"
6 6
7 #include "base/memory/scoped_vector.h" 7 #include "base/memory/scoped_vector.h"
8 #include "base/message_loop/message_loop.h"
8 #include "chrome/browser/sessions/session_backend.h" 9 #include "chrome/browser/sessions/session_backend.h"
9 #include "chrome/browser/sessions/session_service.h" 10 #include "chrome/browser/sessions/session_service.h"
10 #include "chrome/browser/sessions/session_types.h" 11 #include "chrome/browser/sessions/session_types.h"
11 #include "components/sessions/serialized_navigation_entry_test_helper.h" 12 #include "components/sessions/serialized_navigation_entry_test_helper.h"
12 #include "components/sessions/session_id.h" 13 #include "components/sessions/session_id.h"
13 #include "content/public/browser/browser_thread.h" 14 #include "content/public/browser/browser_thread.h"
14 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
15 16
16 using base::Time; 17 using base::Time;
17 18
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 SessionBackend* SessionServiceTestHelper::backend() { 105 SessionBackend* SessionServiceTestHelper::backend() {
105 return service_->backend(); 106 return service_->backend();
106 } 107 }
107 108
108 void SessionServiceTestHelper::SetService(SessionService* service) { 109 void SessionServiceTestHelper::SetService(SessionService* service) {
109 service_.reset(service); 110 service_.reset(service);
110 // Execute IO tasks posted by the SessionService. 111 // Execute IO tasks posted by the SessionService.
111 content::BrowserThread::GetBlockingPool()->FlushForTesting(); 112 content::BrowserThread::GetBlockingPool()->FlushForTesting();
112 } 113 }
113 114
115 void SessionServiceTestHelper::RunTaskOnBackendThread(
116 const tracked_objects::Location& from_here,
117 const base::Closure& task) {
118 service_->RunTaskOnBackendThread(from_here, task);
119 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_service_test_helper.h ('k') | chrome/browser/sessions/session_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698