Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1759)

Side by Side Diff: content/browser/net/sqlite_persistent_cookie_store.cc

Issue 894903004: Adding instrumentation to locate the source of jankiness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | net/cookies/cookie_monster.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | net/cookies/cookie_monster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698