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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 9677031: Bind RenderViewImpl routing_id to SocketStreamHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reflects review comments by tony and darin Created 8 years, 9 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) 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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 20 matching lines...) Expand all
31 #include "content/common/drag_messages.h" 31 #include "content/common/drag_messages.h"
32 #include "content/common/fileapi/file_system_dispatcher.h" 32 #include "content/common/fileapi/file_system_dispatcher.h"
33 #include "content/common/fileapi/webfilesystem_callback_dispatcher.h" 33 #include "content/common/fileapi/webfilesystem_callback_dispatcher.h"
34 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 34 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
35 #include "content/common/intents_messages.h" 35 #include "content/common/intents_messages.h"
36 #include "content/common/java_bridge_messages.h" 36 #include "content/common/java_bridge_messages.h"
37 #include "content/common/pepper_messages.h" 37 #include "content/common/pepper_messages.h"
38 #include "content/common/pepper_plugin_registry.h" 38 #include "content/common/pepper_plugin_registry.h"
39 #include "content/common/quota_dispatcher.h" 39 #include "content/common/quota_dispatcher.h"
40 #include "content/common/request_extra_data.h" 40 #include "content/common/request_extra_data.h"
41 #include "content/common/socket_stream_handle_data.h"
41 #include "content/common/view_messages.h" 42 #include "content/common/view_messages.h"
42 #include "content/public/common/bindings_policy.h" 43 #include "content/public/common/bindings_policy.h"
43 #include "content/public/common/content_client.h" 44 #include "content/public/common/content_client.h"
44 #include "content/public/common/content_constants.h" 45 #include "content/public/common/content_constants.h"
45 #include "content/public/common/content_switches.h" 46 #include "content/public/common/content_switches.h"
46 #include "content/public/common/context_menu_params.h" 47 #include "content/public/common/context_menu_params.h"
47 #include "content/public/common/file_chooser_params.h" 48 #include "content/public/common/file_chooser_params.h"
48 #include "content/public/common/selected_file_info.h" 49 #include "content/public/common/selected_file_info.h"
49 #include "content/public/common/url_constants.h" 50 #include "content/public/common/url_constants.h"
50 #include "content/public/renderer/content_renderer_client.h" 51 #include "content/public/renderer/content_renderer_client.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" 135 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h"
135 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h " 136 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h "
136 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebDragData. h" 137 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebDragData. h"
137 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsC ontext3D.h" 138 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsC ontext3D.h"
138 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebImage.h" 139 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebImage.h"
139 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne ctionHandler.h" 140 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne ctionHandler.h"
140 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne ctionHandlerClient.h" 141 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne ctionHandlerClient.h"
141 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" 142 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h"
142 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" 143 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h"
143 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" 144 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h"
145 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSocketStr eamHandle.h"
144 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" 146 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
145 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" 147 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
146 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError. h" 148 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError. h"
147 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques t.h" 149 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques t.h"
148 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRespon se.h" 150 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRespon se.h"
149 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" 151 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
150 #include "third_party/skia/include/core/SkBitmap.h" 152 #include "third_party/skia/include/core/SkBitmap.h"
151 #include "ui/base/javascript_message_type.h" 153 #include "ui/base/javascript_message_type.h"
152 #include "ui/gfx/native_widget_types.h" 154 #include "ui/gfx/native_widget_types.h"
153 #include "ui/gfx/point.h" 155 #include "ui/gfx/point.h"
154 #include "ui/gfx/rect.h" 156 #include "ui/gfx/rect.h"
155 #include "v8/include/v8.h" 157 #include "v8/include/v8.h"
156 #include "webkit/appcache/web_application_cache_host_impl.h" 158 #include "webkit/appcache/web_application_cache_host_impl.h"
157 #include "webkit/forms/form_data.h" 159 #include "webkit/forms/form_data.h"
158 #include "webkit/forms/form_field.h" 160 #include "webkit/forms/form_field.h"
159 #include "webkit/forms/password_form_dom_manager.h" 161 #include "webkit/forms/password_form_dom_manager.h"
160 #include "webkit/glue/alt_error_page_resource_fetcher.h" 162 #include "webkit/glue/alt_error_page_resource_fetcher.h"
161 #include "webkit/glue/dom_operations.h" 163 #include "webkit/glue/dom_operations.h"
162 #include "webkit/glue/glue_serialize.h" 164 #include "webkit/glue/glue_serialize.h"
163 #include "webkit/glue/webdropdata.h" 165 #include "webkit/glue/webdropdata.h"
164 #include "webkit/glue/webkit_constants.h" 166 #include "webkit/glue/webkit_constants.h"
165 #include "webkit/glue/webkit_glue.h" 167 #include "webkit/glue/webkit_glue.h"
168 #include "webkit/glue/websocketstreamhandle_impl.h"
166 #include "webkit/glue/weburlloader_impl.h" 169 #include "webkit/glue/weburlloader_impl.h"
167 #include "webkit/glue/weburlresponse_extradata_impl.h" 170 #include "webkit/glue/weburlresponse_extradata_impl.h"
168 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" 171 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
169 #include "webkit/media/webmediaplayer_impl.h" 172 #include "webkit/media/webmediaplayer_impl.h"
170 #include "webkit/plugins/npapi/plugin_list.h" 173 #include "webkit/plugins/npapi/plugin_list.h"
171 #include "webkit/plugins/npapi/webplugin_delegate.h" 174 #include "webkit/plugins/npapi/webplugin_delegate.h"
172 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" 175 #include "webkit/plugins/npapi/webplugin_delegate_impl.h"
173 #include "webkit/plugins/npapi/webplugin_impl.h" 176 #include "webkit/plugins/npapi/webplugin_impl.h"
174 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" 177 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h"
175 178
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 using WebKit::WebRange; 239 using WebKit::WebRange;
237 using WebKit::WebRect; 240 using WebKit::WebRect;
238 using WebKit::WebReferrerPolicy; 241 using WebKit::WebReferrerPolicy;
239 using WebKit::WebScriptSource; 242 using WebKit::WebScriptSource;
240 using WebKit::WebSearchableFormData; 243 using WebKit::WebSearchableFormData;
241 using WebKit::WebSecurityOrigin; 244 using WebKit::WebSecurityOrigin;
242 using WebKit::WebSecurityPolicy; 245 using WebKit::WebSecurityPolicy;
243 using WebKit::WebSettings; 246 using WebKit::WebSettings;
244 using WebKit::WebSharedWorker; 247 using WebKit::WebSharedWorker;
245 using WebKit::WebSize; 248 using WebKit::WebSize;
249 using WebKit::WebSocketStreamHandle;
246 using WebKit::WebStorageNamespace; 250 using WebKit::WebStorageNamespace;
247 using WebKit::WebStorageQuotaCallbacks; 251 using WebKit::WebStorageQuotaCallbacks;
248 using WebKit::WebStorageQuotaError; 252 using WebKit::WebStorageQuotaError;
249 using WebKit::WebStorageQuotaType; 253 using WebKit::WebStorageQuotaType;
250 using WebKit::WebString; 254 using WebKit::WebString;
251 using WebKit::WebTextAffinity; 255 using WebKit::WebTextAffinity;
252 using WebKit::WebTextDirection; 256 using WebKit::WebTextDirection;
253 using WebKit::WebTouchEvent; 257 using WebKit::WebTouchEvent;
254 using WebKit::WebURL; 258 using WebKit::WebURL;
255 using WebKit::WebURLError; 259 using WebKit::WebURLError;
(...skipping 11 matching lines...) Expand all
267 using content::RenderThread; 271 using content::RenderThread;
268 using content::RenderViewObserver; 272 using content::RenderViewObserver;
269 using content::RenderViewVisitor; 273 using content::RenderViewVisitor;
270 using content::Referrer; 274 using content::Referrer;
271 using content::V8ValueConverter; 275 using content::V8ValueConverter;
272 using webkit::forms::FormField; 276 using webkit::forms::FormField;
273 using webkit::forms::PasswordForm; 277 using webkit::forms::PasswordForm;
274 using webkit::forms::PasswordFormDomManager; 278 using webkit::forms::PasswordFormDomManager;
275 using webkit_glue::AltErrorPageResourceFetcher; 279 using webkit_glue::AltErrorPageResourceFetcher;
276 using webkit_glue::ResourceFetcher; 280 using webkit_glue::ResourceFetcher;
281 using webkit_glue::WebSocketStreamHandleImpl;
277 using webkit_glue::WebURLResponseExtraDataImpl; 282 using webkit_glue::WebURLResponseExtraDataImpl;
278 283
279 //----------------------------------------------------------------------------- 284 //-----------------------------------------------------------------------------
280 285
281 typedef std::map<WebKit::WebView*, RenderViewImpl*> ViewMap; 286 typedef std::map<WebKit::WebView*, RenderViewImpl*> ViewMap;
282 static base::LazyInstance<ViewMap> g_view_map = LAZY_INSTANCE_INITIALIZER; 287 static base::LazyInstance<ViewMap> g_view_map = LAZY_INSTANCE_INITIALIZER;
283 288
284 // Time, in seconds, we delay before sending content state changes (such as form 289 // Time, in seconds, we delay before sending content state changes (such as form
285 // state and scroll position) to the browser. We delay sending changes to avoid 290 // state and scroll position) to the browser. We delay sending changes to avoid
286 // spamming the browser. 291 // spamming the browser.
(...skipping 3104 matching lines...) Expand 10 before | Expand all | Expand 10 after
3391 } 3396 }
3392 3397
3393 void RenderViewImpl::dispatchIntent( 3398 void RenderViewImpl::dispatchIntent(
3394 WebFrame* frame, const WebIntentRequest& intentRequest) { 3399 WebFrame* frame, const WebIntentRequest& intentRequest) {
3395 webkit_glue::WebIntentData intent_data(intentRequest.intent()); 3400 webkit_glue::WebIntentData intent_data(intentRequest.intent());
3396 int id = intents_host_->RegisterWebIntent(intentRequest); 3401 int id = intents_host_->RegisterWebIntent(intentRequest);
3397 Send(new IntentsHostMsg_WebIntentDispatch( 3402 Send(new IntentsHostMsg_WebIntentDispatch(
3398 routing_id_, intent_data, id)); 3403 routing_id_, intent_data, id));
3399 } 3404 }
3400 3405
3406 void RenderViewImpl::willOpenSocketStream(
3407 WebSocketStreamHandle* handle) {
3408 WebSocketStreamHandleImpl* impl =
3409 static_cast<WebSocketStreamHandleImpl*>(handle);
3410 if (impl)
3411 impl->SetUserData(handle, new SocketStreamHandleData(routing_id_));
3412 }
3413
3401 // WebKit::WebPageSerializerClient implementation ------------------------------ 3414 // WebKit::WebPageSerializerClient implementation ------------------------------
3402 3415
3403 void RenderViewImpl::didSerializeDataForFrame( 3416 void RenderViewImpl::didSerializeDataForFrame(
3404 const WebURL& frame_url, 3417 const WebURL& frame_url,
3405 const WebCString& data, 3418 const WebCString& data,
3406 WebPageSerializerClient::PageSerializationStatus status) { 3419 WebPageSerializerClient::PageSerializationStatus status) {
3407 Send(new ViewHostMsg_SendSerializedHtmlData( 3420 Send(new ViewHostMsg_SendSerializedHtmlData(
3408 routing_id(), 3421 routing_id(),
3409 frame_url, 3422 frame_url,
3410 data.data(), 3423 data.data(),
(...skipping 1771 matching lines...) Expand 10 before | Expand all | Expand 10 after
5182 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 5195 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
5183 return !!RenderThreadImpl::current()->compositor_thread(); 5196 return !!RenderThreadImpl::current()->compositor_thread();
5184 } 5197 }
5185 5198
5186 void RenderViewImpl::OnJavaBridgeInit() { 5199 void RenderViewImpl::OnJavaBridgeInit() {
5187 DCHECK(!java_bridge_dispatcher_.get()); 5200 DCHECK(!java_bridge_dispatcher_.get());
5188 #if defined(ENABLE_JAVA_BRIDGE) 5201 #if defined(ENABLE_JAVA_BRIDGE)
5189 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); 5202 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this));
5190 #endif 5203 #endif
5191 } 5204 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698