OLD | NEW |
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/renderer_host/render_message_filter.h" | 5 #include "content/browser/renderer_host/render_message_filter.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 plugin_service_(plugin_service), | 303 plugin_service_(plugin_service), |
304 profile_data_directory_(browser_context->GetPath()), | 304 profile_data_directory_(browser_context->GetPath()), |
305 request_context_(request_context), | 305 request_context_(request_context), |
306 resource_context_(browser_context->GetResourceContext()), | 306 resource_context_(browser_context->GetResourceContext()), |
307 render_widget_helper_(render_widget_helper), | 307 render_widget_helper_(render_widget_helper), |
308 incognito_(browser_context->IsOffTheRecord()), | 308 incognito_(browser_context->IsOffTheRecord()), |
309 dom_storage_context_(dom_storage_context), | 309 dom_storage_context_(dom_storage_context), |
310 render_process_id_(render_process_id), | 310 render_process_id_(render_process_id), |
311 cpu_usage_(0), | 311 cpu_usage_(0), |
312 media_internals_(media_internals) { | 312 media_internals_(media_internals) { |
313 DCHECK(request_context_); | 313 DCHECK(request_context_.get()); |
314 | 314 |
315 render_widget_helper_->Init(render_process_id_, resource_dispatcher_host_); | 315 render_widget_helper_->Init(render_process_id_, resource_dispatcher_host_); |
316 } | 316 } |
317 | 317 |
318 RenderMessageFilter::~RenderMessageFilter() { | 318 RenderMessageFilter::~RenderMessageFilter() { |
319 // This function should be called on the IO thread. | 319 // This function should be called on the IO thread. |
320 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 320 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
321 DCHECK(plugin_host_clients_.empty()); | 321 DCHECK(plugin_host_clients_.empty()); |
322 } | 322 } |
323 | 323 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 | 461 |
462 if (!can_create_window) { | 462 if (!can_create_window) { |
463 *route_id = MSG_ROUTING_NONE; | 463 *route_id = MSG_ROUTING_NONE; |
464 *main_frame_route_id = MSG_ROUTING_NONE; | 464 *main_frame_route_id = MSG_ROUTING_NONE; |
465 *surface_id = 0; | 465 *surface_id = 0; |
466 return; | 466 return; |
467 } | 467 } |
468 | 468 |
469 // This will clone the sessionStorage for namespace_id_to_clone. | 469 // This will clone the sessionStorage for namespace_id_to_clone. |
470 scoped_refptr<SessionStorageNamespaceImpl> cloned_namespace = | 470 scoped_refptr<SessionStorageNamespaceImpl> cloned_namespace = |
471 new SessionStorageNamespaceImpl(dom_storage_context_, | 471 new SessionStorageNamespaceImpl(dom_storage_context_.get(), |
472 params.session_storage_namespace_id); | 472 params.session_storage_namespace_id); |
473 *cloned_session_storage_namespace_id = cloned_namespace->id(); | 473 *cloned_session_storage_namespace_id = cloned_namespace->id(); |
474 | 474 |
475 render_widget_helper_->CreateNewWindow(params, | 475 render_widget_helper_->CreateNewWindow(params, |
476 no_javascript_access, | 476 no_javascript_access, |
477 peer_handle(), | 477 peer_handle(), |
478 route_id, | 478 route_id, |
479 main_frame_route_id, | 479 main_frame_route_id, |
480 surface_id, | 480 surface_id, |
481 cloned_namespace); | 481 cloned_namespace.get()); |
482 } | 482 } |
483 | 483 |
484 void RenderMessageFilter::OnCreateWidget(int opener_id, | 484 void RenderMessageFilter::OnCreateWidget(int opener_id, |
485 WebKit::WebPopupType popup_type, | 485 WebKit::WebPopupType popup_type, |
486 int* route_id, | 486 int* route_id, |
487 int* surface_id) { | 487 int* surface_id) { |
488 render_widget_helper_->CreateNewWidget( | 488 render_widget_helper_->CreateNewWidget( |
489 opener_id, popup_type, route_id, surface_id); | 489 opener_id, popup_type, route_id, surface_id); |
490 } | 490 } |
491 | 491 |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 DCHECK(cache); | 905 DCHECK(cache); |
906 | 906 |
907 // Use the same priority for the metadata write as for script | 907 // Use the same priority for the metadata write as for script |
908 // resources (see defaultPriorityForResourceType() in WebKit's | 908 // resources (see defaultPriorityForResourceType() in WebKit's |
909 // CachedResource.cpp). Note that WebURLRequest::PriorityMedium | 909 // CachedResource.cpp). Note that WebURLRequest::PriorityMedium |
910 // corresponds to net::LOW (see ConvertWebKitPriorityToNetPriority() | 910 // corresponds to net::LOW (see ConvertWebKitPriorityToNetPriority() |
911 // in weburlloader_impl.cc). | 911 // in weburlloader_impl.cc). |
912 const net::RequestPriority kPriority = net::LOW; | 912 const net::RequestPriority kPriority = net::LOW; |
913 scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(data.size())); | 913 scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(data.size())); |
914 memcpy(buf->data(), &data.front(), data.size()); | 914 memcpy(buf->data(), &data.front(), data.size()); |
915 cache->WriteMetadata( | 915 cache->WriteMetadata(url, |
916 url, kPriority, | 916 kPriority, |
917 base::Time::FromDoubleT(expected_response_time), buf, data.size()); | 917 base::Time::FromDoubleT(expected_response_time), |
| 918 buf.get(), |
| 919 data.size()); |
918 } | 920 } |
919 | 921 |
920 void RenderMessageFilter::OnKeygen(uint32 key_size_index, | 922 void RenderMessageFilter::OnKeygen(uint32 key_size_index, |
921 const std::string& challenge_string, | 923 const std::string& challenge_string, |
922 const GURL& url, | 924 const GURL& url, |
923 IPC::Message* reply_msg) { | 925 IPC::Message* reply_msg) { |
924 // Map displayed strings indicating level of keysecurity in the <keygen> | 926 // Map displayed strings indicating level of keysecurity in the <keygen> |
925 // menu to the key size in bits. (See SSLKeyGeneratorChromium.cpp in WebCore.) | 927 // menu to the key size in bits. (See SSLKeyGeneratorChromium.cpp in WebCore.) |
926 int key_size_in_bits; | 928 int key_size_in_bits; |
927 switch (key_size_index) { | 929 switch (key_size_index) { |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 // MediaCodec bridge is slow and can block while sending the data to | 1164 // MediaCodec bridge is slow and can block while sending the data to |
1163 // the renderer. | 1165 // the renderer. |
1164 base::WorkerPool::PostTask( | 1166 base::WorkerPool::PostTask( |
1165 FROM_HERE, | 1167 FROM_HERE, |
1166 base::Bind(&media::WebAudioMediaCodecBridge::RunWebAudioMediaCodec, | 1168 base::Bind(&media::WebAudioMediaCodecBridge::RunWebAudioMediaCodec, |
1167 encoded_data_handle, pcm_output, data_size), | 1169 encoded_data_handle, pcm_output, data_size), |
1168 true); | 1170 true); |
1169 } | 1171 } |
1170 #endif | 1172 #endif |
1171 } // namespace content | 1173 } // namespace content |
OLD | NEW |