| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import "ios/chrome/browser/sessions/session_service.h" | 5 #import "ios/chrome/browser/sessions/session_service.h" |
| 6 | 6 |
| 7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 if (!singleton) { | 77 if (!singleton) { |
| 78 singleton = [[[self class] alloc] init]; | 78 singleton = [[[self class] alloc] init]; |
| 79 } | 79 } |
| 80 return singleton; | 80 return singleton; |
| 81 } | 81 } |
| 82 | 82 |
| 83 - (id)init { | 83 - (id)init { |
| 84 self = [super init]; | 84 self = [super init]; |
| 85 if (self) { | 85 if (self) { |
| 86 pendingWindows_.reset([[NSMutableDictionary alloc] init]); | 86 pendingWindows_.reset([[NSMutableDictionary alloc] init]); |
| 87 auto pool = web::WebThread::GetBlockingPool(); | 87 auto* pool = web::WebThread::GetBlockingPool(); |
| 88 taskRunner_ = pool->GetSequencedTaskRunner(pool->GetSequenceToken()); | 88 taskRunner_ = pool->GetSequencedTaskRunner(pool->GetSequenceToken()); |
| 89 } | 89 } |
| 90 return self; | 90 return self; |
| 91 } | 91 } |
| 92 | 92 |
| 93 // Returns the path of the session file. | 93 // Returns the path of the session file. |
| 94 - (NSString*)sessionFilePathForDirectory:(NSString*)directory { | 94 - (NSString*)sessionFilePathForDirectory:(NSString*)directory { |
| 95 return [directory stringByAppendingPathComponent:@"session.plist"]; | 95 return [directory stringByAppendingPathComponent:@"session.plist"]; |
| 96 } | 96 } |
| 97 | 97 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 base::ThreadRestrictions::AssertIOAllowed(); | 246 base::ThreadRestrictions::AssertIOAllowed(); |
| 247 NSFileManager* fileManager = [NSFileManager defaultManager]; | 247 NSFileManager* fileManager = [NSFileManager defaultManager]; |
| 248 if (![fileManager fileExistsAtPath:sessionFile]) | 248 if (![fileManager fileExistsAtPath:sessionFile]) |
| 249 return; | 249 return; |
| 250 if (![fileManager removeItemAtPath:sessionFile error:nil]) | 250 if (![fileManager removeItemAtPath:sessionFile error:nil]) |
| 251 CHECK(false) << "Unable to delete session file."; | 251 CHECK(false) << "Unable to delete session file."; |
| 252 })); | 252 })); |
| 253 } | 253 } |
| 254 | 254 |
| 255 @end | 255 @end |
| OLD | NEW |