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/plugin/webplugin_delegate_stub.h" | 5 #include "content/plugin/webplugin_delegate_stub.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 DCHECK(channel); | 58 DCHECK(channel); |
59 } | 59 } |
60 | 60 |
61 WebPluginDelegateStub::~WebPluginDelegateStub() { | 61 WebPluginDelegateStub::~WebPluginDelegateStub() { |
62 in_destructor_ = true; | 62 in_destructor_ = true; |
63 GetContentClient()->SetActiveURL(page_url_); | 63 GetContentClient()->SetActiveURL(page_url_); |
64 | 64 |
65 if (channel_->in_send()) { | 65 if (channel_->in_send()) { |
66 // The delegate or an npobject is in the callstack, so don't delete it | 66 // The delegate or an npobject is in the callstack, so don't delete it |
67 // right away. | 67 // right away. |
68 MessageLoop::current()->PostNonNestableTask(FROM_HERE, | 68 base::MessageLoop::current()->PostNonNestableTask( |
69 base::Bind(&DestroyWebPluginAndDelegate, plugin_scriptable_object_, | 69 FROM_HERE, |
70 delegate_, webplugin_)); | 70 base::Bind(&DestroyWebPluginAndDelegate, |
| 71 plugin_scriptable_object_, |
| 72 delegate_, |
| 73 webplugin_)); |
71 } else { | 74 } else { |
72 // Safe to delete right away. | 75 // Safe to delete right away. |
73 DestroyWebPluginAndDelegate( | 76 DestroyWebPluginAndDelegate( |
74 plugin_scriptable_object_, delegate_, webplugin_); | 77 plugin_scriptable_object_, delegate_, webplugin_); |
75 } | 78 } |
76 } | 79 } |
77 | 80 |
78 bool WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) { | 81 bool WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) { |
79 GetContentClient()->SetActiveURL(page_url_); | 82 GetContentClient()->SetActiveURL(page_url_); |
80 | 83 |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 } | 390 } |
388 | 391 |
389 void WebPluginDelegateStub::OnHTTPRangeRequestReply( | 392 void WebPluginDelegateStub::OnHTTPRangeRequestReply( |
390 unsigned long resource_id, int range_request_id) { | 393 unsigned long resource_id, int range_request_id) { |
391 WebPluginResourceClient* resource_client = | 394 WebPluginResourceClient* resource_client = |
392 delegate_->CreateSeekableResourceClient(resource_id, range_request_id); | 395 delegate_->CreateSeekableResourceClient(resource_id, range_request_id); |
393 webplugin_->OnResourceCreated(resource_id, resource_client); | 396 webplugin_->OnResourceCreated(resource_id, resource_client); |
394 } | 397 } |
395 | 398 |
396 } // namespace content | 399 } // namespace content |
OLD | NEW |