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/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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 #include "content/renderer/v8_value_converter_impl.h" | 94 #include "content/renderer/v8_value_converter_impl.h" |
95 #include "content/renderer/web_intents_host.h" | 95 #include "content/renderer/web_intents_host.h" |
96 #include "content/renderer/web_ui_bindings.h" | 96 #include "content/renderer/web_ui_bindings.h" |
97 #include "content/renderer/webplugin_delegate_proxy.h" | 97 #include "content/renderer/webplugin_delegate_proxy.h" |
98 #include "content/renderer/websharedworker_proxy.h" | 98 #include "content/renderer/websharedworker_proxy.h" |
99 #include "media/base/filter_collection.h" | 99 #include "media/base/filter_collection.h" |
100 #include "media/base/media_switches.h" | 100 #include "media/base/media_switches.h" |
101 #include "media/base/message_loop_factory.h" | 101 #include "media/base/message_loop_factory.h" |
102 #include "media/filters/audio_renderer_impl.h" | 102 #include "media/filters/audio_renderer_impl.h" |
103 #include "media/filters/gpu_video_decoder.h" | 103 #include "media/filters/gpu_video_decoder.h" |
104 #include "net/base/data_url.h" | |
104 #include "net/base/escape.h" | 105 #include "net/base/escape.h" |
105 #include "net/base/net_errors.h" | 106 #include "net/base/net_errors.h" |
106 #include "net/http/http_util.h" | 107 #include "net/http/http_util.h" |
107 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec t.h" | 108 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec t.h" |
108 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h" | 109 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h" |
109 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMMessageEvent.h" | 110 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMMessageEvent.h" |
110 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" | 111 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" |
111 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 112 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
112 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 113 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
113 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams. h" | 114 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams. h" |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1044 // back/forward navigation event. | 1045 // back/forward navigation event. |
1045 if (is_reload) { | 1046 if (is_reload) { |
1046 bool ignore_cache = (params.navigation_type == | 1047 bool ignore_cache = (params.navigation_type == |
1047 ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE); | 1048 ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE); |
1048 main_frame->reload(ignore_cache); | 1049 main_frame->reload(ignore_cache); |
1049 } else if (!params.state.empty()) { | 1050 } else if (!params.state.empty()) { |
1050 // We must know the page ID of the page we are navigating back to. | 1051 // We must know the page ID of the page we are navigating back to. |
1051 DCHECK_NE(params.page_id, -1); | 1052 DCHECK_NE(params.page_id, -1); |
1052 main_frame->loadHistoryItem( | 1053 main_frame->loadHistoryItem( |
1053 webkit_glue::HistoryItemFromString(params.state)); | 1054 webkit_glue::HistoryItemFromString(params.state)); |
1055 } else if (!params.base_url_for_data_url.is_empty()) { | |
1056 // A loadData request with a specified base URL. | |
1057 std::string mime_type, charset, data; | |
1058 if (net::DataURL::Parse(params.url, &mime_type, &charset, &data)) { | |
Charlie Reis
2012/07/03 17:54:37
If this parsing fails (e.g., someone later tries t
mnaganov (inactive)
2012/07/04 15:25:57
Added an explicit bailout.
| |
1059 main_frame->loadData( | |
1060 WebData(data.c_str(), data.length()), | |
1061 WebString::fromUTF8(mime_type), | |
1062 WebString::fromUTF8(charset), | |
1063 params.base_url_for_data_url, | |
1064 params.history_url_for_data_url, | |
1065 false); | |
1066 } | |
1054 } else { | 1067 } else { |
1055 // Navigate to the given URL. | 1068 // Navigate to the given URL. |
1056 WebURLRequest request(params.url); | 1069 WebURLRequest request(params.url); |
1057 | 1070 |
1058 // A session history navigation should have been accompanied by state. | 1071 // A session history navigation should have been accompanied by state. |
1059 CHECK_EQ(params.page_id, -1); | 1072 CHECK_EQ(params.page_id, -1); |
1060 | 1073 |
1061 if (main_frame->isViewSourceModeEnabled()) | 1074 if (main_frame->isViewSourceModeEnabled()) |
1062 request.setCachePolicy(WebURLRequest::ReturnCacheDataElseLoad); | 1075 request.setCachePolicy(WebURLRequest::ReturnCacheDataElseLoad); |
1063 | 1076 |
(...skipping 4606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5670 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5683 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5671 return !!RenderThreadImpl::current()->compositor_thread(); | 5684 return !!RenderThreadImpl::current()->compositor_thread(); |
5672 } | 5685 } |
5673 | 5686 |
5674 void RenderViewImpl::OnJavaBridgeInit() { | 5687 void RenderViewImpl::OnJavaBridgeInit() { |
5675 DCHECK(!java_bridge_dispatcher_); | 5688 DCHECK(!java_bridge_dispatcher_); |
5676 #if defined(ENABLE_JAVA_BRIDGE) | 5689 #if defined(ENABLE_JAVA_BRIDGE) |
5677 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); | 5690 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); |
5678 #endif | 5691 #endif |
5679 } | 5692 } |
OLD | NEW |