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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 8917028: Add BrowserThread::PostTaskOnIOThread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/browser_thread_impl.cc ('k') | content/public/browser/browser_thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/renderer_host/render_widget_host_view_win.h" 5 #include "content/browser/renderer_host/render_widget_host_view_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 // chrome_content_client.cc ChromeContentClient::SandboxPlugin 541 // chrome_content_client.cc ChromeContentClient::SandboxPlugin
542 ChangeWindowMessageFilterEx(parent, WM_MOUSEWHEEL, MSGFLT_ALLOW, NULL); 542 ChangeWindowMessageFilterEx(parent, WM_MOUSEWHEEL, MSGFLT_ALLOW, NULL);
543 ChangeWindowMessageFilterEx(parent, WM_GESTURE, MSGFLT_ALLOW, NULL); 543 ChangeWindowMessageFilterEx(parent, WM_GESTURE, MSGFLT_ALLOW, NULL);
544 ChangeWindowMessageFilterEx(parent, WM_APPCOMMAND, MSGFLT_ALLOW, NULL); 544 ChangeWindowMessageFilterEx(parent, WM_APPCOMMAND, MSGFLT_ALLOW, NULL);
545 ::RemovePropW(orig_parent, webkit::npapi::kNativeWindowClassFilterProp); 545 ::RemovePropW(orig_parent, webkit::npapi::kNativeWindowClassFilterProp);
546 } 546 }
547 ::SetParent(window, parent); 547 ::SetParent(window, parent);
548 // How many times we try to find a PluginProcessHost whose process matches 548 // How many times we try to find a PluginProcessHost whose process matches
549 // the HWND. 549 // the HWND.
550 static const int kMaxTries = 5; 550 static const int kMaxTries = 5;
551 BrowserThread::PostTask( 551 BrowserThread::PostTaskOnIOThread(
darin (slow to review) 2011/12/13 00:51:35 given how small this change is, maybe the PostTask
552 BrowserThread::IO,
553 FROM_HERE, 552 FROM_HERE,
554 base::Bind(&NotifyPluginProcessHostHelper, window, parent, kMaxTries)); 553 base::Bind(&NotifyPluginProcessHostHelper, window, parent, kMaxTries));
555 return parent; 554 return parent;
556 } 555 }
557 556
558 static BOOL CALLBACK AddChildWindowToVector(HWND hwnd, LPARAM lparam) { 557 static BOOL CALLBACK AddChildWindowToVector(HWND hwnd, LPARAM lparam) {
559 std::vector<HWND>* vector = reinterpret_cast<std::vector<HWND>*>(lparam); 558 std::vector<HWND>* vector = reinterpret_cast<std::vector<HWND>*>(lparam);
560 vector->push_back(hwnd); 559 vector->push_back(hwnd);
561 return TRUE; 560 return TRUE;
562 } 561 }
(...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after
2046 scoped_ptr<IPC::Message> message( 2045 scoped_ptr<IPC::Message> message(
2047 new AcceleratedSurfaceMsg_BuffersSwappedACK(params.route_id)); 2046 new AcceleratedSurfaceMsg_BuffersSwappedACK(params.route_id));
2048 base::Closure acknowledge_task = base::Bind( 2047 base::Closure acknowledge_task = base::Bind(
2049 SendToGpuProcessHost, 2048 SendToGpuProcessHost,
2050 gpu_host_id, 2049 gpu_host_id,
2051 base::Passed(&message)); 2050 base::Passed(&message));
2052 2051
2053 accelerated_surface_->AsyncPresentAndAcknowledge( 2052 accelerated_surface_->AsyncPresentAndAcknowledge(
2054 params.size, 2053 params.size,
2055 params.surface_id, 2054 params.surface_id,
2056 base::Bind(BrowserThread::PostTask, 2055 base::Bind(BrowserThread::PostTaskOnIOThread,
2057 BrowserThread::IO,
2058 FROM_HERE, 2056 FROM_HERE,
2059 acknowledge_task)); 2057 acknowledge_task));
2060 } else { 2058 } else {
2061 RenderWidgetHost::AcknowledgeSwapBuffers(params.route_id, gpu_host_id); 2059 RenderWidgetHost::AcknowledgeSwapBuffers(params.route_id, gpu_host_id);
2062 } 2060 }
2063 } 2061 }
2064 2062
2065 void RenderWidgetHostViewWin::AcceleratedSurfacePostSubBuffer( 2063 void RenderWidgetHostViewWin::AcceleratedSurfacePostSubBuffer(
2066 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, 2064 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params,
2067 int gpu_host_id) { 2065 int gpu_host_id) {
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
2487 2485
2488 size_t offset = selection_range_.GetMin() - selection_text_offset_; 2486 size_t offset = selection_range_.GetMin() - selection_text_offset_;
2489 memcpy(reinterpret_cast<char*>(reconv) + sizeof(RECONVERTSTRING), 2487 memcpy(reinterpret_cast<char*>(reconv) + sizeof(RECONVERTSTRING),
2490 selection_text_.c_str() + offset, len * sizeof(WCHAR)); 2488 selection_text_.c_str() + offset, len * sizeof(WCHAR));
2491 2489
2492 // According to Microsft API document, IMR_RECONVERTSTRING and 2490 // According to Microsft API document, IMR_RECONVERTSTRING and
2493 // IMR_DOCUMENTFEED should return reconv, but some applications return 2491 // IMR_DOCUMENTFEED should return reconv, but some applications return
2494 // need_size. 2492 // need_size.
2495 return reinterpret_cast<LRESULT>(reconv); 2493 return reinterpret_cast<LRESULT>(reconv);
2496 } 2494 }
OLDNEW
« no previous file with comments | « content/browser/browser_thread_impl.cc ('k') | content/public/browser/browser_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698