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 "webkit/child/webkitplatformsupport_impl.h" | 5 #include "webkit/child/webkitplatformsupport_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" | 39 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" |
40 #include "third_party/WebKit/public/platform/WebString.h" | 40 #include "third_party/WebKit/public/platform/WebString.h" |
41 #include "third_party/WebKit/public/platform/WebURL.h" | 41 #include "third_party/WebKit/public/platform/WebURL.h" |
42 #include "third_party/WebKit/public/platform/WebVector.h" | 42 #include "third_party/WebKit/public/platform/WebVector.h" |
43 #include "third_party/WebKit/public/web/WebFrameClient.h" | 43 #include "third_party/WebKit/public/web/WebFrameClient.h" |
44 #include "third_party/WebKit/public/web/WebInputEvent.h" | 44 #include "third_party/WebKit/public/web/WebInputEvent.h" |
45 #include "third_party/WebKit/public/web/WebScreenInfo.h" | 45 #include "third_party/WebKit/public/web/WebScreenInfo.h" |
46 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" | 46 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" |
47 #include "ui/base/layout.h" | 47 #include "ui/base/layout.h" |
48 #include "webkit/child/webkit_child_helpers.h" | 48 #include "webkit/child/webkit_child_helpers.h" |
| 49 #include "webkit/child/websocket_handle_impl.h" |
49 #include "webkit/child/websocketstreamhandle_impl.h" | 50 #include "webkit/child/websocketstreamhandle_impl.h" |
50 #include "webkit/child/weburlloader_impl.h" | 51 #include "webkit/child/weburlloader_impl.h" |
51 #include "webkit/common/user_agent/user_agent.h" | 52 #include "webkit/common/user_agent/user_agent.h" |
52 #include "webkit/glue/webkit_glue.h" | 53 #include "webkit/glue/webkit_glue.h" |
53 | 54 |
54 using WebKit::WebAudioBus; | 55 using WebKit::WebAudioBus; |
55 using WebKit::WebCookie; | 56 using WebKit::WebCookie; |
56 using WebKit::WebData; | 57 using WebKit::WebData; |
57 using WebKit::WebLocalizedString; | 58 using WebKit::WebLocalizedString; |
58 using WebKit::WebPluginListBuilder; | 59 using WebKit::WebPluginListBuilder; |
59 using WebKit::WebString; | 60 using WebKit::WebString; |
| 61 using WebKit::WebSocketHandle; |
60 using WebKit::WebSocketStreamHandle; | 62 using WebKit::WebSocketStreamHandle; |
61 using WebKit::WebURL; | 63 using WebKit::WebURL; |
62 using WebKit::WebURLError; | 64 using WebKit::WebURLError; |
63 using WebKit::WebURLLoader; | 65 using WebKit::WebURLLoader; |
64 using WebKit::WebVector; | 66 using WebKit::WebVector; |
65 | 67 |
66 namespace { | 68 namespace { |
67 | 69 |
68 // A simple class to cache the memory usage for a given amount of time. | 70 // A simple class to cache the memory usage for a given amount of time. |
69 class MemoryUsageCache { | 71 class MemoryUsageCache { |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 } | 360 } |
359 | 361 |
360 WebURLLoader* WebKitPlatformSupportImpl::createURLLoader() { | 362 WebURLLoader* WebKitPlatformSupportImpl::createURLLoader() { |
361 return new WebURLLoaderImpl(this); | 363 return new WebURLLoaderImpl(this); |
362 } | 364 } |
363 | 365 |
364 WebSocketStreamHandle* WebKitPlatformSupportImpl::createSocketStreamHandle() { | 366 WebSocketStreamHandle* WebKitPlatformSupportImpl::createSocketStreamHandle() { |
365 return new WebSocketStreamHandleImpl(this); | 367 return new WebSocketStreamHandleImpl(this); |
366 } | 368 } |
367 | 369 |
| 370 WebSocketHandle* WebKitPlatformSupportImpl::createWebSocketHandle() { |
| 371 return new WebSocketHandleImpl(this); |
| 372 } |
| 373 |
368 WebString WebKitPlatformSupportImpl::userAgent(const WebURL& url) { | 374 WebString WebKitPlatformSupportImpl::userAgent(const WebURL& url) { |
369 return WebString::fromUTF8(webkit_glue::GetUserAgent(url)); | 375 return WebString::fromUTF8(webkit_glue::GetUserAgent(url)); |
370 } | 376 } |
371 | 377 |
372 WebData WebKitPlatformSupportImpl::parseDataURL( | 378 WebData WebKitPlatformSupportImpl::parseDataURL( |
373 const WebURL& url, | 379 const WebURL& url, |
374 WebString& mimetype_out, | 380 WebString& mimetype_out, |
375 WebString& charset_out) { | 381 WebString& charset_out) { |
376 std::string mime_type, char_set, data; | 382 std::string mime_type, char_set, data; |
377 if (net::DataURL::Parse(url, &mime_type, &char_set, &data) | 383 if (net::DataURL::Parse(url, &mime_type, &char_set, &data) |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 if (--shared_timer_suspended_ == 0 && | 877 if (--shared_timer_suspended_ == 0 && |
872 (!shared_timer_.IsRunning() || | 878 (!shared_timer_.IsRunning() || |
873 shared_timer_fire_time_was_set_while_suspended_)) { | 879 shared_timer_fire_time_was_set_while_suspended_)) { |
874 shared_timer_fire_time_was_set_while_suspended_ = false; | 880 shared_timer_fire_time_was_set_while_suspended_ = false; |
875 setSharedTimerFireInterval( | 881 setSharedTimerFireInterval( |
876 shared_timer_fire_time_ - monotonicallyIncreasingTime()); | 882 shared_timer_fire_time_ - monotonicallyIncreasingTime()); |
877 } | 883 } |
878 } | 884 } |
879 | 885 |
880 } // namespace webkit_glue | 886 } // namespace webkit_glue |
OLD | NEW |