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

Side by Side Diff: win8/test/open_with_dialog_async.cc

Issue 1207823004: PlatformThreadHandle: remove public id() interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: the last two nits Created 5 years, 5 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
« no previous file with comments | « sandbox/linux/services/thread_helpers.cc ('k') | no next file » | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 // Implementation for the asynchronous interface to the Windows shell 5 // Implementation for the asynchronous interface to the Windows shell
6 // SHOpenWithDialog function. The call is made on a dedicated UI thread in a 6 // SHOpenWithDialog function. The call is made on a dedicated UI thread in a
7 // single-threaded apartment. 7 // single-threaded apartment.
8 8
9 #include "win8/test/open_with_dialog_async.h" 9 #include "win8/test/open_with_dialog_async.h"
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // Join with the thread. 72 // Join with the thread.
73 delete context; 73 delete context;
74 74
75 // Run the client's callback. 75 // Run the client's callback.
76 callback.Run(result); 76 callback.Run(result);
77 } 77 }
78 78
79 // Calls SHOpenWithDialog (blocking), and returns the result back to the client 79 // Calls SHOpenWithDialog (blocking), and returns the result back to the client
80 // thread. 80 // thread.
81 void OpenWithDialogTask(OpenWithContext* context) { 81 void OpenWithDialogTask(OpenWithContext* context) {
82 DCHECK_EQ(context->thread.thread_id(), base::PlatformThread::CurrentId()); 82 DCHECK_EQ(context->thread.GetThreadId(), base::PlatformThread::CurrentId());
83 OPENASINFO open_as_info = { 83 OPENASINFO open_as_info = {
84 context->file_name.c_str(), 84 context->file_name.c_str(),
85 context->file_type_class.c_str(), 85 context->file_type_class.c_str(),
86 context->open_as_info_flags 86 context->open_as_info_flags
87 }; 87 };
88 88
89 HRESULT result = ::SHOpenWithDialog(context->parent_window, &open_as_info); 89 HRESULT result = ::SHOpenWithDialog(context->parent_window, &open_as_info);
90 90
91 // Bounce back to the calling thread to release resources and deliver the 91 // Bounce back to the calling thread to release resources and deliver the
92 // callback. 92 // callback.
(...skipping 19 matching lines...) Expand all
112 OpenWithContext* context = 112 OpenWithContext* context =
113 new OpenWithContext(parent_window, file_name, file_type_class, 113 new OpenWithContext(parent_window, file_name, file_type_class,
114 open_as_info_flags, 114 open_as_info_flags,
115 base::ThreadTaskRunnerHandle::Get(), callback); 115 base::ThreadTaskRunnerHandle::Get(), callback);
116 context->thread.message_loop()->PostTask( 116 context->thread.message_loop()->PostTask(
117 FROM_HERE, 117 FROM_HERE,
118 base::Bind(&OpenWithDialogTask, context)); 118 base::Bind(&OpenWithDialogTask, context));
119 } 119 }
120 120
121 } // namespace win8 121 } // namespace win8
OLDNEW
« no previous file with comments | « sandbox/linux/services/thread_helpers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698