OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/dom_storage/dom_storage_area.h" | 5 #include "content/browser/dom_storage/dom_storage_area.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 task_runner_->PostDelayedTask( | 453 task_runner_->PostDelayedTask( |
454 FROM_HERE, base::Bind(&DOMStorageArea::OnCommitTimer, this), | 454 FROM_HERE, base::Bind(&DOMStorageArea::OnCommitTimer, this), |
455 ComputeCommitDelay()); | 455 ComputeCommitDelay()); |
456 } | 456 } |
457 } | 457 } |
458 | 458 |
459 void DOMStorageArea::ShutdownInCommitSequence() { | 459 void DOMStorageArea::ShutdownInCommitSequence() { |
460 // This method executes on the commit sequence. | 460 // This method executes on the commit sequence. |
461 DCHECK(task_runner_->IsRunningOnCommitSequence()); | 461 DCHECK(task_runner_->IsRunningOnCommitSequence()); |
462 DCHECK(backing_.get()); | 462 DCHECK(backing_.get()); |
463 if (commit_batch_) { | 463 // Discard any changes that accrued prior to the timer firing. |
464 // Commit any changes that accrued prior to the timer firing. | |
465 bool success = backing_->CommitChanges( | |
466 commit_batch_->clear_all_first, | |
467 commit_batch_->changed_values); | |
468 DCHECK(success); | |
469 } | |
470 commit_batch_.reset(); | 464 commit_batch_.reset(); |
471 backing_.reset(); | 465 backing_.reset(); |
472 session_storage_backing_ = NULL; | 466 session_storage_backing_ = NULL; |
473 } | 467 } |
474 | 468 |
475 } // namespace content | 469 } // namespace content |
OLD | NEW |