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

Unified Diff: content/child/webthreadedresourceprovider_impl.h

Issue 109283006: Redirect HTML resource bytes directly to parser thread (Chrome side CL) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/child/webthreadedresourceprovider_impl.h
diff --git a/content/child/webthreadedresourceprovider_impl.h b/content/child/webthreadedresourceprovider_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..345e2f3a100aeb55fe61454e57910099e46220eb
--- /dev/null
+++ b/content/child/webthreadedresourceprovider_impl.h
@@ -0,0 +1,68 @@
+// 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_WEBTHREADEDRESOURCEPROVIDER_IMPL_H_
+#define CONTENT_CHILD_WEBTHREADEDRESOURCEPROVIDER_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/WebThreadedResourceProvider.h"
+
+namespace webkit_glue {
+class WebThreadImpl;
+}
+
+namespace content {
+class ResourceDispatcher;
+
+class WebThreadedResourceProviderImpl
+ : public blink::WebThreadedResourceProvider {
+ public:
+ WebThreadedResourceProviderImpl(
+ int request_id,
+ base::WeakPtr<ResourceDispatcher> resource_dispatcher,
+ linked_ptr<base::SharedMemory> shm_buffer,
+ int shm_size);
+ virtual ~WebThreadedResourceProviderImpl();
+
+ // From blink::WebThreadedResourceProvider
+ virtual void setBackgroundClient(
+ blink::WebThreadedResourceBackgroundClient* backgroundClient) OVERRIDE;
+ virtual void setForegroundClient(
+ blink::WebThreadedResourceForegroundClient* foregroundClient) OVERRIDE;
+ virtual blink::WebThread* resourceThread() OVERRIDE;
+
+ static void Cleanup();
+
+ void OnReceivedData(int data_offset,
+ int data_length,
+ int encoded_data_length);
+
+ void OnParserResourceMessageFilterAdded();
+
+ private:
+ scoped_refptr<IPC::ChannelProxy::MessageFilter> filter_;
+ blink::WebThreadedResourceBackgroundClient* backgroundClient_;
+ blink::WebThreadedResourceForegroundClient* foregroundClient_;
+ int request_id_;
+ base::WeakPtr<ResourceDispatcher> resource_dispatcher_;
+ linked_ptr<base::SharedMemory> shm_buffer_;
+ int shm_size_;
+ base::WeakPtrFactory<WebThreadedResourceProviderImpl>
+ parser_thread_weak_factory_;
+ base::WeakPtrFactory<WebThreadedResourceProviderImpl>
+ main_thread_weak_factory_;
+ base::MessageLoop* main_thread_message_loop;
+ DISALLOW_COPY_AND_ASSIGN(WebThreadedResourceProviderImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_CHILD_WEBTHREADEDRESOURCEPROVIDER_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698