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

Side by Side Diff: android_webview/renderer/aw_content_renderer_client.cc

Issue 2823693002: Migrate RenderThreadImpl to use ConnectionFilter instead of the ChildThread's InterfaceRegistry to … (Closed)
Patch Set: . Created 3 years, 8 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 | « no previous file | chrome/renderer/chrome_render_thread_observer.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "android_webview/renderer/aw_content_renderer_client.h" 5 #include "android_webview/renderer/aw_content_renderer_client.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "android_webview/common/aw_resource.h" 9 #include "android_webview/common/aw_resource.h"
10 #include "android_webview/common/aw_switches.h" 10 #include "android_webview/common/aw_switches.h"
(...skipping 14 matching lines...) Expand all
25 #include "base/strings/string_util.h" 25 #include "base/strings/string_util.h"
26 #include "base/strings/utf_string_conversions.h" 26 #include "base/strings/utf_string_conversions.h"
27 #include "components/autofill/content/renderer/autofill_agent.h" 27 #include "components/autofill/content/renderer/autofill_agent.h"
28 #include "components/autofill/content/renderer/password_autofill_agent.h" 28 #include "components/autofill/content/renderer/password_autofill_agent.h"
29 #include "components/printing/renderer/print_web_view_helper.h" 29 #include "components/printing/renderer/print_web_view_helper.h"
30 #include "components/spellcheck/spellcheck_build_features.h" 30 #include "components/spellcheck/spellcheck_build_features.h"
31 #include "components/supervised_user_error_page/gin_wrapper.h" 31 #include "components/supervised_user_error_page/gin_wrapper.h"
32 #include "components/supervised_user_error_page/supervised_user_error_page_andro id.h" 32 #include "components/supervised_user_error_page/supervised_user_error_page_andro id.h"
33 #include "components/visitedlink/renderer/visitedlink_slave.h" 33 #include "components/visitedlink/renderer/visitedlink_slave.h"
34 #include "components/web_restrictions/interfaces/web_restrictions.mojom.h" 34 #include "components/web_restrictions/interfaces/web_restrictions.mojom.h"
35 #include "content/public/child/child_thread.h"
36 #include "content/public/common/service_manager_connection.h"
37 #include "content/public/common/simple_connection_filter.h"
35 #include "content/public/common/url_constants.h" 38 #include "content/public/common/url_constants.h"
36 #include "content/public/renderer/document_state.h" 39 #include "content/public/renderer/document_state.h"
37 #include "content/public/renderer/navigation_state.h" 40 #include "content/public/renderer/navigation_state.h"
38 #include "content/public/renderer/render_frame.h" 41 #include "content/public/renderer/render_frame.h"
39 #include "content/public/renderer/render_thread.h" 42 #include "content/public/renderer/render_thread.h"
40 #include "content/public/renderer/render_view.h" 43 #include "content/public/renderer/render_view.h"
41 #include "net/base/escape.h" 44 #include "net/base/escape.h"
42 #include "net/base/net_errors.h" 45 #include "net/base/net_errors.h"
46 #include "services/service_manager/public/cpp/binder_registry.h"
43 #include "services/service_manager/public/cpp/interface_provider.h" 47 #include "services/service_manager/public/cpp/interface_provider.h"
44 #include "services/service_manager/public/cpp/interface_registry.h"
45 #include "third_party/WebKit/public/platform/WebString.h" 48 #include "third_party/WebKit/public/platform/WebString.h"
46 #include "third_party/WebKit/public/platform/WebURL.h" 49 #include "third_party/WebKit/public/platform/WebURL.h"
47 #include "third_party/WebKit/public/platform/WebURLError.h" 50 #include "third_party/WebKit/public/platform/WebURLError.h"
48 #include "third_party/WebKit/public/platform/WebURLRequest.h" 51 #include "third_party/WebKit/public/platform/WebURLRequest.h"
49 #include "third_party/WebKit/public/web/WebFrame.h" 52 #include "third_party/WebKit/public/web/WebFrame.h"
50 #include "third_party/WebKit/public/web/WebNavigationType.h" 53 #include "third_party/WebKit/public/web/WebNavigationType.h"
51 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" 54 #include "third_party/WebKit/public/web/WebSecurityPolicy.h"
52 #include "ui/base/l10n/l10n_util.h" 55 #include "ui/base/l10n/l10n_util.h"
53 #include "ui/base/resource/resource_bundle.h" 56 #include "ui/base/resource/resource_bundle.h"
54 #include "url/gurl.h" 57 #include "url/gurl.h"
(...skipping 11 matching lines...) Expand all
66 AwContentRendererClient::AwContentRendererClient() {} 69 AwContentRendererClient::AwContentRendererClient() {}
67 70
68 AwContentRendererClient::~AwContentRendererClient() {} 71 AwContentRendererClient::~AwContentRendererClient() {}
69 72
70 void AwContentRendererClient::RenderThreadStarted() { 73 void AwContentRendererClient::RenderThreadStarted() {
71 RenderThread* thread = RenderThread::Get(); 74 RenderThread* thread = RenderThread::Get();
72 aw_render_thread_observer_.reset(new AwRenderThreadObserver); 75 aw_render_thread_observer_.reset(new AwRenderThreadObserver);
73 thread->AddObserver(aw_render_thread_observer_.get()); 76 thread->AddObserver(aw_render_thread_observer_.get());
74 77
75 visited_link_slave_.reset(new visitedlink::VisitedLinkSlave); 78 visited_link_slave_.reset(new visitedlink::VisitedLinkSlave);
76 thread->GetInterfaceRegistry()->AddInterface( 79
77 visited_link_slave_->GetBindCallback()); 80 auto registry = base::MakeUnique<service_manager::BinderRegistry>();
81 registry->AddInterface(visited_link_slave_->GetBindCallback(),
82 base::ThreadTaskRunnerHandle::Get());
83 content::ChildThread::Get()
84 ->GetServiceManagerConnection()
85 ->AddConnectionFilter(base::MakeUnique<content::SimpleConnectionFilter>(
86 std::move(registry)));
78 87
79 #if BUILDFLAG(ENABLE_SPELLCHECK) 88 #if BUILDFLAG(ENABLE_SPELLCHECK)
80 if (!spellcheck_) { 89 if (!spellcheck_) {
81 spellcheck_ = base::MakeUnique<SpellCheck>(); 90 spellcheck_ = base::MakeUnique<SpellCheck>();
82 thread->AddObserver(spellcheck_.get()); 91 thread->AddObserver(spellcheck_.get());
83 } 92 }
84 #endif 93 #endif
85 } 94 }
86 95
87 bool AwContentRendererClient::HandleNavigation( 96 bool AwContentRendererClient::HandleNavigation(
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 for (auto* extension : kMediaPlayerExtensions) { 315 for (auto* extension : kMediaPlayerExtensions) {
307 if (base::EndsWith(url.path(), extension, 316 if (base::EndsWith(url.path(), extension,
308 base::CompareCase::INSENSITIVE_ASCII)) { 317 base::CompareCase::INSENSITIVE_ASCII)) {
309 return true; 318 return true;
310 } 319 }
311 } 320 }
312 return false; 321 return false;
313 } 322 }
314 323
315 } // namespace android_webview 324 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/chrome_render_thread_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698