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

Side by Side Diff: ios/chrome/browser/sessions/test_session_service.mm

Issue 2811593004: [ios] Allow having multiple session windows in a session. (Closed)
Patch Set: Address comments. 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 | « ios/chrome/browser/sessions/session_window_ios.h ('k') | ios/chrome/browser/tabs/tab_model.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #import "ios/chrome/browser/sessions/test_session_service.h" 5 #import "ios/chrome/browser/sessions/test_session_service.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
9 9
10 #if !defined(__has_feature) || !__has_feature(objc_arc) 10 #if !defined(__has_feature) || !__has_feature(objc_arc)
11 #error "This file requires ARC support." 11 #error "This file requires ARC support."
12 #endif 12 #endif
13 13
14 @implementation TestSessionService 14 @implementation TestSessionService
15 15
16 @synthesize performIO = _performIO; 16 @synthesize performIO = _performIO;
17 17
18 - (instancetype)init { 18 - (instancetype)init {
19 return [super initWithTaskRunner:base::ThreadTaskRunnerHandle::Get()]; 19 return [super initWithTaskRunner:base::ThreadTaskRunnerHandle::Get()];
20 } 20 }
21 21
22 - (void)saveSessionWindow:(SessionWindowIOS*)sessionWindow 22 - (void)saveSession:(SessionIOS*)session
23 directory:(NSString*)directory 23 directory:(NSString*)directory
24 immediately:(BOOL)immediately { 24 immediately:(BOOL)immediately {
25 NSString* sessionPath = [[self class] sessionPathForDirectory:directory]; 25 NSString* sessionPath = [[self class] sessionPathForDirectory:directory];
26 NSData* data = [NSKeyedArchiver archivedDataWithRootObject:sessionWindow]; 26 NSData* data = [NSKeyedArchiver archivedDataWithRootObject:session];
27 if (self.performIO) 27 if (self.performIO)
28 [self performSaveSessionData:data sessionPath:sessionPath]; 28 [self performSaveSessionData:data sessionPath:sessionPath];
29 } 29 }
30 30
31 @end 31 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/sessions/session_window_ios.h ('k') | ios/chrome/browser/tabs/tab_model.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698