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

Unified Diff: content/child/threaded_data_provider.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, 6 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
« no previous file with comments | « content/child/resource_dispatcher.cc ('k') | content/child/threaded_data_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/threaded_data_provider.h
diff --git a/content/child/threaded_data_provider.h b/content/child/threaded_data_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..223153f414e82c6480bb48fa528a136c7edb8614
--- /dev/null
+++ b/content/child/threaded_data_provider.h
@@ -0,0 +1,83 @@
+// Copyright 2014 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_THREADEDDATAPROVIDER_IMPL_H_
+#define CONTENT_CHILD_THREADEDDATAPROVIDER_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 "ipc/ipc_channel.h"
+#include "ipc/message_filter.h"
+
+namespace blink {
+class WebThreadedDataReceiver;
+}
+
+namespace IPC {
+class SyncChannel;
+}
+
+namespace webkit_glue {
+class WebThreadImpl;
+}
+
+namespace content {
+class ResourceDispatcher;
+class WebThreadImpl;
+
+class ThreadedDataProvider {
+ public:
+ ThreadedDataProvider(
+ int request_id,
+ blink::WebThreadedDataReceiver* threaded_data_receiver,
+ linked_ptr<base::SharedMemory> shm_buffer,
+ int shm_size);
+ virtual ~ThreadedDataProvider();
+
+ void Stop();
+ void OnReceivedDataOnBackgroundThread(int data_offset,
+ int data_length,
+ int encoded_data_length);
+
+ void OnReceivedDataOnForegroundThread(const char* data,
+ int data_length,
+ int encoded_data_length);
+
+ void OnResourceMessageFilterAddedMainThread();
+
+ private:
+ void StopOnBackgroundThread();
+ void OnResourceMessageFilterAddedBackgroundThread();
+ void ForwardAndACKData(const char* data, int data_length);
+
+ scoped_refptr<IPC::MessageFilter> filter_;
+ int request_id_;
+ linked_ptr<base::SharedMemory> shm_buffer_;
+ int shm_size_;
+ scoped_ptr<base::WeakPtrFactory<ThreadedDataProvider> >
+ background_thread_weak_factory_;
+ base::WeakPtrFactory<ThreadedDataProvider>
+ main_thread_weak_factory_;
+ WebThreadImpl& background_thread_;
+ IPC::SyncChannel* ipc_channel_;
+ blink::WebThreadedDataReceiver* threaded_data_receiver_;
+ bool resource_filter_active_;
+ base::MessageLoop* main_thread_message_loop_;
+
+ struct QueuedSharedMemoryData {
+ const char* data;
+ int length;
+ };
+ std::vector<QueuedSharedMemoryData> queued_data_;
+
+ DISALLOW_COPY_AND_ASSIGN(ThreadedDataProvider);
+};
+
+} // namespace content
+
+#endif // CONTENT_CHILD_THREADEDDATAPROVIDER_IMPL_H_
« no previous file with comments | « content/child/resource_dispatcher.cc ('k') | content/child/threaded_data_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698