OLD | NEW |
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 "mojo/services/html_viewer/blink_platform_impl.h" | 5 #include "mojo/services/html_viewer/blink_platform_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
11 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
12 #include "base/threading/platform_thread.h" | 12 #include "base/threading/platform_thread.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "mojo/services/html_viewer/webthread_impl.h" | 14 #include "mojo/services/html_viewer/webthread_impl.h" |
15 #include "net/base/data_url.h" | 15 #include "net/base/data_url.h" |
16 #include "net/base/mime_util.h" | 16 #include "net/base/mime_util.h" |
17 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
18 #include "third_party/WebKit/public/platform/WebWaitableEvent.h" | 18 #include "third_party/WebKit/public/platform/WebWaitableEvent.h" |
19 | 19 |
20 namespace mojo { | 20 namespace html_viewer { |
21 namespace { | 21 namespace { |
22 | 22 |
23 // TODO(darin): Figure out what our UA should really be. | 23 // TODO(darin): Figure out what our UA should really be. |
24 const char kUserAgentString[] = | 24 const char kUserAgentString[] = |
25 "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) " | 25 "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) " |
26 "Chrome/35.0.1916.153 Safari/537.36"; | 26 "Chrome/35.0.1916.153 Safari/537.36"; |
27 | 27 |
28 class WebWaitableEventImpl : public blink::WebWaitableEvent { | 28 class WebWaitableEventImpl : public blink::WebWaitableEvent { |
29 public: | 29 public: |
30 WebWaitableEventImpl() : impl_(new base::WaitableEvent(false, false)) {} | 30 WebWaitableEventImpl() : impl_(new base::WaitableEvent(false, false)) {} |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 return web_events[idx]; | 219 return web_events[idx]; |
220 } | 220 } |
221 | 221 |
222 // static | 222 // static |
223 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { | 223 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { |
224 WebThreadImplForMessageLoop* impl = | 224 WebThreadImplForMessageLoop* impl = |
225 static_cast<WebThreadImplForMessageLoop*>(thread); | 225 static_cast<WebThreadImplForMessageLoop*>(thread); |
226 delete impl; | 226 delete impl; |
227 } | 227 } |
228 | 228 |
229 } // namespace mojo | 229 } // namespace html_viewer |
OLD | NEW |