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

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

Issue 404012: Ensure that the refcount on InternalGetCommandRequest stays non-zero through a PostTask (Closed)
Patch Set: Created 11 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/base_session_service.h" 5 #include "chrome/browser/sessions/base_session_service.h"
6 6
7 #include "base/pickle.h" 7 #include "base/pickle.h"
8 #include "base/stl_util-inl.h" 8 #include "base/stl_util-inl.h"
9 #include "base/thread.h" 9 #include "base/thread.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 return navigation.url().is_valid(); 222 return navigation.url().is_valid();
223 } 223 }
224 224
225 BaseSessionService::Handle BaseSessionService::ScheduleGetLastSessionCommands( 225 BaseSessionService::Handle BaseSessionService::ScheduleGetLastSessionCommands(
226 InternalGetCommandsRequest* request, 226 InternalGetCommandsRequest* request,
227 CancelableRequestConsumerBase* consumer) { 227 CancelableRequestConsumerBase* consumer) {
228 scoped_refptr<InternalGetCommandsRequest> request_wrapper(request); 228 scoped_refptr<InternalGetCommandsRequest> request_wrapper(request);
229 AddRequest(request, consumer); 229 AddRequest(request, consumer);
230 if (backend_thread()) { 230 if (backend_thread()) {
231 backend_thread()->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( 231 backend_thread()->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
232 backend(), &SessionBackend::ReadLastSessionCommands, request)); 232 backend(), &SessionBackend::ReadLastSessionCommands, request_wrapper));
233 } else { 233 } else {
234 backend()->ReadLastSessionCommands(request); 234 backend()->ReadLastSessionCommands(request);
235 } 235 }
236 return request->handle(); 236 return request->handle();
237 } 237 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698