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

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

Issue 1568073002: Reduce string copies in GURL creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac Created 4 years, 11 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
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/renderer_blink_platform_impl.h" 5 #include "content/renderer/renderer_blink_platform_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 29 matching lines...) Expand all
40 #include "content/child/webfileutilities_impl.h" 40 #include "content/child/webfileutilities_impl.h"
41 #include "content/child/webmessageportchannel_impl.h" 41 #include "content/child/webmessageportchannel_impl.h"
42 #include "content/common/file_utilities_messages.h" 42 #include "content/common/file_utilities_messages.h"
43 #include "content/common/frame_messages.h" 43 #include "content/common/frame_messages.h"
44 #include "content/common/gpu/client/context_provider_command_buffer.h" 44 #include "content/common/gpu/client/context_provider_command_buffer.h"
45 #include "content/common/gpu/client/gpu_channel_host.h" 45 #include "content/common/gpu/client/gpu_channel_host.h"
46 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 46 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
47 #include "content/common/gpu/gpu_process_launch_causes.h" 47 #include "content/common/gpu/gpu_process_launch_causes.h"
48 #include "content/common/mime_registry_messages.h" 48 #include "content/common/mime_registry_messages.h"
49 #include "content/common/render_process_messages.h" 49 #include "content/common/render_process_messages.h"
50 #include "content/public/child/url_conversion.h"
50 #include "content/public/common/content_switches.h" 51 #include "content/public/common/content_switches.h"
51 #include "content/public/common/service_registry.h" 52 #include "content/public/common/service_registry.h"
52 #include "content/public/common/webplugininfo.h" 53 #include "content/public/common/webplugininfo.h"
53 #include "content/public/renderer/content_renderer_client.h" 54 #include "content/public/renderer/content_renderer_client.h"
54 #include "content/renderer/battery_status/battery_status_dispatcher.h" 55 #include "content/renderer/battery_status/battery_status_dispatcher.h"
55 #include "content/renderer/cache_storage/webserviceworkercachestorage_impl.h" 56 #include "content/renderer/cache_storage/webserviceworkercachestorage_impl.h"
56 #include "content/renderer/device_sensors/device_light_event_pump.h" 57 #include "content/renderer/device_sensors/device_light_event_pump.h"
57 #include "content/renderer/device_sensors/device_motion_event_pump.h" 58 #include "content/renderer/device_sensors/device_motion_event_pump.h"
58 #include "content/renderer/device_sensors/device_orientation_absolute_event_pump .h" 59 #include "content/renderer/device_sensors/device_orientation_absolute_event_pump .h"
59 #include "content/renderer/device_sensors/device_orientation_event_pump.h" 60 #include "content/renderer/device_sensors/device_orientation_event_pump.h"
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 RenderThreadImpl::current()->EstablishGpuChannelSync( 1019 RenderThreadImpl::current()->EstablishGpuChannelSync(
1019 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE) ); 1020 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE) );
1020 1021
1021 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; 1022 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits;
1022 bool lose_context_when_out_of_memory = false; 1023 bool lose_context_when_out_of_memory = false;
1023 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( 1024 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context(
1024 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( 1025 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext(
1025 gpu_channel_host.get(), 1026 gpu_channel_host.get(),
1026 attributes, 1027 attributes,
1027 lose_context_when_out_of_memory, 1028 lose_context_when_out_of_memory,
1028 GURL(attributes.topDocumentURL), 1029 WebStringToGURL(attributes.topDocumentURL),
1029 limits, 1030 limits,
1030 static_cast<WebGraphicsContext3DCommandBufferImpl*>(share_context))); 1031 static_cast<WebGraphicsContext3DCommandBufferImpl*>(share_context)));
1031 1032
1032 // Most likely the GPU process exited and the attempt to reconnect to it 1033 // Most likely the GPU process exited and the attempt to reconnect to it
1033 // failed. Need to try to restore the context again later. 1034 // failed. Need to try to restore the context again later.
1034 if (!context || !context->InitializeOnCurrentThread() || 1035 if (!context || !context->InitializeOnCurrentThread() ||
1035 gl_info->testFailContext) { 1036 gl_info->testFailContext) {
1036 // Collect Graphicsinfo if there is a context failure or it is failed 1037 // Collect Graphicsinfo if there is a context failure or it is failed
1037 // purposefully in case of layout tests. 1038 // purposefully in case of layout tests.
1038 Collect3DContextInformationOnFailure(share_context, gl_info, 1039 Collect3DContextInformationOnFailure(share_context, gl_info,
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 //------------------------------------------------------------------------------ 1277 //------------------------------------------------------------------------------
1277 1278
1278 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( 1279 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting(
1279 const blink::WebBatteryStatus& status) { 1280 const blink::WebBatteryStatus& status) {
1280 if (!g_test_battery_status_listener) 1281 if (!g_test_battery_status_listener)
1281 return; 1282 return;
1282 g_test_battery_status_listener->updateBatteryStatus(status); 1283 g_test_battery_status_listener->updateBatteryStatus(status);
1283 } 1284 }
1284 1285
1285 } // namespace content 1286 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698