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

Side by Side Diff: webkit/child/webkitplatformsupport_impl.h

Issue 22815034: Introduce webkit_glue bridges for the new WebSocket Implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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 #ifndef WEBKIT_CHILD_WEBKITPLATFORMSUPPORT_IMPL_H_ 5 #ifndef WEBKIT_CHILD_WEBKITPLATFORMSUPPORT_IMPL_H_
6 #define WEBKIT_CHILD_WEBKITPLATFORMSUPPORT_IMPL_H_ 6 #define WEBKIT_CHILD_WEBKITPLATFORMSUPPORT_IMPL_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/platform_file.h" 10 #include "base/platform_file.h"
11 #include "base/timer/timer.h" 11 #include "base/timer/timer.h"
12 #include "third_party/WebKit/public/platform/Platform.h" 12 #include "third_party/WebKit/public/platform/Platform.h"
13 #include "third_party/WebKit/public/platform/WebURLError.h" 13 #include "third_party/WebKit/public/platform/WebURLError.h"
14 #include "ui/base/layout.h" 14 #include "ui/base/layout.h"
15 #include "webkit/child/resource_loader_bridge.h" 15 #include "webkit/child/resource_loader_bridge.h"
16 #include "webkit/child/webkit_child_export.h" 16 #include "webkit/child/webkit_child_export.h"
17 17
18 namespace base { 18 namespace base {
19 class MessageLoop; 19 class MessageLoop;
20 } 20 }
21 21
22 namespace WebKit { 22 namespace WebKit {
23 class WebSocketHandle;
23 class WebSocketStreamHandle; 24 class WebSocketStreamHandle;
24 } 25 }
25 26
26 namespace webkit_glue { 27 namespace webkit_glue {
27 28
28 class WebSocketStreamHandleDelegate; 29 class WebSocketStreamHandleDelegate;
29 class WebSocketStreamHandleBridge; 30 class WebSocketStreamHandleBridge;
31 class WebSocketHandleDelegate;
32 class WebSocketHandleBridge;
30 33
31 class WEBKIT_CHILD_EXPORT WebKitPlatformSupportImpl : 34 class WEBKIT_CHILD_EXPORT WebKitPlatformSupportImpl :
32 NON_EXPORTED_BASE(public WebKit::Platform) { 35 NON_EXPORTED_BASE(public WebKit::Platform) {
33 public: 36 public:
34 WebKitPlatformSupportImpl(); 37 WebKitPlatformSupportImpl();
35 virtual ~WebKitPlatformSupportImpl(); 38 virtual ~WebKitPlatformSupportImpl();
36 39
37 // Platform methods (partial implementation): 40 // Platform methods (partial implementation):
38 virtual base::PlatformFile databaseOpenFile( 41 virtual base::PlatformFile databaseOpenFile(
39 const WebKit::WebString& vfs_file_name, int desired_flags); 42 const WebKit::WebString& vfs_file_name, int desired_flags);
(...skipping 13 matching lines...) Expand all
53 virtual void startHeapProfiling(const WebKit::WebString& prefix); 56 virtual void startHeapProfiling(const WebKit::WebString& prefix);
54 virtual void stopHeapProfiling() OVERRIDE; 57 virtual void stopHeapProfiling() OVERRIDE;
55 virtual void dumpHeapProfiling(const WebKit::WebString& reason); 58 virtual void dumpHeapProfiling(const WebKit::WebString& reason);
56 virtual WebKit::WebString getHeapProfile() OVERRIDE; 59 virtual WebKit::WebString getHeapProfile() OVERRIDE;
57 60
58 virtual bool processMemorySizesInBytes(size_t* private_bytes, 61 virtual bool processMemorySizesInBytes(size_t* private_bytes,
59 size_t* shared_bytes); 62 size_t* shared_bytes);
60 virtual bool memoryAllocatorWasteInBytes(size_t* size); 63 virtual bool memoryAllocatorWasteInBytes(size_t* size);
61 virtual WebKit::WebURLLoader* createURLLoader(); 64 virtual WebKit::WebURLLoader* createURLLoader();
62 virtual WebKit::WebSocketStreamHandle* createSocketStreamHandle(); 65 virtual WebKit::WebSocketStreamHandle* createSocketStreamHandle();
66 virtual WebKit::WebSocketHandle* createWebSocketHandle();
63 virtual WebKit::WebString userAgent(const WebKit::WebURL& url); 67 virtual WebKit::WebString userAgent(const WebKit::WebURL& url);
64 virtual WebKit::WebData parseDataURL( 68 virtual WebKit::WebData parseDataURL(
65 const WebKit::WebURL& url, WebKit::WebString& mimetype, 69 const WebKit::WebURL& url, WebKit::WebString& mimetype,
66 WebKit::WebString& charset); 70 WebKit::WebString& charset);
67 virtual WebKit::WebURLError cancelledError(const WebKit::WebURL& url) const; 71 virtual WebKit::WebURLError cancelledError(const WebKit::WebURL& url) const;
68 virtual void decrementStatsCounter(const char* name); 72 virtual void decrementStatsCounter(const char* name);
69 virtual void incrementStatsCounter(const char* name); 73 virtual void incrementStatsCounter(const char* name);
70 virtual void histogramCustomCounts( 74 virtual void histogramCustomCounts(
71 const char* name, int sample, int min, int max, int bucket_count); 75 const char* name, int sample, int min, int max, int bucket_count);
72 virtual void histogramEnumeration( 76 virtual void histogramEnumeration(
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 119
116 // Returns the raw data for a resource. This resource must have been 120 // Returns the raw data for a resource. This resource must have been
117 // specified as BINDATA in the relevant .rc file. 121 // specified as BINDATA in the relevant .rc file.
118 virtual base::StringPiece GetDataResource(int resource_id, 122 virtual base::StringPiece GetDataResource(int resource_id,
119 ui::ScaleFactor scale_factor) = 0; 123 ui::ScaleFactor scale_factor) = 0;
120 124
121 // Creates a ResourceLoaderBridge. 125 // Creates a ResourceLoaderBridge.
122 virtual ResourceLoaderBridge* CreateResourceLoader( 126 virtual ResourceLoaderBridge* CreateResourceLoader(
123 const ResourceLoaderBridge::RequestInfo& request_info) = 0; 127 const ResourceLoaderBridge::RequestInfo& request_info) = 0;
124 // Creates a WebSocketStreamHandleBridge. 128 // Creates a WebSocketStreamHandleBridge.
125 virtual WebSocketStreamHandleBridge* CreateWebSocketBridge( 129 virtual WebSocketStreamHandleBridge* CreateWebSocketStreamBridge(
126 WebKit::WebSocketStreamHandle* handle, 130 WebKit::WebSocketStreamHandle* handle,
127 WebSocketStreamHandleDelegate* delegate) = 0; 131 WebSocketStreamHandleDelegate* delegate) = 0;
132 // Creates a WebSocketHandleBridge.
133 virtual WebSocketHandleBridge* CreateWebSocketBridge(
134 WebSocketHandleDelegate* delegate) = 0;
kinuko 2013/09/05 08:10:39 I suspect we might be able to move websocketstream
yhirano 2013/09/05 11:25:02 I filed a ticket and will do it in the future.
128 135
129 void SuspendSharedTimer(); 136 void SuspendSharedTimer();
130 void ResumeSharedTimer(); 137 void ResumeSharedTimer();
131 virtual void OnStartSharedTimer(base::TimeDelta delay) {} 138 virtual void OnStartSharedTimer(base::TimeDelta delay) {}
132 139
133 private: 140 private:
134 void DoTimeout() { 141 void DoTimeout() {
135 if (shared_timer_func_ && !shared_timer_suspended_) 142 if (shared_timer_func_ && !shared_timer_suspended_)
136 shared_timer_func_(); 143 shared_timer_func_();
137 } 144 }
138 145
139 base::MessageLoop* main_loop_; 146 base::MessageLoop* main_loop_;
140 base::OneShotTimer<WebKitPlatformSupportImpl> shared_timer_; 147 base::OneShotTimer<WebKitPlatformSupportImpl> shared_timer_;
141 void (*shared_timer_func_)(); 148 void (*shared_timer_func_)();
142 double shared_timer_fire_time_; 149 double shared_timer_fire_time_;
143 bool shared_timer_fire_time_was_set_while_suspended_; 150 bool shared_timer_fire_time_was_set_while_suspended_;
144 int shared_timer_suspended_; // counter 151 int shared_timer_suspended_; // counter
145 }; 152 };
146 153
147 } // namespace webkit_glue 154 } // namespace webkit_glue
148 155
149 #endif // WEBKIT_CHILD_WEBKITPLATFORMSUPPORT_IMPL_H_ 156 #endif // WEBKIT_CHILD_WEBKITPLATFORMSUPPORT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698