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

Side by Side Diff: components/visitedlink/renderer/visitedlink_slave.cc

Issue 1417943002: Load the table of visited links from database file asynchronously. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add extra comment and fix compilation error. Created 5 years 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "components/visitedlink/renderer/visitedlink_slave.h" 5 #include "components/visitedlink/renderer/visitedlink_slave.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/shared_memory.h" 8 #include "base/memory/shared_memory.h"
9 #include "components/visitedlink/common/visitedlink_messages.h" 9 #include "components/visitedlink/common/visitedlink_messages.h"
10 #include "third_party/WebKit/public/web/WebView.h" 10 #include "third_party/WebKit/public/web/WebView.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 static_cast<char*>(shared_memory_->memory()) + sizeof(SharedHeader)); 69 static_cast<char*>(shared_memory_->memory()) + sizeof(SharedHeader));
70 table_length_ = table_len; 70 table_length_ = table_len;
71 } 71 }
72 72
73 void VisitedLinkSlave::OnAddVisitedLinks( 73 void VisitedLinkSlave::OnAddVisitedLinks(
74 const VisitedLinkSlave::Fingerprints& fingerprints) { 74 const VisitedLinkSlave::Fingerprints& fingerprints) {
75 for (size_t i = 0; i < fingerprints.size(); ++i) 75 for (size_t i = 0; i < fingerprints.size(); ++i)
76 WebView::updateVisitedLinkState(fingerprints[i]); 76 WebView::updateVisitedLinkState(fingerprints[i]);
77 } 77 }
78 78
79 void VisitedLinkSlave::OnResetVisitedLinks() { 79 void VisitedLinkSlave::OnResetVisitedLinks(bool invalidate_hashes) {
80 WebView::resetVisitedLinkState(); 80 WebView::resetVisitedLinkState(invalidate_hashes);
81 } 81 }
82 82
83 void VisitedLinkSlave::FreeTable() { 83 void VisitedLinkSlave::FreeTable() {
84 if (shared_memory_) { 84 if (shared_memory_) {
85 delete shared_memory_; 85 delete shared_memory_;
86 shared_memory_ = NULL; 86 shared_memory_ = NULL;
87 } 87 }
88 hash_table_ = NULL; 88 hash_table_ = NULL;
89 table_length_ = 0; 89 table_length_ = 0;
90 } 90 }
91 91
92 } // namespace visitedlink 92 } // namespace visitedlink
OLDNEW
« no previous file with comments | « components/visitedlink/renderer/visitedlink_slave.h ('k') | components/visitedlink/test/visitedlink_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698