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

Side by Side Diff: content/plugin/webplugin_delegate_stub.cc

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « content/plugin/plugin_thread.cc ('k') | content/plugin/webplugin_proxy.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 (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
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
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
OLDNEW
« no previous file with comments | « content/plugin/plugin_thread.cc ('k') | content/plugin/webplugin_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698