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

Side by Side Diff: webkit/plugins/npapi/plugin_stream_url.cc

Issue 11189146: Eliminate implicit conversion from scoped_refptr<T> to T* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "webkit/plugins/npapi/plugin_stream_url.h" 5 #include "webkit/plugins/npapi/plugin_stream_url.h"
6 6
7 #include "net/http/http_response_headers.h" 7 #include "net/http/http_response_headers.h"
8 #include "webkit/plugins/npapi/plugin_host.h" 8 #include "webkit/plugins/npapi/plugin_host.h"
9 #include "webkit/plugins/npapi/plugin_instance.h" 9 #include "webkit/plugins/npapi/plugin_instance.h"
10 #include "webkit/plugins/npapi/plugin_lib.h" 10 #include "webkit/plugins/npapi/plugin_lib.h"
(...skipping 18 matching lines...) Expand all
29 instance()->webplugin()->ResourceClientDeleted(AsResourceClient()); 29 instance()->webplugin()->ResourceClientDeleted(AsResourceClient());
30 } 30 }
31 } 31 }
32 32
33 bool PluginStreamUrl::Close(NPReason reason) { 33 bool PluginStreamUrl::Close(NPReason reason) {
34 // Protect the stream against it being destroyed or the whole plugin instance 34 // Protect the stream against it being destroyed or the whole plugin instance
35 // being destroyed within the destroy stream handler. 35 // being destroyed within the destroy stream handler.
36 scoped_refptr<PluginStream> protect(this); 36 scoped_refptr<PluginStream> protect(this);
37 CancelRequest(); 37 CancelRequest();
38 bool result = PluginStream::Close(reason); 38 bool result = PluginStream::Close(reason);
39 instance()->RemoveStream(this); 39 instance()->RemoveStream(protect);
40 return result; 40 return result;
41 } 41 }
42 42
43 WebPluginResourceClient* PluginStreamUrl::AsResourceClient() { 43 WebPluginResourceClient* PluginStreamUrl::AsResourceClient() {
44 return static_cast<WebPluginResourceClient*>(this); 44 return static_cast<WebPluginResourceClient*>(this);
45 } 45 }
46 46
47 void PluginStreamUrl::WillSendRequest(const GURL& url, int http_status_code) { 47 void PluginStreamUrl::WillSendRequest(const GURL& url, int http_status_code) {
48 if (notify_needed()) { 48 if (notify_needed()) {
49 // If the plugin participates in HTTP url redirect handling then notify it. 49 // If the plugin participates in HTTP url redirect handling then notify it.
(...skipping 18 matching lines...) Expand all
68 // being destroyed within the new stream handler. 68 // being destroyed within the new stream handler.
69 scoped_refptr<PluginStream> protect(this); 69 scoped_refptr<PluginStream> protect(this);
70 70
71 bool opened = Open(mime_type, 71 bool opened = Open(mime_type,
72 headers, 72 headers,
73 expected_length, 73 expected_length,
74 last_modified, 74 last_modified,
75 request_is_seekable); 75 request_is_seekable);
76 if (!opened) { 76 if (!opened) {
77 CancelRequest(); 77 CancelRequest();
78 instance()->RemoveStream(this); 78 instance()->RemoveStream(protect);
79 } else { 79 } else {
80 if (id_ > 0) 80 if (id_ > 0)
81 instance()->webplugin()->SetDeferResourceLoading(id_, false); 81 instance()->webplugin()->SetDeferResourceLoading(id_, false);
82 } 82 }
83 } 83 }
84 84
85 void PluginStreamUrl::DidReceiveData(const char* buffer, int length, 85 void PluginStreamUrl::DidReceiveData(const char* buffer, int length,
86 int data_offset) { 86 int data_offset) {
87 if (!open()) 87 if (!open())
88 return; 88 return;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 if (id_ > 0) { 123 if (id_ > 0) {
124 if (instance()->webplugin()) { 124 if (instance()->webplugin()) {
125 instance()->webplugin()->CancelResource(id_); 125 instance()->webplugin()->CancelResource(id_);
126 } 126 }
127 id_ = 0; 127 id_ = 0;
128 } 128 }
129 } 129 }
130 130
131 } // namespace npapi 131 } // namespace npapi
132 } // namespace webkit 132 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/npapi/plugin_instance.cc ('k') | webkit/plugins/npapi/webplugin_delegate_impl_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698