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

Side by Side Diff: chromecast/browser/cast_content_browser_client.cc

Issue 2144533002: Convert network hints to Mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromecast/browser/cast_content_browser_client.h" 5 #include "chromecast/browser/cast_content_browser_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "content/public/browser/geolocation_delegate.h" 45 #include "content/public/browser/geolocation_delegate.h"
46 #include "content/public/browser/render_process_host.h" 46 #include "content/public/browser/render_process_host.h"
47 #include "content/public/browser/resource_dispatcher_host.h" 47 #include "content/public/browser/resource_dispatcher_host.h"
48 #include "content/public/browser/web_contents.h" 48 #include "content/public/browser/web_contents.h"
49 #include "content/public/common/content_descriptors.h" 49 #include "content/public/common/content_descriptors.h"
50 #include "content/public/common/content_switches.h" 50 #include "content/public/common/content_switches.h"
51 #include "content/public/common/url_constants.h" 51 #include "content/public/common/url_constants.h"
52 #include "content/public/common/web_preferences.h" 52 #include "content/public/common/web_preferences.h"
53 #include "net/ssl/ssl_cert_request_info.h" 53 #include "net/ssl/ssl_cert_request_info.h"
54 #include "net/url_request/url_request_context_getter.h" 54 #include "net/url_request/url_request_context_getter.h"
55 #include "services/shell/public/cpp/interface_registry.h"
55 #include "ui/display/display.h" 56 #include "ui/display/display.h"
56 #include "ui/display/screen.h" 57 #include "ui/display/screen.h"
57 #include "ui/gl/gl_switches.h" 58 #include "ui/gl/gl_switches.h"
58 59
59 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) 60 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
60 #include "chromecast/browser/media/cast_mojo_media_client.h" 61 #include "chromecast/browser/media/cast_mojo_media_client.h"
61 #include "media/mojo/services/mojo_media_application.h" // nogncheck 62 #include "media/mojo/services/mojo_media_application.h" // nogncheck
62 #endif // ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS 63 #endif // ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS
63 64
64 #if defined(OS_ANDROID) 65 #if defined(OS_ANDROID)
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 217
217 void CastContentBrowserClient::AddNetworkHintsMessageFilter( 218 void CastContentBrowserClient::AddNetworkHintsMessageFilter(
218 int render_process_id, net::URLRequestContext* context) { 219 int render_process_id, net::URLRequestContext* context) {
219 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 220 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
220 221
221 content::RenderProcessHost* host = 222 content::RenderProcessHost* host =
222 content::RenderProcessHost::FromID(render_process_id); 223 content::RenderProcessHost::FromID(render_process_id);
223 if (!host) 224 if (!host)
224 return; 225 return;
225 226
226 scoped_refptr<content::BrowserMessageFilter> network_hints_message_filter( 227 network_hints_.reset(new network_hints::NetworkHintsMessageFilter(
227 new network_hints::NetworkHintsMessageFilter( 228 url_request_context_factory_->host_resolver()));
228 url_request_context_factory_->host_resolver())); 229 host->GetInterfaceRegistry()->AddInterface(
229 host->AddFilter(network_hints_message_filter.get()); 230 base::Bind(&network_hints::NetworkHintsMessageFilter::Bind,
231 base::Unretained(network_hints_.get())));
230 } 232 }
231 233
232 bool CastContentBrowserClient::IsHandledURL(const GURL& url) { 234 bool CastContentBrowserClient::IsHandledURL(const GURL& url) {
233 if (!url.is_valid()) 235 if (!url.is_valid())
234 return false; 236 return false;
235 237
236 static const char* const kProtocolList[] = { 238 static const char* const kProtocolList[] = {
237 content::kChromeUIScheme, 239 content::kChromeUIScheme,
238 content::kChromeDevToolsScheme, 240 content::kChromeDevToolsScheme,
239 kChromeResourceScheme, 241 kChromeResourceScheme,
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 process_type, dumps_path, false /* upload */); 554 process_type, dumps_path, false /* upload */);
553 // StartUploaderThread() even though upload is diferred. 555 // StartUploaderThread() even though upload is diferred.
554 // Breakpad-related memory is freed in the uploader thread. 556 // Breakpad-related memory is freed in the uploader thread.
555 crash_handler->StartUploaderThread(); 557 crash_handler->StartUploaderThread();
556 return crash_handler; 558 return crash_handler;
557 } 559 }
558 #endif // !defined(OS_ANDROID) 560 #endif // !defined(OS_ANDROID)
559 561
560 } // namespace shell 562 } // namespace shell
561 } // namespace chromecast 563 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698