OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/auto_reset.h" | 12 #include "base/auto_reset.h" |
| 13 #include "base/bind_helpers.h" |
13 #include "base/command_line.h" | 14 #include "base/command_line.h" |
14 #include "base/debug/alias.h" | 15 #include "base/debug/alias.h" |
15 #include "base/debug/asan_invalid_access.h" | 16 #include "base/debug/asan_invalid_access.h" |
16 #include "base/debug/crash_logging.h" | 17 #include "base/debug/crash_logging.h" |
17 #include "base/debug/dump_without_crashing.h" | 18 #include "base/debug/dump_without_crashing.h" |
18 #include "base/files/file.h" | 19 #include "base/files/file.h" |
19 #include "base/i18n/char_iterator.h" | 20 #include "base/i18n/char_iterator.h" |
20 #include "base/logging.h" | 21 #include "base/logging.h" |
21 #include "base/macros.h" | 22 #include "base/macros.h" |
22 #include "base/memory/ptr_util.h" | 23 #include "base/memory/ptr_util.h" |
23 #include "base/memory/shared_memory.h" | 24 #include "base/memory/shared_memory.h" |
24 #include "base/memory/weak_ptr.h" | 25 #include "base/memory/weak_ptr.h" |
25 #include "base/metrics/field_trial.h" | 26 #include "base/metrics/field_trial.h" |
26 #include "base/metrics/histogram_macros.h" | 27 #include "base/metrics/histogram_macros.h" |
27 #include "base/process/process.h" | 28 #include "base/process/process.h" |
28 #include "base/stl_util.h" | 29 #include "base/stl_util.h" |
29 #include "base/strings/string16.h" | 30 #include "base/strings/string16.h" |
30 #include "base/strings/utf_string_conversions.h" | 31 #include "base/strings/utf_string_conversions.h" |
| 32 #include "base/task_runner_util.h" |
31 #include "base/threading/thread_task_runner_handle.h" | 33 #include "base/threading/thread_task_runner_handle.h" |
32 #include "base/time/time.h" | 34 #include "base/time/time.h" |
33 #include "base/trace_event/trace_event.h" | 35 #include "base/trace_event/trace_event.h" |
34 #include "build/build_config.h" | 36 #include "build/build_config.h" |
35 #include "cc/base/switches.h" | 37 #include "cc/base/switches.h" |
36 #include "content/child/appcache/appcache_dispatcher.h" | 38 #include "content/child/appcache/appcache_dispatcher.h" |
37 #include "content/child/quota_dispatcher.h" | 39 #include "content/child/quota_dispatcher.h" |
38 #include "content/child/request_extra_data.h" | 40 #include "content/child/request_extra_data.h" |
39 #include "content/child/service_worker/service_worker_handle_reference.h" | 41 #include "content/child/service_worker/service_worker_handle_reference.h" |
40 #include "content/child/service_worker/service_worker_network_provider.h" | 42 #include "content/child/service_worker/service_worker_network_provider.h" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 #if defined(ENABLE_MOJO_RENDERER) | 245 #if defined(ENABLE_MOJO_RENDERER) |
244 #include "media/mojo/clients/mojo_renderer_factory.h" // nogncheck | 246 #include "media/mojo/clients/mojo_renderer_factory.h" // nogncheck |
245 #else | 247 #else |
246 #include "media/renderers/default_renderer_factory.h" | 248 #include "media/renderers/default_renderer_factory.h" |
247 #endif | 249 #endif |
248 | 250 |
249 #if defined(ENABLE_MOJO_AUDIO_DECODER) || defined(ENABLE_MOJO_VIDEO_DECODER) | 251 #if defined(ENABLE_MOJO_AUDIO_DECODER) || defined(ENABLE_MOJO_VIDEO_DECODER) |
250 #include "media/mojo/clients/mojo_decoder_factory.h" // nogncheck | 252 #include "media/mojo/clients/mojo_decoder_factory.h" // nogncheck |
251 #endif | 253 #endif |
252 | 254 |
| 255 using base::Time; |
| 256 using base::TimeDelta; |
253 using blink::WebCachePolicy; | 257 using blink::WebCachePolicy; |
254 using blink::WebContentDecryptionModule; | 258 using blink::WebContentDecryptionModule; |
255 using blink::WebContextMenuData; | 259 using blink::WebContextMenuData; |
256 using blink::WebCString; | 260 using blink::WebCString; |
257 using blink::WebData; | 261 using blink::WebData; |
258 using blink::WebDataSource; | 262 using blink::WebDataSource; |
259 using blink::WebDocument; | 263 using blink::WebDocument; |
260 using blink::WebDOMEvent; | 264 using blink::WebDOMEvent; |
261 using blink::WebDOMMessageEvent; | 265 using blink::WebDOMMessageEvent; |
262 using blink::WebElement; | 266 using blink::WebElement; |
(...skipping 23 matching lines...) Expand all Loading... |
286 using blink::WebReferrerPolicy; | 290 using blink::WebReferrerPolicy; |
287 using blink::WebScriptSource; | 291 using blink::WebScriptSource; |
288 using blink::WebSearchableFormData; | 292 using blink::WebSearchableFormData; |
289 using blink::WebSecurityOrigin; | 293 using blink::WebSecurityOrigin; |
290 using blink::WebSecurityPolicy; | 294 using blink::WebSecurityPolicy; |
291 using blink::WebSerializedScriptValue; | 295 using blink::WebSerializedScriptValue; |
292 using blink::WebServiceWorkerProvider; | 296 using blink::WebServiceWorkerProvider; |
293 using blink::WebSettings; | 297 using blink::WebSettings; |
294 using blink::WebStorageQuotaCallbacks; | 298 using blink::WebStorageQuotaCallbacks; |
295 using blink::WebString; | 299 using blink::WebString; |
| 300 using blink::WebThreadSafeData; |
296 using blink::WebURL; | 301 using blink::WebURL; |
297 using blink::WebURLError; | 302 using blink::WebURLError; |
298 using blink::WebURLRequest; | 303 using blink::WebURLRequest; |
299 using blink::WebURLResponse; | 304 using blink::WebURLResponse; |
300 using blink::WebUserGestureIndicator; | 305 using blink::WebUserGestureIndicator; |
301 using blink::WebVector; | 306 using blink::WebVector; |
302 using blink::WebView; | 307 using blink::WebView; |
303 using base::Time; | |
304 using base::TimeDelta; | |
305 | 308 |
306 #if defined(OS_ANDROID) | 309 #if defined(OS_ANDROID) |
307 using blink::WebFloatPoint; | 310 using blink::WebFloatPoint; |
308 using blink::WebFloatRect; | 311 using blink::WebFloatRect; |
309 #endif | 312 #endif |
310 | 313 |
311 #define STATIC_ASSERT_ENUM(a, b) \ | 314 #define STATIC_ASSERT_ENUM(a, b) \ |
312 static_assert(static_cast<int>(a) == static_cast<int>(b), \ | 315 static_assert(static_cast<int>(a) == static_cast<int>(b), \ |
313 "mismatching enums: " #a) | 316 "mismatching enums: " #a) |
314 | 317 |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 | 722 |
720 private: | 723 private: |
721 const std::map<GURL, base::FilePath>& url_to_local_path_; | 724 const std::map<GURL, base::FilePath>& url_to_local_path_; |
722 const std::map<int, base::FilePath>& frame_routing_id_to_local_path_; | 725 const std::map<int, base::FilePath>& frame_routing_id_to_local_path_; |
723 }; | 726 }; |
724 | 727 |
725 // Implementation of WebFrameSerializer::MHTMLPartsGenerationDelegate that | 728 // Implementation of WebFrameSerializer::MHTMLPartsGenerationDelegate that |
726 // 1. Bases shouldSkipResource and getContentID responses on contents of | 729 // 1. Bases shouldSkipResource and getContentID responses on contents of |
727 // FrameMsg_SerializeAsMHTML_Params. | 730 // FrameMsg_SerializeAsMHTML_Params. |
728 // 2. Stores digests of urls of serialized resources (i.e. urls reported via | 731 // 2. Stores digests of urls of serialized resources (i.e. urls reported via |
729 // shouldSkipResource) into |digests_of_uris_of_serialized_resources| passed | 732 // shouldSkipResource) into |serialized_resources_uri_digests| passed |
730 // to the constructor. | 733 // to the constructor. |
731 class MHTMLPartsGenerationDelegate | 734 class MHTMLPartsGenerationDelegate |
732 : public WebFrameSerializer::MHTMLPartsGenerationDelegate { | 735 : public WebFrameSerializer::MHTMLPartsGenerationDelegate { |
733 public: | 736 public: |
734 MHTMLPartsGenerationDelegate( | 737 MHTMLPartsGenerationDelegate( |
735 const FrameMsg_SerializeAsMHTML_Params& params, | 738 const FrameMsg_SerializeAsMHTML_Params& params, |
736 std::set<std::string>* digests_of_uris_of_serialized_resources) | 739 std::set<std::string>* serialized_resources_uri_digests) |
737 : params_(params), | 740 : params_(params), |
738 digests_of_uris_of_serialized_resources_( | 741 serialized_resources_uri_digests_(serialized_resources_uri_digests) { |
739 digests_of_uris_of_serialized_resources) { | 742 DCHECK(serialized_resources_uri_digests_); |
740 DCHECK(digests_of_uris_of_serialized_resources_); | |
741 } | 743 } |
742 | 744 |
743 bool shouldSkipResource(const WebURL& url) override { | 745 bool shouldSkipResource(const WebURL& url) override { |
744 std::string digest = | 746 std::string digest = |
745 crypto::SHA256HashString(params_.salt + GURL(url).spec()); | 747 crypto::SHA256HashString(params_.salt + GURL(url).spec()); |
746 | 748 |
747 // Skip if the |url| already covered by serialization of an *earlier* frame. | 749 // Skip if the |url| already covered by serialization of an *earlier* frame. |
748 if (base::ContainsKey(params_.digests_of_uris_to_skip, digest)) | 750 if (base::ContainsKey(params_.digests_of_uris_to_skip, digest)) |
749 return true; | 751 return true; |
750 | 752 |
751 // Let's record |url| as being serialized for the *current* frame. | 753 // Let's record |url| as being serialized for the *current* frame. |
752 auto pair = digests_of_uris_of_serialized_resources_->insert(digest); | 754 auto pair = serialized_resources_uri_digests_->insert(digest); |
753 bool insertion_took_place = pair.second; | 755 bool insertion_took_place = pair.second; |
754 DCHECK(insertion_took_place); // Blink should dedupe within a frame. | 756 DCHECK(insertion_took_place); // Blink should dedupe within a frame. |
755 | 757 |
756 return false; | 758 return false; |
757 } | 759 } |
758 | 760 |
759 WebString getContentID(WebFrame* frame) override { | 761 WebString getContentID(WebFrame* frame) override { |
760 int routing_id = GetRoutingIdForFrameOrProxy(frame); | 762 int routing_id = GetRoutingIdForFrameOrProxy(frame); |
761 | 763 |
762 auto it = params_.frame_routing_id_to_content_id.find(routing_id); | 764 auto it = params_.frame_routing_id_to_content_id.find(routing_id); |
763 if (it == params_.frame_routing_id_to_content_id.end()) | 765 if (it == params_.frame_routing_id_to_content_id.end()) |
764 return WebString(); | 766 return WebString(); |
765 | 767 |
766 const std::string& content_id = it->second; | 768 const std::string& content_id = it->second; |
767 return WebString::fromUTF8(content_id); | 769 return WebString::fromUTF8(content_id); |
768 } | 770 } |
769 | 771 |
770 blink::WebFrameSerializerCacheControlPolicy cacheControlPolicy() override { | 772 blink::WebFrameSerializerCacheControlPolicy cacheControlPolicy() override { |
771 return params_.mhtml_cache_control_policy; | 773 return params_.mhtml_cache_control_policy; |
772 } | 774 } |
773 | 775 |
774 bool useBinaryEncoding() override { return params_.mhtml_binary_encoding; } | 776 bool useBinaryEncoding() override { return params_.mhtml_binary_encoding; } |
775 | 777 |
776 private: | 778 private: |
777 const FrameMsg_SerializeAsMHTML_Params& params_; | 779 const FrameMsg_SerializeAsMHTML_Params& params_; |
778 std::set<std::string>* digests_of_uris_of_serialized_resources_; | 780 std::set<std::string>* serialized_resources_uri_digests_; |
779 | 781 |
780 DISALLOW_COPY_AND_ASSIGN(MHTMLPartsGenerationDelegate); | 782 DISALLOW_COPY_AND_ASSIGN(MHTMLPartsGenerationDelegate); |
781 }; | 783 }; |
782 | 784 |
783 bool IsHttpPost(const blink::WebURLRequest& request) { | 785 bool IsHttpPost(const blink::WebURLRequest& request) { |
784 return request.httpMethod().utf8() == "POST"; | 786 return request.httpMethod().utf8() == "POST"; |
785 } | 787 } |
786 | 788 |
| 789 // Writes to file the serialized and encoded MHTML data from WebThreadSafeData |
| 790 // instances. |
| 791 bool WriteMHTMLToDisk(bool success, |
| 792 std::vector<WebThreadSafeData> mhtml_contents, |
| 793 base::File file) { |
| 794 TRACE_EVENT_BEGIN0("page-serialization", |
| 795 "WriteMHTMLToDisk (RenderFrameImpl)"); |
| 796 DCHECK(!RenderThread::Get()) << "Should not run in the main renderer thread"; |
| 797 if (success) { |
| 798 SCOPED_UMA_HISTOGRAM_TIMER( |
| 799 "PageSerialization.MhtmlGeneration.WriteToDiskTime.SingleFrame"); |
| 800 for (const WebThreadSafeData& data : mhtml_contents) { |
| 801 if (!data.isEmpty() && |
| 802 file.WriteAtCurrentPos(data.data(), data.size()) < 0) { |
| 803 success = false; |
| 804 break; |
| 805 } |
| 806 } |
| 807 // Explicitly close the file here to include any flush operations in the UMA |
| 808 // metric. If this block is not executed close will be called upon |file| |
| 809 // destruction at the end of this method's scope, which is still |
| 810 // before any IPC is sent. |
| 811 file.Close(); |
| 812 } |
| 813 |
| 814 TRACE_EVENT_END1("page-serialization", "WriteMHTMLToDisk (RenderFrameImpl)", |
| 815 "success", success); |
| 816 return success; |
| 817 } |
| 818 |
787 #if defined(OS_ANDROID) | 819 #if defined(OS_ANDROID) |
788 // Returns true if WMPI should be used for playback, false otherwise. | 820 // Returns true if WMPI should be used for playback, false otherwise. |
789 // | 821 // |
790 // Note that HLS and MP4 detection are pre-redirect and path-based. It is | 822 // Note that HLS and MP4 detection are pre-redirect and path-based. It is |
791 // possible to load such a URL and find different content. | 823 // possible to load such a URL and find different content. |
792 bool UseWebMediaPlayerImpl(const GURL& url) { | 824 bool UseWebMediaPlayerImpl(const GURL& url) { |
793 // Always use WMPI for playing blob URLs since WMPA could never play them very | 825 // Always use WMPI for playing blob URLs since WMPA could never play them very |
794 // well and no longer has support for MSE based playbacks. | 826 // well and no longer has support for MSE based playbacks. |
795 if (url.SchemeIsBlob()) | 827 if (url.SchemeIsBlob()) |
796 return true; | 828 return true; |
(...skipping 4390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5187 void RenderFrameImpl::OnSerializeAsMHTML( | 5219 void RenderFrameImpl::OnSerializeAsMHTML( |
5188 const FrameMsg_SerializeAsMHTML_Params& params) { | 5220 const FrameMsg_SerializeAsMHTML_Params& params) { |
5189 TRACE_EVENT0("page-serialization", "RenderFrameImpl::OnSerializeAsMHTML"); | 5221 TRACE_EVENT0("page-serialization", "RenderFrameImpl::OnSerializeAsMHTML"); |
5190 base::TimeTicks start_time = base::TimeTicks::Now(); | 5222 base::TimeTicks start_time = base::TimeTicks::Now(); |
5191 // Unpack IPC payload. | 5223 // Unpack IPC payload. |
5192 base::File file = IPC::PlatformFileForTransitToFile(params.destination_file); | 5224 base::File file = IPC::PlatformFileForTransitToFile(params.destination_file); |
5193 const WebString mhtml_boundary = | 5225 const WebString mhtml_boundary = |
5194 WebString::fromUTF8(params.mhtml_boundary_marker); | 5226 WebString::fromUTF8(params.mhtml_boundary_marker); |
5195 DCHECK(!mhtml_boundary.isEmpty()); | 5227 DCHECK(!mhtml_boundary.isEmpty()); |
5196 | 5228 |
5197 // Three WebData instances for header, parts and footer. | 5229 // Holds WebThreadSafeData instances for some or all of header, contents and |
5198 WebData mhtml_contents[3]; | 5230 // footer. |
5199 std::set<std::string> digests_of_uris_of_serialized_resources; | 5231 std::vector<WebThreadSafeData> mhtml_contents; |
5200 MHTMLPartsGenerationDelegate delegate( | 5232 std::set<std::string> serialized_resources_uri_digests; |
5201 params, &digests_of_uris_of_serialized_resources); | 5233 MHTMLPartsGenerationDelegate delegate(params, |
| 5234 &serialized_resources_uri_digests); |
5202 | 5235 |
5203 bool success = true; | 5236 bool success = true; |
5204 | 5237 |
5205 // Generate MHTML header if needed. | 5238 // Generate MHTML header if needed. |
5206 if (IsMainFrame()) { | 5239 if (IsMainFrame()) { |
5207 TRACE_EVENT0("page-serialization", | 5240 TRACE_EVENT0("page-serialization", |
5208 "RenderFrameImpl::OnSerializeAsMHTML header"); | 5241 "RenderFrameImpl::OnSerializeAsMHTML header"); |
5209 // |data| can be empty if the main frame should be skipped. If the main | 5242 // |data| can be empty if the main frame should be skipped. If the main |
5210 // frame is skipped, then the whole archive is bad, so bail to the error | 5243 // frame is skipped, then the whole archive is bad, so bail to the error |
5211 // condition. | 5244 // condition. |
5212 mhtml_contents[0] = WebFrameSerializer::generateMHTMLHeader( | 5245 mhtml_contents.emplace_back(WebFrameSerializer::generateMHTMLHeader( |
5213 mhtml_boundary, GetWebFrame(), &delegate); | 5246 mhtml_boundary, GetWebFrame(), &delegate)); |
5214 success = !mhtml_contents[0].isEmpty(); | 5247 success = !mhtml_contents.back().isEmpty(); |
5215 } | 5248 } |
5216 | 5249 |
5217 // Generate MHTML parts. Note that if this is not the main frame, then even | 5250 // Generate MHTML parts. Note that if this is not the main frame, then even |
5218 // skipping the whole parts generation step is not an error - it simply | 5251 // skipping the whole parts generation step is not an error - it simply |
5219 // results in an omitted resource in the final file. | 5252 // results in an omitted resource in the final file. |
5220 if (success) { | 5253 if (success) { |
5221 TRACE_EVENT0("page-serialization", | 5254 TRACE_EVENT0("page-serialization", |
5222 "RenderFrameImpl::OnSerializeAsMHTML parts serialization"); | 5255 "RenderFrameImpl::OnSerializeAsMHTML parts serialization"); |
5223 // |data| can be empty if the frame should be skipped, but this is OK. | 5256 // |data| can be empty if the frame should be skipped, but this is OK. |
5224 mhtml_contents[1] = WebFrameSerializer::generateMHTMLParts( | 5257 mhtml_contents.emplace_back(WebFrameSerializer::generateMHTMLParts( |
5225 mhtml_boundary, GetWebFrame(), &delegate); | 5258 mhtml_boundary, GetWebFrame(), &delegate)); |
5226 } | 5259 } |
5227 | 5260 |
5228 // Generate MHTML footer if needed. | 5261 // Generate MHTML footer if needed. |
5229 if (success && params.is_last_frame) { | 5262 if (success && params.is_last_frame) { |
5230 TRACE_EVENT0("page-serialization", | 5263 TRACE_EVENT0("page-serialization", |
5231 "RenderFrameImpl::OnSerializeAsMHTML footer"); | 5264 "RenderFrameImpl::OnSerializeAsMHTML footer"); |
5232 mhtml_contents[2] = WebFrameSerializer::generateMHTMLFooter(mhtml_boundary); | 5265 mhtml_contents.emplace_back( |
| 5266 WebFrameSerializer::generateMHTMLFooter(mhtml_boundary)); |
5233 } | 5267 } |
5234 | 5268 |
5235 // Writes all serialized data to file. | 5269 // Note: we assume RenderFrameImpl::OnWriteMHTMLToDiskComplete and the rest of |
5236 // TODO(jcivelli): write the chunks in deferred tasks to give a chance to | 5270 // this function will be fast enough to not need to be accounted for in this |
5237 // the message loop to process other events. | 5271 // metric. |
5238 if (success) { | |
5239 TRACE_EVENT0("page-serialization", | |
5240 "RenderFrameImpl::OnSerializeAsMHTML writing to file"); | |
5241 SCOPED_UMA_HISTOGRAM_TIMER( | |
5242 "PageSerialization.MhtmlGeneration.WriteToDiskTime.SingleFrame"); | |
5243 for (const WebData& data : mhtml_contents) { | |
5244 if (file.WriteAtCurrentPos(data.data(), data.size()) < 0) { | |
5245 success = false; | |
5246 break; | |
5247 } | |
5248 } | |
5249 } | |
5250 | |
5251 // Cleanup and notify the browser process about completion. | |
5252 file.Close(); // Need to flush file contents before sending IPC response. | |
5253 base::TimeDelta main_thread_use_time = base::TimeTicks::Now() - start_time; | 5272 base::TimeDelta main_thread_use_time = base::TimeTicks::Now() - start_time; |
5254 Send(new FrameHostMsg_SerializeAsMHTMLResponse( | |
5255 routing_id_, params.job_id, success, | |
5256 digests_of_uris_of_serialized_resources, main_thread_use_time)); | |
5257 UMA_HISTOGRAM_TIMES( | 5273 UMA_HISTOGRAM_TIMES( |
5258 "PageSerialization.MhtmlGeneration.RendererMainThreadTime.SingleFrame", | 5274 "PageSerialization.MhtmlGeneration.RendererMainThreadTime.SingleFrame", |
5259 main_thread_use_time); | 5275 main_thread_use_time); |
| 5276 |
| 5277 base::PostTaskAndReplyWithResult( |
| 5278 RenderThreadImpl::current()->GetFileThreadTaskRunner().get(), FROM_HERE, |
| 5279 base::Bind(&WriteMHTMLToDisk, success, base::Passed(&mhtml_contents), |
| 5280 base::Passed(&file)), |
| 5281 base::Bind(&RenderFrameImpl::OnWriteMHTMLToDiskComplete, |
| 5282 weak_factory_.GetWeakPtr(), params.job_id, |
| 5283 base::Passed(&serialized_resources_uri_digests), |
| 5284 main_thread_use_time)); |
| 5285 } |
| 5286 |
| 5287 void RenderFrameImpl::OnWriteMHTMLToDiskComplete( |
| 5288 int job_id, |
| 5289 std::set<std::string> serialized_resources_uri_digests, |
| 5290 base::TimeDelta main_thread_use_time, |
| 5291 bool success) { |
| 5292 DCHECK(RenderThread::Get()) << "Must run in the main renderer thread"; |
| 5293 // Notify the browser process about completion. |
| 5294 // Note: we assume this method is fast enough to not need to be accounted for |
| 5295 // in PageSerialization.MhtmlGeneration.RendererMainThreadTime.SingleFrame. |
| 5296 Send(new FrameHostMsg_SerializeAsMHTMLResponse( |
| 5297 routing_id_, job_id, success, serialized_resources_uri_digests, |
| 5298 main_thread_use_time)); |
5260 } | 5299 } |
5261 | 5300 |
5262 void RenderFrameImpl::OnFind(int request_id, | 5301 void RenderFrameImpl::OnFind(int request_id, |
5263 const base::string16& search_text, | 5302 const base::string16& search_text, |
5264 const WebFindOptions& options) { | 5303 const WebFindOptions& options) { |
5265 DCHECK(!search_text.empty()); | 5304 DCHECK(!search_text.empty()); |
5266 | 5305 |
5267 blink::WebPlugin* plugin = GetWebPluginForFind(); | 5306 blink::WebPlugin* plugin = GetWebPluginForFind(); |
5268 // Check if the plugin still exists in the document. | 5307 // Check if the plugin still exists in the document. |
5269 if (plugin) { | 5308 if (plugin) { |
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6430 // event target. Potentially a Pepper plugin will receive the event. | 6469 // event target. Potentially a Pepper plugin will receive the event. |
6431 // In order to tell whether a plugin gets the last mouse event and which it | 6470 // In order to tell whether a plugin gets the last mouse event and which it |
6432 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6471 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6433 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6472 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6434 // |pepper_last_mouse_event_target_|. | 6473 // |pepper_last_mouse_event_target_|. |
6435 pepper_last_mouse_event_target_ = nullptr; | 6474 pepper_last_mouse_event_target_ = nullptr; |
6436 #endif | 6475 #endif |
6437 } | 6476 } |
6438 | 6477 |
6439 } // namespace content | 6478 } // namespace content |
OLD | NEW |