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

Side by Side Diff: ppapi/thunk/enter.cc

Issue 10826072: Implement browser side of PPB_Printing resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/tests/test_printing.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ppapi/thunk/enter.h" 5 #include "ppapi/thunk/enter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 retval_(PP_OK) { 55 retval_(PP_OK) {
56 callback_ = new TrackedCallback(resource_, callback); 56 callback_ = new TrackedCallback(resource_, callback);
57 57
58 // TODO(dmichael) validate that threads have an associated message loop. 58 // TODO(dmichael) validate that threads have an associated message loop.
59 } 59 }
60 60
61 EnterBase::~EnterBase() { 61 EnterBase::~EnterBase() {
62 // callback_ is cleared any time it is run, scheduled to be run, or once we 62 // callback_ is cleared any time it is run, scheduled to be run, or once we
63 // know it will be completed asynchronously. So by this point it should be 63 // know it will be completed asynchronously. So by this point it should be
64 // NULL. 64 // NULL.
65 DCHECK(!callback_); 65 DCHECK(!callback_) << "|callback_| is not NULL. Did you forget to call "
66 "|EnterBase::SetResult| in the interface's thunk?";
66 } 67 }
67 68
68 int32_t EnterBase::SetResult(int32_t result) { 69 int32_t EnterBase::SetResult(int32_t result) {
69 if (!callback_) { 70 if (!callback_) {
70 // It doesn't make sense to call SetResult if there is no callback. 71 // It doesn't make sense to call SetResult if there is no callback.
71 NOTREACHED(); 72 NOTREACHED();
72 retval_ = result; 73 retval_ = result;
73 return result; 74 return result;
74 } 75 }
75 if (result == PP_OK_COMPLETIONPENDING) { 76 if (result == PP_OK_COMPLETIONPENDING) {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 : EnterBase(), 265 : EnterBase(),
265 functions_(PpapiGlobals::Get()->GetResourceCreationAPI(instance)) { 266 functions_(PpapiGlobals::Get()->GetResourceCreationAPI(instance)) {
266 SetStateForFunctionError(instance, functions_, true); 267 SetStateForFunctionError(instance, functions_, true);
267 } 268 }
268 269
269 EnterResourceCreationNoLock::~EnterResourceCreationNoLock() { 270 EnterResourceCreationNoLock::~EnterResourceCreationNoLock() {
270 } 271 }
271 272
272 } // namespace thunk 273 } // namespace thunk
273 } // namespace ppapi 274 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/tests/test_printing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698