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

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

Issue 2851173004: Eliminate bind callback that doesn't take a BindSourceInfo parameter. (Closed)
Patch Set: . Created 3 years, 7 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
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "third_party/WebKit/public/web/WebView.h" 11 #include "third_party/WebKit/public/web/WebView.h"
12 12
13 using blink::WebView; 13 using blink::WebView;
14 14
15 namespace visitedlink { 15 namespace visitedlink {
16 16
17 VisitedLinkSlave::VisitedLinkSlave() : binding_(this), weak_factory_(this) {} 17 VisitedLinkSlave::VisitedLinkSlave() : binding_(this), weak_factory_(this) {}
18 18
19 VisitedLinkSlave::~VisitedLinkSlave() { 19 VisitedLinkSlave::~VisitedLinkSlave() {
20 FreeTable(); 20 FreeTable();
21 } 21 }
22 22
23 base::Callback<void(mojom::VisitedLinkNotificationSinkRequest)> 23 base::Callback<void(const service_manager::BindSourceInfo&,
24 mojom::VisitedLinkNotificationSinkRequest)>
24 VisitedLinkSlave::GetBindCallback() { 25 VisitedLinkSlave::GetBindCallback() {
25 return base::Bind(&VisitedLinkSlave::Bind, weak_factory_.GetWeakPtr()); 26 return base::Bind(&VisitedLinkSlave::Bind, weak_factory_.GetWeakPtr());
26 } 27 }
27 28
28 // Initializes the table with the given shared memory handle. This memory is 29 // Initializes the table with the given shared memory handle. This memory is
29 // mapped into the process. 30 // mapped into the process.
30 void VisitedLinkSlave::UpdateVisitedLinks( 31 void VisitedLinkSlave::UpdateVisitedLinks(
31 mojo::ScopedSharedBufferHandle table) { 32 mojo::ScopedSharedBufferHandle table) {
32 DCHECK(table.is_valid()) << "Bad table handle"; 33 DCHECK(table.is_valid()) << "Bad table handle";
33 // Since this function may be called again to change the table, we may need 34 // Since this function may be called again to change the table, we may need
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 73
73 void VisitedLinkSlave::FreeTable() { 74 void VisitedLinkSlave::FreeTable() {
74 if (!hash_table_) 75 if (!hash_table_)
75 return; 76 return;
76 77
77 table_mapping_.reset(); 78 table_mapping_.reset();
78 hash_table_ = NULL; 79 hash_table_ = NULL;
79 table_length_ = 0; 80 table_length_ = 0;
80 } 81 }
81 82
82 void VisitedLinkSlave::Bind(mojom::VisitedLinkNotificationSinkRequest request) { 83 void VisitedLinkSlave::Bind(const service_manager::BindSourceInfo& source_info,
84 mojom::VisitedLinkNotificationSinkRequest request) {
83 binding_.Bind(std::move(request)); 85 binding_.Bind(std::move(request));
84 } 86 }
85 87
86 } // namespace visitedlink 88 } // namespace visitedlink
OLDNEW
« no previous file with comments | « components/visitedlink/renderer/visitedlink_slave.h ('k') | components/web_cache/renderer/web_cache_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698