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 "content/browser/net/sqlite_persistent_cookie_store.h" | 5 #include "content/browser/net/sqlite_persistent_cookie_store.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
17 #include "base/files/file_util.h" | 17 #include "base/files/file_util.h" |
18 #include "base/location.h" | 18 #include "base/location.h" |
19 #include "base/logging.h" | 19 #include "base/logging.h" |
20 #include "base/memory/ref_counted.h" | 20 #include "base/memory/ref_counted.h" |
21 #include "base/memory/scoped_ptr.h" | 21 #include "base/memory/scoped_ptr.h" |
22 #include "base/metrics/field_trial.h" | 22 #include "base/metrics/field_trial.h" |
23 #include "base/metrics/histogram.h" | 23 #include "base/metrics/histogram.h" |
| 24 #include "base/profiler/scoped_tracker.h" |
24 #include "base/sequenced_task_runner.h" | 25 #include "base/sequenced_task_runner.h" |
25 #include "base/strings/string_util.h" | 26 #include "base/strings/string_util.h" |
26 #include "base/strings/stringprintf.h" | 27 #include "base/strings/stringprintf.h" |
27 #include "base/synchronization/lock.h" | 28 #include "base/synchronization/lock.h" |
28 #include "base/threading/sequenced_worker_pool.h" | 29 #include "base/threading/sequenced_worker_pool.h" |
29 #include "base/time/time.h" | 30 #include "base/time/time.h" |
30 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
31 #include "content/public/browser/cookie_crypto_delegate.h" | 32 #include "content/public/browser/cookie_crypto_delegate.h" |
32 #include "content/public/browser/cookie_store_factory.h" | 33 #include "content/public/browser/cookie_store_factory.h" |
33 #include "content/public/common/content_switches.h" | 34 #include "content/public/common/content_switches.h" |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 } | 501 } |
501 | 502 |
502 PostClientTask(FROM_HERE, base::Bind( | 503 PostClientTask(FROM_HERE, base::Bind( |
503 &SQLitePersistentCookieStore::Backend::CompleteLoadForKeyInForeground, | 504 &SQLitePersistentCookieStore::Backend::CompleteLoadForKeyInForeground, |
504 this, loaded_callback, success)); | 505 this, loaded_callback, success)); |
505 } | 506 } |
506 | 507 |
507 void SQLitePersistentCookieStore::Backend::CompleteLoadForKeyInForeground( | 508 void SQLitePersistentCookieStore::Backend::CompleteLoadForKeyInForeground( |
508 const LoadedCallback& loaded_callback, | 509 const LoadedCallback& loaded_callback, |
509 bool load_success) { | 510 bool load_success) { |
| 511 // TODO(pkasting): Remove ScopedTracker below once crbug.com/456373 is fixed. |
| 512 tracked_objects::ScopedTracker tracking_profile( |
| 513 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 514 "456373 SQLitePersistentCookieStore::Backend::" |
| 515 "CompleteLoadForKeyInForeground")); |
510 DCHECK(client_task_runner_->RunsTasksOnCurrentThread()); | 516 DCHECK(client_task_runner_->RunsTasksOnCurrentThread()); |
511 | 517 |
512 Notify(loaded_callback, load_success); | 518 Notify(loaded_callback, load_success); |
513 | 519 |
514 { | 520 { |
515 base::AutoLock locked(metrics_lock_); | 521 base::AutoLock locked(metrics_lock_); |
516 num_priority_waiting_--; | 522 num_priority_waiting_--; |
517 if (num_priority_waiting_ == 0) { | 523 if (num_priority_waiting_ == 0) { |
518 priority_wait_duration_ += | 524 priority_wait_duration_ += |
519 base::Time::Now() - current_priority_wait_start_; | 525 base::Time::Now() - current_priority_wait_start_; |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 | 1367 |
1362 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1368 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
1363 switches::kEnableFileCookies)) { | 1369 switches::kEnableFileCookies)) { |
1364 cookie_monster->SetEnableFileScheme(true); | 1370 cookie_monster->SetEnableFileScheme(true); |
1365 } | 1371 } |
1366 | 1372 |
1367 return cookie_monster; | 1373 return cookie_monster; |
1368 } | 1374 } |
1369 | 1375 |
1370 } // namespace content | 1376 } // namespace content |
OLD | NEW |