OLD | NEW |
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/sync_file_system/local_file_sync_service.h" | 5 #include "chrome/browser/sync_file_system/local_file_sync_service.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 Map::iterator found = change_count_map_.find(origin); | 77 Map::iterator found = change_count_map_.find(origin); |
78 if (found != change_count_map_.end()) { | 78 if (found != change_count_map_.end()) { |
79 if (next_ == found) | 79 if (next_ == found) |
80 ++next_; | 80 ++next_; |
81 change_count_map_.erase(found); | 81 change_count_map_.erase(found); |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 void LocalFileSyncService::OriginChangeMap::SetOriginEnabled( | 85 void LocalFileSyncService::OriginChangeMap::SetOriginEnabled( |
86 const GURL& origin, bool enabled) { | 86 const GURL& origin, bool enabled) { |
87 if (enabled) { | 87 if (enabled) |
88 DCHECK(ContainsKey(disabled_origins_, origin)); | |
89 disabled_origins_.erase(origin); | 88 disabled_origins_.erase(origin); |
90 } else { | 89 else |
91 disabled_origins_.insert(origin); | 90 disabled_origins_.insert(origin); |
92 } | |
93 } | 91 } |
94 | 92 |
95 // LocalFileSyncService ------------------------------------------------------- | 93 // LocalFileSyncService ------------------------------------------------------- |
96 | 94 |
97 LocalFileSyncService::LocalFileSyncService(Profile* profile) | 95 LocalFileSyncService::LocalFileSyncService(Profile* profile) |
98 : profile_(profile), | 96 : profile_(profile), |
99 sync_context_(new LocalFileSyncContext( | 97 sync_context_(new LocalFileSyncContext( |
100 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 98 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
101 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))), | 99 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))), |
102 local_change_processor_(NULL) { | 100 local_change_processor_(NULL) { |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 changes.front(), | 406 changes.front(), |
409 sync_file_info.local_file_path, | 407 sync_file_info.local_file_path, |
410 sync_file_info.metadata, | 408 sync_file_info.metadata, |
411 url, | 409 url, |
412 base::Bind(&LocalFileSyncService::ProcessNextChangeForURL, | 410 base::Bind(&LocalFileSyncService::ProcessNextChangeForURL, |
413 AsWeakPtr(), sync_file_info, | 411 AsWeakPtr(), sync_file_info, |
414 changes.front(), changes.PopAndGetNewList())); | 412 changes.front(), changes.PopAndGetNewList())); |
415 } | 413 } |
416 | 414 |
417 } // namespace sync_file_system | 415 } // namespace sync_file_system |
OLD | NEW |