Chromium Code Reviews| Index: content/child/webparserresourcebridge_impl.h |
| diff --git a/content/child/webparserresourcebridge_impl.h b/content/child/webparserresourcebridge_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e92845f72bd242a5b5d5135dd9be2dce0920e03f |
| --- /dev/null |
| +++ b/content/child/webparserresourcebridge_impl.h |
| @@ -0,0 +1,63 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_CHILD_WEBPARSERRESOURCEBRIDGE_IMPL_H_ |
| +#define CONTENT_CHILD_WEBPARSERRESOURCEBRIDGE_IMPL_H_ |
| + |
| +#include "base/compiler_specific.h" |
| +#include "base/memory/linked_ptr.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/memory/shared_memory.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "content/common/content_export.h" |
| +#include "ipc/ipc_channel_proxy.h" |
| +#include "third_party/WebKit/public/platform/WebParserResourceBridge.h" |
| + |
| +namespace blink { |
| + class WebThread; |
|
jam
2013/12/17 00:44:40
no need to forward declare classes that are used i
oystein (OOO til 10th of July)
2013/12/17 01:07:27
Done.
|
| +} |
| + |
| +namespace webkit_glue { |
| + class WebThreadImpl; |
|
jam
2013/12/17 00:44:40
nit: no indentation in forward declarations
oystein (OOO til 10th of July)
2013/12/17 01:07:27
Done.
|
| +} |
| + |
| +namespace content { |
| +class ResourceDispatcher; |
| + |
| +class CONTENT_EXPORT WebParserResourceBridgeImpl : |
|
jam
2013/12/17 00:44:40
i don't think you need a CONTENT_EXPORT here since
oystein (OOO til 10th of July)
2013/12/17 01:07:27
Done.
|
| + NON_EXPORTED_BASE(public blink::WebParserResourceBridge) { |
| + public: |
| + WebParserResourceBridgeImpl( |
| + int request_id, |
| + base::WeakPtr<ResourceDispatcher> resource_dispatcher, |
| + base::SharedMemoryHandle shm_handle, |
| + int shm_size); |
| + virtual ~WebParserResourceBridgeImpl(); |
| + |
| + // From blink::WebParserResourceBridge |
| + virtual void setPeer(blink::WebParserResourceBridge::Peer* peer) OVERRIDE; |
| + virtual blink::WebThread* getParserThread() OVERRIDE; |
| + |
| + void OnReceivedData(int data_offset, |
|
jam
2013/12/17 00:44:40
nit: this can be made private?
oystein (OOO til 10th of July)
2013/12/17 01:07:27
It's called by ParserResourceMessageFilter::OnRece
|
| + int data_length, |
| + int encoded_data_length); |
| + void CreateSharedMemoryBuffer(); |
|
jam
2013/12/17 00:44:40
ditto
oystein (OOO til 10th of July)
2013/12/17 01:07:27
Done.
|
| + |
| + private: |
| + static webkit_glue::WebThreadImpl& parser_thread(); |
|
jam
2013/12/17 00:44:40
this can just be a static method in the cc file in
oystein (OOO til 10th of July)
2013/12/17 01:07:27
Done.
|
| + |
| + scoped_refptr<IPC::ChannelProxy::MessageFilter> filter_; |
| + blink::WebParserResourceBridge::Peer* peer_; |
| + base::SharedMemoryHandle shm_handle_; |
| + int shm_size_; |
| + linked_ptr<base::SharedMemory> shm_buffer_; |
| + base::WeakPtrFactory<WebParserResourceBridgeImpl> weak_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WebParserResourceBridgeImpl); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_CHILD_WEBPARSERRESOURCEBRIDGE_IMPL_H_ |