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

Side by Side Diff: components/html_viewer/blink_platform_impl.cc

Issue 1431233002: Remove blink's use of RC4 for random value generation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@random_asserts
Patch Set: Created 5 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/html_viewer/blink_platform_impl.h" 5 #include "components/html_viewer/blink_platform_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/rand_util.h"
11 #include "base/stl_util.h" 10 #include "base/stl_util.h"
12 #include "base/synchronization/waitable_event.h" 11 #include "base/synchronization/waitable_event.h"
13 #include "base/thread_task_runner_handle.h" 12 #include "base/thread_task_runner_handle.h"
14 #include "base/threading/platform_thread.h" 13 #include "base/threading/platform_thread.h"
15 #include "base/time/time.h" 14 #include "base/time/time.h"
16 #include "base/trace_event/trace_event.h" 15 #include "base/trace_event/trace_event.h"
17 #include "components/html_viewer/blink_resource_constants.h" 16 #include "components/html_viewer/blink_resource_constants.h"
18 #include "components/html_viewer/global_state.h" 17 #include "components/html_viewer/global_state.h"
19 #include "components/html_viewer/web_clipboard_impl.h" 18 #include "components/html_viewer/web_clipboard_impl.h"
20 #include "components/html_viewer/web_cookie_jar_impl.h" 19 #include "components/html_viewer/web_cookie_jar_impl.h"
21 #include "components/html_viewer/web_graphics_context_3d_command_buffer_impl.h" 20 #include "components/html_viewer/web_graphics_context_3d_command_buffer_impl.h"
22 #include "components/html_viewer/web_socket_handle_impl.h" 21 #include "components/html_viewer/web_socket_handle_impl.h"
23 #include "components/html_viewer/web_url_loader_impl.h" 22 #include "components/html_viewer/web_url_loader_impl.h"
24 #include "components/message_port/web_message_port_channel_impl.h" 23 #include "components/message_port/web_message_port_channel_impl.h"
25 #include "components/mime_util/mime_util.h" 24 #include "components/mime_util/mime_util.h"
26 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" 25 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h"
27 #include "components/scheduler/renderer/renderer_scheduler.h" 26 #include "components/scheduler/renderer/renderer_scheduler.h"
28 #include "components/scheduler/renderer/webthread_impl_for_renderer_scheduler.h" 27 #include "components/scheduler/renderer/webthread_impl_for_renderer_scheduler.h"
28 #include "crypto/random.h"
29 #include "mojo/application/public/cpp/application_impl.h" 29 #include "mojo/application/public/cpp/application_impl.h"
30 #include "mojo/application/public/cpp/connect.h" 30 #include "mojo/application/public/cpp/connect.h"
31 #include "mojo/common/user_agent.h" 31 #include "mojo/common/user_agent.h"
32 #include "net/base/data_url.h" 32 #include "net/base/data_url.h"
33 #include "net/base/ip_address_number.h" 33 #include "net/base/ip_address_number.h"
34 #include "net/base/net_errors.h" 34 #include "net/base/net_errors.h"
35 #include "net/base/net_util.h" 35 #include "net/base/net_util.h"
36 #include "third_party/WebKit/public/platform/WebWaitableEvent.h" 36 #include "third_party/WebKit/public/platform/WebWaitableEvent.h"
37 #include "ui/base/resource/resource_bundle.h" 37 #include "ui/base/resource/resource_bundle.h"
38 #include "ui/events/gestures/blink/web_gesture_curve_impl.h" 38 #include "ui/events/gestures/blink/web_gesture_curve_impl.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 return base::Time::Now().ToDoubleT(); 128 return base::Time::Now().ToDoubleT();
129 } 129 }
130 130
131 double BlinkPlatformImpl::monotonicallyIncreasingTime() { 131 double BlinkPlatformImpl::monotonicallyIncreasingTime() {
132 return base::TimeTicks::Now().ToInternalValue() / 132 return base::TimeTicks::Now().ToInternalValue() /
133 static_cast<double>(base::Time::kMicrosecondsPerSecond); 133 static_cast<double>(base::Time::kMicrosecondsPerSecond);
134 } 134 }
135 135
136 void BlinkPlatformImpl::cryptographicallyRandomValues(unsigned char* buffer, 136 void BlinkPlatformImpl::cryptographicallyRandomValues(unsigned char* buffer,
137 size_t length) { 137 size_t length) {
138 base::RandBytes(buffer, length); 138 crypto::RandBytes(buffer, length);
139 } 139 }
140 140
141 bool BlinkPlatformImpl::isThreadedCompositingEnabled() { 141 bool BlinkPlatformImpl::isThreadedCompositingEnabled() {
142 return true; 142 return true;
143 } 143 }
144 144
145 blink::WebCompositorSupport* BlinkPlatformImpl::compositorSupport() { 145 blink::WebCompositorSupport* BlinkPlatformImpl::compositorSupport() {
146 return &compositor_support_; 146 return &compositor_support_;
147 } 147 }
148 148
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 BlinkPlatformImpl::notificationManager() { 316 BlinkPlatformImpl::notificationManager() {
317 return &web_notification_manager_; 317 return &web_notification_manager_;
318 } 318 }
319 319
320 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread) { 320 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread) {
321 DCHECK(!current_thread_slot_.Get()); 321 DCHECK(!current_thread_slot_.Get());
322 current_thread_slot_.Set(thread); 322 current_thread_slot_.Set(thread);
323 } 323 }
324 324
325 } // namespace html_viewer 325 } // namespace html_viewer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698