OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper_plugin_delegate_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
14 #include "base/file_util_proxy.h" | 14 #include "base/file_util_proxy.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/string_split.h" | 17 #include "base/string_split.h" |
18 #include "base/sync_socket.h" | 18 #include "base/sync_socket.h" |
19 #include "base/task.h" | 19 #include "base/task.h" |
20 #include "base/time.h" | 20 #include "base/time.h" |
21 #include "content/common/child_process_messages.h" | |
22 #include "content/common/child_process.h" | 21 #include "content/common/child_process.h" |
23 #include "content/common/child_thread.h" | 22 #include "content/common/child_thread.h" |
24 #include "content/common/content_switches.h" | 23 #include "content/common/content_switches.h" |
25 #include "content/common/file_system/file_system_dispatcher.h" | 24 #include "content/common/file_system/file_system_dispatcher.h" |
26 #include "content/common/file_system_messages.h" | 25 #include "content/common/file_system_messages.h" |
27 #include "content/common/media/audio_messages.h" | 26 #include "content/common/media/audio_messages.h" |
28 #include "content/common/pepper_file_messages.h" | 27 #include "content/common/pepper_file_messages.h" |
29 #include "content/common/pepper_plugin_registry.h" | 28 #include "content/common/pepper_plugin_registry.h" |
30 #include "content/common/pepper_messages.h" | 29 #include "content/common/pepper_messages.h" |
31 #include "content/common/quota_dispatcher.h" | 30 #include "content/common/quota_dispatcher.h" |
(...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 void PepperPluginDelegateImpl::SubscribeToPolicyUpdates( | 1396 void PepperPluginDelegateImpl::SubscribeToPolicyUpdates( |
1398 webkit::ppapi::PluginInstance* instance) { | 1397 webkit::ppapi::PluginInstance* instance) { |
1399 subscribed_to_policy_updates_.insert(instance); | 1398 subscribed_to_policy_updates_.insert(instance); |
1400 | 1399 |
1401 // TODO(ajwong): Make this only send an update to the current instance, | 1400 // TODO(ajwong): Make this only send an update to the current instance, |
1402 // and not all subscribed plugin instances. | 1401 // and not all subscribed plugin instances. |
1403 render_view_->RequestRemoteAccessClientFirewallTraversal(); | 1402 render_view_->RequestRemoteAccessClientFirewallTraversal(); |
1404 } | 1403 } |
1405 | 1404 |
1406 std::string PepperPluginDelegateImpl::ResolveProxy(const GURL& url) { | 1405 std::string PepperPluginDelegateImpl::ResolveProxy(const GURL& url) { |
1407 int net_error; | 1406 bool result; |
1408 std::string proxy_result; | 1407 std::string proxy_result; |
1409 RenderThread::current()->Send( | 1408 RenderThread::current()->Send( |
1410 new ChildProcessHostMsg_ResolveProxy(url, &net_error, &proxy_result)); | 1409 new ViewHostMsg_ResolveProxy(url, &result, &proxy_result)); |
1411 return proxy_result; | 1410 return proxy_result; |
1412 } | 1411 } |
1413 | 1412 |
1414 void PepperPluginDelegateImpl::DidStartLoading() { | 1413 void PepperPluginDelegateImpl::DidStartLoading() { |
1415 render_view_->DidStartLoadingForPlugin(); | 1414 render_view_->DidStartLoadingForPlugin(); |
1416 } | 1415 } |
1417 | 1416 |
1418 void PepperPluginDelegateImpl::DidStopLoading() { | 1417 void PepperPluginDelegateImpl::DidStopLoading() { |
1419 render_view_->DidStopLoadingForPlugin(); | 1418 render_view_->DidStopLoadingForPlugin(); |
1420 } | 1419 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 | 1476 |
1478 int PepperPluginDelegateImpl::GetRoutingId() const { | 1477 int PepperPluginDelegateImpl::GetRoutingId() const { |
1479 return render_view_->routing_id(); | 1478 return render_view_->routing_id(); |
1480 } | 1479 } |
1481 | 1480 |
1482 void PepperPluginDelegateImpl::PublishInitialPolicy( | 1481 void PepperPluginDelegateImpl::PublishInitialPolicy( |
1483 scoped_refptr<webkit::ppapi::PluginInstance> instance, | 1482 scoped_refptr<webkit::ppapi::PluginInstance> instance, |
1484 const std::string& policy) { | 1483 const std::string& policy) { |
1485 instance->HandlePolicyUpdate(policy); | 1484 instance->HandlePolicyUpdate(policy); |
1486 } | 1485 } |
OLD | NEW |