| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/importer/firefox_profile_lock.h" | 5 #include "chrome/browser/importer/firefox_profile_lock.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/threading/thread_restrictions.h" | 8 #include "base/threading/thread_restrictions.h" |
| 9 #include "build/build_config.h" |
| 9 | 10 |
| 10 // This class is based on Firefox code in: | 11 // This class is based on Firefox code in: |
| 11 // profile/dirserviceprovider/src/nsProfileLock.cpp | 12 // profile/dirserviceprovider/src/nsProfileLock.cpp |
| 12 // The license block is: | 13 // The license block is: |
| 13 | 14 |
| 14 /* ***** BEGIN LICENSE BLOCK ***** | 15 /* ***** BEGIN LICENSE BLOCK ***** |
| 15 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 16 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 16 * | 17 * |
| 17 * The contents of this file are subject to the Mozilla Public License Version | 18 * The contents of this file are subject to the Mozilla Public License Version |
| 18 * 1.1 (the "License"); you may not use this file except in compliance with | 19 * 1.1 (the "License"); you may not use this file except in compliance with |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 lock_file_ = path.Append(kLockFileName); | 75 lock_file_ = path.Append(kLockFileName); |
| 75 Lock(); | 76 Lock(); |
| 76 } | 77 } |
| 77 | 78 |
| 78 FirefoxProfileLock::~FirefoxProfileLock() { | 79 FirefoxProfileLock::~FirefoxProfileLock() { |
| 79 // Because this destructor happens in first run on the profile import thread, | 80 // Because this destructor happens in first run on the profile import thread, |
| 80 // with no UI to jank, it's ok to allow deletion of the lock here. | 81 // with no UI to jank, it's ok to allow deletion of the lock here. |
| 81 base::ThreadRestrictions::ScopedAllowIO allow_io; | 82 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 82 Unlock(); | 83 Unlock(); |
| 83 } | 84 } |
| OLD | NEW |